Crate google_apigee1[−][src]
This documentation was generated from Apigee crate version 2.0.3+20210319, where 20210319 is the exact revision of the apigee:v1 schema built by the mako code generator v2.0.3.
Everything else about the Apigee v1 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 …
- hybrid
- issuers list
- organizations
- analytics datastores create, analytics datastores delete, analytics datastores get, analytics datastores list, analytics datastores test, analytics datastores update, apiproducts attributes, apiproducts attributes delete, apiproducts attributes get, apiproducts attributes list, apiproducts attributes update api product attribute, apiproducts create, apiproducts delete, apiproducts get, apiproducts list, apiproducts update, apis create, apis delete, apis deployments list, apis get, apis keyvaluemaps create, apis keyvaluemaps delete, apis list, apis revisions delete, apis revisions deployments list, apis revisions get, apis revisions update api proxy revision, apps get, apps list, create, datacollectors create, datacollectors delete, datacollectors get, datacollectors list, datacollectors patch, delete, deployments list, developers apps attributes, developers apps attributes delete, developers apps attributes get, developers apps attributes list, developers apps attributes update developer app attribute, developers apps create, developers apps delete, developers apps generate key pair or update developer app status, developers apps get, developers apps keys apiproducts delete, developers apps keys apiproducts update developer app key api product, developers apps keys create, developers apps keys create create, developers apps keys delete, developers apps keys get, developers apps keys replace developer app key, developers apps keys update developer app key, developers apps list, developers apps update, developers attributes, developers attributes delete, developers attributes get, developers attributes list, developers attributes update developer attribute, developers create, developers delete, developers get, developers list, developers set developer status, developers update, envgroups attachments create, envgroups attachments delete, envgroups attachments get, envgroups attachments list, envgroups create, envgroups delete, envgroups get, envgroups list, envgroups patch, environments analytics admin get schemav2, environments analytics exports create, environments analytics exports get, environments analytics exports list, environments apis deployments list, environments apis revisions debugsessions create, environments apis revisions debugsessions data get, environments apis revisions debugsessions delete data, environments apis revisions debugsessions get, environments apis revisions debugsessions list, environments apis revisions deploy, environments apis revisions deployments generate deploy change report, environments apis revisions deployments generate undeploy change report, environments apis revisions get deployments, environments apis revisions undeploy, environments caches delete, environments create, environments delete, environments deployments list, environments flowhooks attach shared flow to flow hook, environments flowhooks detach shared flow from flow hook, environments flowhooks get, environments get, environments get debugmask, environments get deployed config, environments get iam policy, environments get trace config, environments keystores aliases create, environments keystores aliases csr, environments keystores aliases delete, environments keystores aliases get, environments keystores aliases get certificate, environments keystores aliases update, environments keystores create, environments keystores delete, environments keystores get, environments keyvaluemaps create, environments keyvaluemaps delete, environments optimized stats get, environments queries create, environments queries get, environments queries get result, environments queries list, environments references create, environments references delete, environments references get, environments references update, environments resourcefiles create, environments resourcefiles delete, environments resourcefiles get, environments resourcefiles list, environments resourcefiles list environment resources, environments resourcefiles update, environments set iam policy, environments sharedflows deployments list, environments sharedflows revisions deploy, environments sharedflows revisions get deployments, environments sharedflows revisions undeploy, environments stats get, environments subscribe, environments targetservers create, environments targetservers delete, environments targetservers get, environments targetservers update, environments test iam permissions, environments trace config overrides create, environments trace config overrides delete, environments trace config overrides get, environments trace config overrides list, environments trace config overrides patch, environments unsubscribe, environments update, environments update debugmask, environments update environment, environments update trace config, get, get deployed ingress config, get sync authorization, host queries create, host queries get, host queries get result, host queries get result view, host queries list, host stats get, instances attachments create, instances attachments delete, instances attachments get, instances attachments list, instances canaryevaluations create, instances canaryevaluations get, instances create, instances delete, instances get, instances list, instances nat addresses activate, instances nat addresses create, instances nat addresses delete, instances nat addresses get, instances nat addresses list, instances report status, keyvaluemaps create, keyvaluemaps delete, list, operations get, operations list, optimized host stats get, reports create, reports delete, reports get, reports list, reports update, set sync authorization, sharedflows create, sharedflows delete, sharedflows deployments list, sharedflows get, sharedflows list, sharedflows revisions delete, sharedflows revisions deployments list, sharedflows revisions get, sharedflows revisions update shared flow revision, sites apicategories create, sites apicategories delete, sites apicategories get, sites apicategories list, sites apicategories patch and update
- projects
- provision organization
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().await
Or specifically …
let r = hub.organizations().envgroups_attachments_create(...).doit().await let r = hub.organizations().envgroups_attachments_delete(...).doit().await let r = hub.organizations().envgroups_create(...).doit().await let r = hub.organizations().envgroups_delete(...).doit().await let r = hub.organizations().envgroups_patch(...).doit().await let r = hub.organizations().environments_create(...).doit().await let r = hub.organizations().environments_delete(...).doit().await let r = hub.organizations().instances_attachments_create(...).doit().await let r = hub.organizations().instances_attachments_delete(...).doit().await let r = hub.organizations().instances_canaryevaluations_create(...).doit().await let r = hub.organizations().instances_nat_addresses_activate(...).doit().await let r = hub.organizations().instances_nat_addresses_create(...).doit().await let r = hub.organizations().instances_nat_addresses_delete(...).doit().await let r = hub.organizations().instances_create(...).doit().await let r = hub.organizations().instances_delete(...).doit().await let r = hub.organizations().operations_get(...).doit().await let r = hub.organizations().create(...).doit().await let r = hub.organizations().delete(...).doit().await let r = hub.projects().provision_organization(...).doit().await
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-apigee1 = "*"
# This project intentionally uses an old version of Hyper. See
# https://github.com/Byron/google-apis-rs/issues/173 for more
# information.
hyper = "^0.14"
hyper-rustls = "^0.22"
serde = "^1.0"
serde_json = "^1.0"
yup-oauth2 = "^5.0"
A complete example
extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_apigee1 as apigee1; use apigee1::api::GoogleCloudApigeeV1EnvironmentGroup; use apigee1::{Result, Error}; use std::default::Default; use oauth2; use apigee1::Apigee; // Get an ApplicationSecret instance by some means. It contains the `client_id` and // `client_secret`, among other things. let secret: oauth2::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 = yup_oauth2::InstalledFlowAuthenticator::builder( secret, yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect, ).build().await.unwrap(); let mut hub = Apigee::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), 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 = GoogleCloudApigeeV1EnvironmentGroup::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.organizations().envgroups_create(req, "parent") .name("ipsum") .doit().await; 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::Io(_) |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 encodable 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.
Re-exports
pub use api::Apigee; |
pub use client::Result; |
pub use client::Error; |
pub use client::Delegate; |
Modules
api | |
client |