google_androidpublisher3/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 Publisher* crate version *7.0.0+20251216*, where *20251216* is the exact revision of the *androidpublisher:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *Android Publisher* *v3* API can be found at the
8//! [official documentation site](https://developers.google.com/android-publisher).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/androidpublisher3).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](AndroidPublisher) ...
13//!
14//! * applications
15//! * [*data safety*](api::ApplicationDataSafetyCall), [*device tier configs create*](api::ApplicationDeviceTierConfigCreateCall), [*device tier configs get*](api::ApplicationDeviceTierConfigGetCall) and [*device tier configs list*](api::ApplicationDeviceTierConfigListCall)
16//! * apprecovery
17//! * [*add targeting*](api::ApprecoveryAddTargetingCall), [*cancel*](api::ApprecoveryCancelCall), [*create*](api::ApprecoveryCreateCall), [*deploy*](api::ApprecoveryDeployCall) and [*list*](api::ApprecoveryListCall)
18//! * edits
19//! * [*apks addexternallyhosted*](api::EditApkAddexternallyhostedCall), [*apks list*](api::EditApkListCall), [*apks upload*](api::EditApkUploadCall), [*bundles list*](api::EditBundleListCall), [*bundles upload*](api::EditBundleUploadCall), [*commit*](api::EditCommitCall), [*countryavailability get*](api::EditCountryavailabilityGetCall), [*delete*](api::EditDeleteCall), [*deobfuscationfiles upload*](api::EditDeobfuscationfileUploadCall), [*details get*](api::EditDetailGetCall), [*details patch*](api::EditDetailPatchCall), [*details update*](api::EditDetailUpdateCall), [*expansionfiles get*](api::EditExpansionfileGetCall), [*expansionfiles patch*](api::EditExpansionfilePatchCall), [*expansionfiles update*](api::EditExpansionfileUpdateCall), [*expansionfiles upload*](api::EditExpansionfileUploadCall), [*get*](api::EditGetCall), [*images delete*](api::EditImageDeleteCall), [*images deleteall*](api::EditImageDeleteallCall), [*images list*](api::EditImageListCall), [*images upload*](api::EditImageUploadCall), [*insert*](api::EditInsertCall), [*listings delete*](api::EditListingDeleteCall), [*listings deleteall*](api::EditListingDeleteallCall), [*listings get*](api::EditListingGetCall), [*listings list*](api::EditListingListCall), [*listings patch*](api::EditListingPatchCall), [*listings update*](api::EditListingUpdateCall), [*testers get*](api::EditTesterGetCall), [*testers patch*](api::EditTesterPatchCall), [*testers update*](api::EditTesterUpdateCall), [*tracks create*](api::EditTrackCreateCall), [*tracks get*](api::EditTrackGetCall), [*tracks list*](api::EditTrackListCall), [*tracks patch*](api::EditTrackPatchCall), [*tracks update*](api::EditTrackUpdateCall) and [*validate*](api::EditValidateCall)
20//! * externaltransactions
21//! * [*createexternaltransaction*](api::ExternaltransactionCreateexternaltransactionCall), [*getexternaltransaction*](api::ExternaltransactionGetexternaltransactionCall) and [*refundexternaltransaction*](api::ExternaltransactionRefundexternaltransactionCall)
22//! * generatedapks
23//! * [*download*](api::GeneratedapkDownloadCall) and [*list*](api::GeneratedapkListCall)
24//! * [grants](api::Grant)
25//! * [*create*](api::GrantCreateCall), [*delete*](api::GrantDeleteCall) and [*patch*](api::GrantPatchCall)
26//! * inappproducts
27//! * [*batch delete*](api::InappproductBatchDeleteCall), [*batch get*](api::InappproductBatchGetCall), [*batch update*](api::InappproductBatchUpdateCall), [*delete*](api::InappproductDeleteCall), [*get*](api::InappproductGetCall), [*insert*](api::InappproductInsertCall), [*list*](api::InappproductListCall), [*patch*](api::InappproductPatchCall) and [*update*](api::InappproductUpdateCall)
28//! * internalappsharingartifacts
29//! * [*uploadapk*](api::InternalappsharingartifactUploadapkCall) and [*uploadbundle*](api::InternalappsharingartifactUploadbundleCall)
30//! * monetization
31//! * [*convert region prices*](api::MonetizationConvertRegionPriceCall), [*onetimeproducts batch delete*](api::MonetizationOnetimeproductBatchDeleteCall), [*onetimeproducts batch get*](api::MonetizationOnetimeproductBatchGetCall), [*onetimeproducts batch update*](api::MonetizationOnetimeproductBatchUpdateCall), [*onetimeproducts delete*](api::MonetizationOnetimeproductDeleteCall), [*onetimeproducts get*](api::MonetizationOnetimeproductGetCall), [*onetimeproducts list*](api::MonetizationOnetimeproductListCall), [*onetimeproducts patch*](api::MonetizationOnetimeproductPatchCall), [*onetimeproducts purchase options batch delete*](api::MonetizationOnetimeproductPurchaseOptionBatchDeleteCall), [*onetimeproducts purchase options batch update states*](api::MonetizationOnetimeproductPurchaseOptionBatchUpdateStateCall), [*onetimeproducts purchase options offers activate*](api::MonetizationOnetimeproductPurchaseOptionOfferActivateCall), [*onetimeproducts purchase options offers batch delete*](api::MonetizationOnetimeproductPurchaseOptionOfferBatchDeleteCall), [*onetimeproducts purchase options offers batch get*](api::MonetizationOnetimeproductPurchaseOptionOfferBatchGetCall), [*onetimeproducts purchase options offers batch update*](api::MonetizationOnetimeproductPurchaseOptionOfferBatchUpdateCall), [*onetimeproducts purchase options offers batch update states*](api::MonetizationOnetimeproductPurchaseOptionOfferBatchUpdateStateCall), [*onetimeproducts purchase options offers cancel*](api::MonetizationOnetimeproductPurchaseOptionOfferCancelCall), [*onetimeproducts purchase options offers deactivate*](api::MonetizationOnetimeproductPurchaseOptionOfferDeactivateCall), [*onetimeproducts purchase options offers list*](api::MonetizationOnetimeproductPurchaseOptionOfferListCall), [*subscriptions archive*](api::MonetizationSubscriptionArchiveCall), [*subscriptions base plans activate*](api::MonetizationSubscriptionBasePlanActivateCall), [*subscriptions base plans batch migrate prices*](api::MonetizationSubscriptionBasePlanBatchMigratePriceCall), [*subscriptions base plans batch update states*](api::MonetizationSubscriptionBasePlanBatchUpdateStateCall), [*subscriptions base plans deactivate*](api::MonetizationSubscriptionBasePlanDeactivateCall), [*subscriptions base plans delete*](api::MonetizationSubscriptionBasePlanDeleteCall), [*subscriptions base plans migrate prices*](api::MonetizationSubscriptionBasePlanMigratePriceCall), [*subscriptions base plans offers activate*](api::MonetizationSubscriptionBasePlanOfferActivateCall), [*subscriptions base plans offers batch get*](api::MonetizationSubscriptionBasePlanOfferBatchGetCall), [*subscriptions base plans offers batch update*](api::MonetizationSubscriptionBasePlanOfferBatchUpdateCall), [*subscriptions base plans offers batch update states*](api::MonetizationSubscriptionBasePlanOfferBatchUpdateStateCall), [*subscriptions base plans offers create*](api::MonetizationSubscriptionBasePlanOfferCreateCall), [*subscriptions base plans offers deactivate*](api::MonetizationSubscriptionBasePlanOfferDeactivateCall), [*subscriptions base plans offers delete*](api::MonetizationSubscriptionBasePlanOfferDeleteCall), [*subscriptions base plans offers get*](api::MonetizationSubscriptionBasePlanOfferGetCall), [*subscriptions base plans offers list*](api::MonetizationSubscriptionBasePlanOfferListCall), [*subscriptions base plans offers patch*](api::MonetizationSubscriptionBasePlanOfferPatchCall), [*subscriptions batch get*](api::MonetizationSubscriptionBatchGetCall), [*subscriptions batch update*](api::MonetizationSubscriptionBatchUpdateCall), [*subscriptions create*](api::MonetizationSubscriptionCreateCall), [*subscriptions delete*](api::MonetizationSubscriptionDeleteCall), [*subscriptions get*](api::MonetizationSubscriptionGetCall), [*subscriptions list*](api::MonetizationSubscriptionListCall) and [*subscriptions patch*](api::MonetizationSubscriptionPatchCall)
32//! * [orders](api::Order)
33//! * [*batchget*](api::OrderBatchgetCall), [*get*](api::OrderGetCall) and [*refund*](api::OrderRefundCall)
34//! * purchases
35//! * [*products acknowledge*](api::PurchaseProductAcknowledgeCall), [*products consume*](api::PurchaseProductConsumeCall), [*products get*](api::PurchaseProductGetCall), [*productsv2 getproductpurchasev2*](api::PurchaseProductsv2Getproductpurchasev2Call), [*subscriptions acknowledge*](api::PurchaseSubscriptionAcknowledgeCall), [*subscriptions cancel*](api::PurchaseSubscriptionCancelCall), [*subscriptions defer*](api::PurchaseSubscriptionDeferCall), [*subscriptions get*](api::PurchaseSubscriptionGetCall), [*subscriptions refund*](api::PurchaseSubscriptionRefundCall), [*subscriptions revoke*](api::PurchaseSubscriptionRevokeCall), [*subscriptionsv2 cancel*](api::PurchaseSubscriptionsv2CancelCall), [*subscriptionsv2 get*](api::PurchaseSubscriptionsv2GetCall), [*subscriptionsv2 revoke*](api::PurchaseSubscriptionsv2RevokeCall) and [*voidedpurchases list*](api::PurchaseVoidedpurchaseListCall)
36//! * [reviews](api::Review)
37//! * [*get*](api::ReviewGetCall), [*list*](api::ReviewListCall) and [*reply*](api::ReviewReplyCall)
38//! * systemapks
39//! * [*variants create*](api::SystemapkVariantCreateCall), [*variants download*](api::SystemapkVariantDownloadCall), [*variants get*](api::SystemapkVariantGetCall) and [*variants list*](api::SystemapkVariantListCall)
40//! * [users](api::User)
41//! * [*create*](api::UserCreateCall), [*delete*](api::UserDeleteCall), [*list*](api::UserListCall) and [*patch*](api::UserPatchCall)
42//!
43//!
44//! Upload supported by ...
45//!
46//! * [*apks upload edits*](api::EditApkUploadCall)
47//! * [*bundles upload edits*](api::EditBundleUploadCall)
48//! * [*deobfuscationfiles upload edits*](api::EditDeobfuscationfileUploadCall)
49//! * [*expansionfiles upload edits*](api::EditExpansionfileUploadCall)
50//! * [*images upload edits*](api::EditImageUploadCall)
51//! * [*uploadapk internalappsharingartifacts*](api::InternalappsharingartifactUploadapkCall)
52//! * [*uploadbundle internalappsharingartifacts*](api::InternalappsharingartifactUploadbundleCall)
53//!
54//! Download supported by ...
55//!
56//! * [*download generatedapks*](api::GeneratedapkDownloadCall)
57//! * [*variants download systemapks*](api::SystemapkVariantDownloadCall)
58//!
59//!
60//!
61//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
62//!
63//! # Structure of this Library
64//!
65//! The API is structured into the following primary items:
66//!
67//! * **[Hub](AndroidPublisher)**
68//! * a central object to maintain state and allow accessing all *Activities*
69//! * creates [*Method Builders*](common::MethodsBuilder) which in turn
70//! allow access to individual [*Call Builders*](common::CallBuilder)
71//! * **[Resources](common::Resource)**
72//! * primary types that you can apply *Activities* to
73//! * a collection of properties and *Parts*
74//! * **[Parts](common::Part)**
75//! * a collection of properties
76//! * never directly used in *Activities*
77//! * **[Activities](common::CallBuilder)**
78//! * operations to apply to *Resources*
79//!
80//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
81//!
82//! Generally speaking, you can invoke *Activities* like this:
83//!
84//! ```Rust,ignore
85//! let r = hub.resource().activity(...).doit().await
86//! ```
87//!
88//! Or specifically ...
89//!
90//! ```ignore
91//! let r = hub.monetization().subscriptions_base_plans_activate(...).doit().await
92//! let r = hub.monetization().subscriptions_base_plans_deactivate(...).doit().await
93//! let r = hub.monetization().subscriptions_archive(...).doit().await
94//! let r = hub.monetization().subscriptions_create(...).doit().await
95//! let r = hub.monetization().subscriptions_get(...).doit().await
96//! let r = hub.monetization().subscriptions_patch(...).doit().await
97//! ```
98//!
99//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
100//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
101//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
102//! The `doit()` method performs the actual communication with the server and returns the respective result.
103//!
104//! # Usage
105//!
106//! ## Setting up your Project
107//!
108//! To use this library, you would put the following lines into your `Cargo.toml` file:
109//!
110//! ```toml
111//! [dependencies]
112//! google-androidpublisher3 = "*"
113//! serde = "1"
114//! serde_json = "1"
115//! ```
116//!
117//! ## A complete example
118//!
119//! ```test_harness,no_run
120//! extern crate hyper;
121//! extern crate hyper_rustls;
122//! extern crate google_androidpublisher3 as androidpublisher3;
123//! use androidpublisher3::api::Subscription;
124//! use androidpublisher3::{Result, Error};
125//! # async fn dox() {
126//! use androidpublisher3::{AndroidPublisher, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
127//!
128//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
129//! // `client_secret`, among other things.
130//! let secret: yup_oauth2::ApplicationSecret = Default::default();
131//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
132//! // unless you replace `None` with the desired Flow.
133//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
134//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
135//! // retrieve them from storage.
136//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
137//! .with_native_roots()
138//! .unwrap()
139//! .https_only()
140//! .enable_http2()
141//! .build();
142//!
143//! let executor = hyper_util::rt::TokioExecutor::new();
144//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
145//! secret,
146//! yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
147//! yup_oauth2::client::CustomHyperClientBuilder::from(
148//! hyper_util::client::legacy::Client::builder(executor).build(connector),
149//! ),
150//! ).build().await.unwrap();
151//!
152//! let client = hyper_util::client::legacy::Client::builder(
153//! hyper_util::rt::TokioExecutor::new()
154//! )
155//! .build(
156//! hyper_rustls::HttpsConnectorBuilder::new()
157//! .with_native_roots()
158//! .unwrap()
159//! .https_or_http()
160//! .enable_http2()
161//! .build()
162//! );
163//! let mut hub = AndroidPublisher::new(client, auth);
164//! // As the method needs a request, you would usually fill it with the desired information
165//! // into the respective structure. Some of the parts shown here might not be applicable !
166//! // Values shown here are possibly random and not representative !
167//! let mut req = Subscription::default();
168//!
169//! // You can configure optional parameters by calling the respective setters at will, and
170//! // execute the final call using `doit()`.
171//! // Values shown here are possibly random and not representative !
172//! let result = hub.monetization().subscriptions_patch(req, "packageName", "productId")
173//! .update_mask(FieldMask::new::<&str>(&[]))
174//! .regions_version_version("amet.")
175//! .latency_tolerance("duo")
176//! .allow_missing(true)
177//! .doit().await;
178//!
179//! match result {
180//! Err(e) => match e {
181//! // The Error enum provides details about what exactly happened.
182//! // You can also just use its `Debug`, `Display` or `Error` traits
183//! Error::HttpError(_)
184//! |Error::Io(_)
185//! |Error::MissingAPIKey
186//! |Error::MissingToken(_)
187//! |Error::Cancelled
188//! |Error::UploadSizeLimitExceeded(_, _)
189//! |Error::Failure(_)
190//! |Error::BadRequest(_)
191//! |Error::FieldClash(_)
192//! |Error::JsonDecodeError(_, _) => println!("{}", e),
193//! },
194//! Ok(res) => println!("Success: {:?}", res),
195//! }
196//! # }
197//! ```
198//! ## Handling Errors
199//!
200//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
201//! the doit() methods, or handed as possibly intermediate results to either the
202//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
203//!
204//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
205//! makes the system potentially resilient to all kinds of errors.
206//!
207//! ## Uploads and Downloads
208//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
209//! read by you to obtain the media.
210//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
211//! 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
212//! this call: `.param("alt", "media")`.
213//!
214//! Methods supporting uploads can do so using up to 2 different protocols:
215//! *simple* and *resumable*. The distinctiveness of each is represented by customized
216//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
217//!
218//! ## Customization and Callbacks
219//!
220//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
221//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
222//! Respective methods will be called to provide progress information, as well as determine whether the system should
223//! retry on failure.
224//!
225//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
226//!
227//! ## Optional Parts in Server-Requests
228//!
229//! All structures provided by this library are made to be [encodable](common::RequestValue) and
230//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
231//! are valid.
232//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
233//! the server to indicate either the set parts of the request or the desired parts in the response.
234//!
235//! ## Builder Arguments
236//!
237//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
238//! These will always take a single argument, for which the following statements are true.
239//!
240//! * [PODs][wiki-pod] are handed by copy
241//! * strings are passed as `&str`
242//! * [request values](common::RequestValue) are moved
243//!
244//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
245//!
246//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
247//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
248//! [google-go-api]: https://github.com/google/google-api-go-client
249//!
250//! ## Cargo Features
251//!
252//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
253//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
254//! generated `openapi` spec would be invalid.
255//!
256//!
257//!
258
259// Unused attributes happen thanks to defined, but unused structures We don't
260// warn about this, as depending on the API, some data structures or facilities
261// are never used. Instead of pre-determining this, we just disable the lint.
262// It's manually tuned to not have any unused imports in fully featured APIs.
263// Same with unused_mut.
264#![allow(unused_imports, unused_mut, dead_code)]
265
266// DO NOT EDIT !
267// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
268// DO NOT EDIT !
269
270pub extern crate hyper;
271pub extern crate hyper_rustls;
272pub extern crate hyper_util;
273#[cfg(feature = "yup-oauth2")]
274pub extern crate yup_oauth2;
275
276pub extern crate google_apis_common as common;
277pub use common::{Delegate, Error, FieldMask, Result};
278
279pub mod api;
280pub use api::AndroidPublisher;