Crate google_androidpublisher2 [−] [src]
This documentation was generated from Android Publisher crate version 1.0.0+20160817, where 20160817 is the exact revision of the androidpublisher:v2 schema built by the mako code generator v1.0.0.
Everything else about the Android Publisher v2 API can be found at the official documentation site. The original source code is on github.
Features
Handle the following Resources with ease from the central hub ...
- edits
- apklistings delete, apklistings deleteall, apklistings get, apklistings list, apklistings patch, apklistings update, apks addexternallyhosted, apks list, apks upload, commit, delete, details get, details patch, details update, expansionfiles get, expansionfiles patch, expansionfiles update, expansionfiles upload, get, images delete, images deleteall, images list, images upload, insert, listings delete, listings deleteall, listings get, listings list, listings patch, listings update, testers get, testers patch, testers update, tracks get, tracks list, tracks patch, tracks update and validate
- entitlements
- inappproducts
- purchases
- reviews
Upload supported by ...
Not what you are looking for ? Find all other Google APIs in their Rust documentation index.
Structure of this Library
The API is structured into the following primary items:
- Hub
- a central object to maintain state and allow accessing all Activities
- creates Method Builders which in turn allow access to individual Call Builders
- Resources
- primary types that you can apply Activities to
- a collection of properties and Parts
- Parts
- a collection of properties
- never directly used in Activities
- Activities
- operations to apply to Resources
All structures are marked with applicable traits to further categorize them and ease browsing.
Generally speaking, you can invoke Activities like this:
let r = hub.resource().activity(...).doit()
Or specifically ...
let r = hub.inappproducts().patch(...).doit() let r = hub.inappproducts().insert(...).doit() let r = hub.inappproducts().get(...).doit() let r = hub.inappproducts().update(...).doit()
The resource()
and activity(...)
calls create builders. The second one dealing with Activities
supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
specified right away (i.e. (...)
), whereas all optional ones can be build up as desired.
The doit()
method performs the actual communication with the server and returns the respective result.
Usage
Setting up your Project
To use this library, you would put the following lines into your Cargo.toml
file:
[dependencies]
google-androidpublisher2 = "*"
A complete example
extern crate hyper; extern crate yup_oauth2 as oauth2; extern crate google_androidpublisher2 as androidpublisher2; use androidpublisher2::InAppProduct; use androidpublisher2::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; use androidpublisher2::AndroidPublisher; // Get an ApplicationSecret instance by some means. It contains the `client_id` and // `client_secret`, among other things. let secret: ApplicationSecret = Default::default(); // Instantiate the authenticator. It will choose a suitable authentication flow for you, // unless you replace `None` with the desired Flow. // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and // retrieve them from storage. let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::new(), <MemoryStorage as Default>::default(), None); let mut hub = AndroidPublisher::new(hyper::Client::new(), auth); // As the method needs a request, you would usually fill it with the desired information // into the respective structure. Some of the parts shown here might not be applicable ! // Values shown here are possibly random and not representative ! let mut req = InAppProduct::default(); // You can configure optional parameters by calling the respective setters at will, and // execute the final call using `doit()`. // Values shown here are possibly random and not representative ! let result = hub.inappproducts().patch(req, "packageName", "sku") .auto_convert_missing_prices(true) .doit(); match result { Err(e) => match e { // The Error enum provides details about what exactly happened. // You can also just use its `Debug`, `Display` or `Error` traits Error::HttpError(_) |Error::MissingAPIKey |Error::MissingToken(_) |Error::Cancelled |Error::UploadSizeLimitExceeded(_, _) |Error::Failure(_) |Error::BadRequest(_) |Error::FieldClash(_) |Error::JsonDecodeError(_, _) => println!("{}", e), }, Ok(res) => println!("Success: {:?}", res), }
Handling Errors
All errors produced by the system are provided either as Result enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the Hub Delegate, or the Authenticator Delegate.
When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors.
Uploads and Downloads
If a method supports downloads, the response body, which is part of the Result, should be
read by you to obtain the media.
If such a method also supports a Response Result, it will return that by default.
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
this call: .param("alt", "media")
.
Methods supporting uploads can do so using up to 2 different protocols:
simple and resumable. The distinctiveness of each is represented by customized
doit(...)
methods, which are then named upload(...)
and upload_resumable(...)
respectively.
Customization and Callbacks
You may alter the way an doit()
method is called by providing a delegate to the
Method Builder before making the final doit()
call.
Respective methods will be called to provide progress information, as well as determine whether the system should
retry on failure.
The delegate trait is default-implemented, allowing you to customize it with minimal effort.
Optional Parts in Server-Requests
All structures provided by this library are made to be enocodable and decodable via json. Optionals are used to indicate that partial requests are responses are valid. Most optionals are are considered Parts which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response.
Builder Arguments
Using method builders, you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true.
- PODs are handed by copy
- strings are passed as
&str
- request values are moved
Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
Structs
AndroidPublisher |
Central instance to access all AndroidPublisher related resource activities |
Apk |
There is no detailed description. |
ApkBinary |
Represents the binary payload of an APK. |
ApkListing |
There is no detailed description. |
ApkListingsListResponse |
There is no detailed description. |
ApksAddExternallyHostedRequest |
There is no detailed description. |
ApksAddExternallyHostedResponse |
There is no detailed description. |
ApksListResponse |
There is no detailed description. |
AppDetails |
There is no detailed description. |
AppEdit |
Represents an edit of an app. An edit allows clients to make multiple changes before committing them in one operation. |
Comment |
There is no detailed description. |
DefaultDelegate |
A delegate with a conservative default implementation, which is used if no other delegate is set. |
DeveloperComment |
There is no detailed description. |
EditApkAddexternallyhostedCall |
Creates a new APK without uploading the APK itself to Google Play, instead hosting the APK at a specified URL. This function is only available to enterprises using Google Play for Work whose application is configured to restrict distribution to the enterprise domain. |
EditApkListCall |
A builder for the apks.list method supported by a edit resource.
It is not used directly, but through a |
EditApkUploadCall |
A builder for the apks.upload method supported by a edit resource.
It is not used directly, but through a |
EditApklistingDeleteCall |
Deletes the APK-specific localized listing for a specified APK and language code. |
EditApklistingDeleteallCall |
Deletes all the APK-specific localized listings for a specified APK. |
EditApklistingGetCall |
Fetches the APK-specific localized listing for a specified APK and language code. |
EditApklistingListCall |
Lists all the APK-specific localized listings for a specified APK. |
EditApklistingPatchCall |
Updates or creates the APK-specific localized listing for a specified APK and language code. This method supports patch semantics. |
EditApklistingUpdateCall |
Updates or creates the APK-specific localized listing for a specified APK and language code. |
EditCommitCall |
Commits/applies the changes made in this edit back to the app. |
EditDeleteCall |
Deletes an edit for an app. Creating a new edit will automatically delete any of your previous edits so this method need only be called if you want to preemptively abandon an edit. |
EditDetailGetCall |
Fetches app details for this edit. This includes the default language and developer support contact information. |
EditDetailPatchCall |
Updates app details for this edit. This method supports patch semantics. |
EditDetailUpdateCall |
Updates app details for this edit. |
EditExpansionfileGetCall |
Fetches the Expansion File configuration for the APK specified. |
EditExpansionfilePatchCall |
Updates the APK's Expansion File configuration to reference another APK's Expansion Files. To add a new Expansion File use the Upload method. This method supports patch semantics. |
EditExpansionfileUpdateCall |
Updates the APK's Expansion File configuration to reference another APK's Expansion Files. To add a new Expansion File use the Upload method. |
EditExpansionfileUploadCall |
Uploads and attaches a new Expansion File to the APK specified. |
EditGetCall |
Returns information about the edit specified. Calls will fail if the edit is no long active (e.g. has been deleted, superseded or expired). |
EditImageDeleteCall |
Deletes the image (specified by id) from the edit. |
EditImageDeleteallCall |
Deletes all images for the specified language and image type. |
EditImageListCall |
Lists all images for the specified language and image type. |
EditImageUploadCall |
Uploads a new image and adds it to the list of images for the specified language and image type. |
EditInsertCall |
Creates a new edit for an app, populated with the app's current state. |
EditListingDeleteCall |
Deletes the specified localized store listing from an edit. |
EditListingDeleteallCall |
Deletes all localized listings from an edit. |
EditListingGetCall |
Fetches information about a localized store listing. |
EditListingListCall |
Returns all of the localized store listings attached to this edit. |
EditListingPatchCall |
Creates or updates a localized store listing. This method supports patch semantics. |
EditListingUpdateCall |
Creates or updates a localized store listing. |
EditMethods |
A builder providing access to all methods supported on edit resources.
It is not used directly, but through the |
EditTesterGetCall |
A builder for the testers.get method supported by a edit resource.
It is not used directly, but through a |
EditTesterPatchCall |
A builder for the testers.patch method supported by a edit resource.
It is not used directly, but through a |
EditTesterUpdateCall |
A builder for the testers.update method supported by a edit resource.
It is not used directly, but through a |
EditTrackGetCall |
Fetches the track configuration for the specified track type. Includes the APK version codes that are in this track. |
EditTrackListCall |
Lists all the track configurations for this edit. |
EditTrackPatchCall |
Updates the track configuration for the specified track type. When halted, the rollout track cannot be updated without adding new APKs, and adding new APKs will cause it to resume. This method supports patch semantics. |
EditTrackUpdateCall |
Updates the track configuration for the specified track type. When halted, the rollout track cannot be updated without adding new APKs, and adding new APKs will cause it to resume. |
EditValidateCall |
Checks that the edit can be successfully committed. The edit's changes are not applied to the live app. |
Entitlement |
An Entitlement resource indicates a user's current entitlement to an inapp item or subscription. |
EntitlementListCall |
Lists the user's current inapp item or subscription entitlements |
EntitlementMethods |
A builder providing access to all methods supported on entitlement resources.
It is not used directly, but through the |
EntitlementsListResponse |
There is no detailed description. |
ErrorResponse |
A utility to represent detailed errors we might see in case there are BadRequests. The latter happen if the sent parameters or request structures are unsound |
ExpansionFile |
There is no detailed description. |
ExpansionFilesUploadResponse |
There is no detailed description. |
ExternallyHostedApk |
Defines an APK available for this application that is hosted externally and not uploaded to Google Play. This function is only available to enterprises who are using Google Play for Work, and whos application is restricted to the enterprise private channel |
ExternallyHostedApkUsesPermission |
A permission used by this APK. |
Image |
There is no detailed description. |
ImagesDeleteAllResponse |
There is no detailed description. |
ImagesListResponse |
There is no detailed description. |
ImagesUploadResponse |
There is no detailed description. |
InAppProduct |
There is no detailed description. |
InAppProductListing |
There is no detailed description. |
InappproductBatchCall |
A builder for the batch method supported by a inappproduct resource.
It is not used directly, but through a |
InappproductDeleteCall |
Delete an in-app product for an app. |
InappproductGetCall |
Returns information about the in-app product specified. |
InappproductInsertCall |
Creates a new in-app product for an app. |
InappproductListCall |
List all the in-app products for an Android app, both subscriptions and managed in-app products.. |
InappproductMethods |
A builder providing access to all methods supported on inappproduct resources.
It is not used directly, but through the |
InappproductPatchCall |
Updates the details of an in-app product. This method supports patch semantics. |
InappproductUpdateCall |
Updates the details of an in-app product. |
InappproductsBatchRequest |
There is no detailed description. |
InappproductsBatchRequestEntry |
There is no detailed description. |
InappproductsBatchResponse |
There is no detailed description. |
InappproductsBatchResponseEntry |
There is no detailed description. |
InappproductsInsertRequest |
There is no detailed description. |
InappproductsInsertResponse |
There is no detailed description. |
InappproductsListResponse |
There is no detailed description. |
InappproductsUpdateRequest |
There is no detailed description. |
InappproductsUpdateResponse |
There is no detailed description. |
Listing |
There is no detailed description. |
ListingsListResponse |
There is no detailed description. |
MethodInfo |
Contains information about an API request. |
MonthDay |
There is no detailed description. |
MultiPartReader |
Provides a |
PageInfo |
There is no detailed description. |
Price |
There is no detailed description. |
ProductPurchase |
A ProductPurchase resource indicates the status of a user's inapp product purchase. |
Prorate |
There is no detailed description. |
PurchaseMethods |
A builder providing access to all methods supported on purchase resources.
It is not used directly, but through the |
PurchaseProductGetCall |
Checks the purchase and consumption status of an inapp item. |
PurchaseSubscriptionCancelCall |
Cancels a user's subscription purchase. The subscription remains valid until its expiration time. |
PurchaseSubscriptionDeferCall |
Defers a user's subscription purchase until a specified future expiration time. |
PurchaseSubscriptionGetCall |
Checks whether a user's subscription purchase is valid and returns its expiry time. |
PurchaseSubscriptionRefundCall |
Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur. |
PurchaseSubscriptionRevokeCall |
Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring. |
Review |
There is no detailed description. |
ReviewGetCall |
Returns a single review. |
ReviewListCall |
Returns a list of reviews. |
ReviewMethods |
A builder providing access to all methods supported on review resources.
It is not used directly, but through the |
ReviewReplyCall |
Reply to a single review, or update an existing reply. |
ReviewReplyResult |
There is no detailed description. |
ReviewsListResponse |
There is no detailed description. |
ReviewsReplyRequest |
There is no detailed description. |
ReviewsReplyResponse |
There is no detailed description. |
Season |
There is no detailed description. |
SubscriptionDeferralInfo |
A SubscriptionDeferralInfo contains the data needed to defer a subscription purchase to a future expiry time. |
SubscriptionPurchase |
A SubscriptionPurchase resource indicates the status of a user's subscription purchase. |
SubscriptionPurchasesDeferRequest |
There is no detailed description. |
SubscriptionPurchasesDeferResponse |
There is no detailed description. |
Testers |
There is no detailed description. |
Timestamp |
There is no detailed description. |
TokenPagination |
There is no detailed description. |
Track |
There is no detailed description. |
TracksListResponse |
There is no detailed description. |
UserComment |
There is no detailed description. |
Enums
Error | |
Scope |
Identifies the an OAuth2 authorization scope. A scope is needed when requesting an authorization token. |
Traits
CallBuilder |
Identifies types which represent builders for a particular resource method |
Delegate |
A trait specifying functionality to help controlling any request performed by the API. The trait has a conservative default implementation. |
Hub |
Identifies the Hub. There is only one per library, this trait is supposed to make intended use more explicit. The hub allows to access all resource methods more easily. |
MethodsBuilder |
Identifies types for building methods of a particular resource type |
NestedType |
Identifies types which are only used by other types internally. They have no special meaning, this trait just marks them for completeness. |
Part |
Identifies types which are only used as part of other types, which
usually are carrying the |
ReadSeek |
A utility to specify reader types which provide seeking capabilities too |
RequestValue |
Identifies types which are used in API requests. |
Resource |
Identifies types which can be inserted and deleted. Types with this trait are most commonly used by clients of this API. |
ResponseResult |
Identifies types which are used in API responses. |
ToParts |
A trait for all types that can convert themselves into a parts string |
Functions
remove_json_null_values |
Type Definitions
Result |
A universal result type used as return for all calls. |