mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2025-12-26 17:02:24 +01:00
regenerate all APIs and CLIs (#357)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
# DO NOT EDIT !
|
||||
# This file was generated automatically from 'src/mako/Cargo.toml.mako'
|
||||
# This file was generated automatically from 'src/generator/templates/Cargo.toml.mako'
|
||||
# DO NOT EDIT !
|
||||
[package]
|
||||
|
||||
name = "google-replicapool1_beta2-cli"
|
||||
version = "3.1.0+20160512"
|
||||
version = "4.0.1+20160512"
|
||||
authors = ["Sebastian Thiel <byronimo@gmail.com>"]
|
||||
description = "A complete library to interact with replicapool (protocol v1beta2)"
|
||||
repository = "https://github.com/Byron/google-apis-rs/tree/main/gen/replicapool1_beta2-cli"
|
||||
@@ -25,16 +25,18 @@ mime = "^ 0.2.0"
|
||||
serde = "^ 1.0"
|
||||
serde_json = "^ 1.0"
|
||||
serde_derive = "^ 1.0"
|
||||
yup-oauth2 = "^ 6.6"
|
||||
yup-oauth2 = "^ 7.0"
|
||||
itertools = "^ 0.10"
|
||||
strsim = "^0.5"
|
||||
clap = "^2.0"
|
||||
http = "^0.2"
|
||||
hyper = { version = "0.14", features = ["full"] }
|
||||
tokio = { version = "^ 1.0", features = ["full"] }
|
||||
tower-service = "^0.3.1"
|
||||
|
||||
|
||||
|
||||
|
||||
[dependencies.google-replicapool1_beta2]
|
||||
path = "../replicapool1_beta2"
|
||||
version = "3.1.0+20160512"
|
||||
version = "4.0.1+20160512"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!---
|
||||
DO NOT EDIT !
|
||||
This file was generated automatically from 'src/mako/LICENSE.md.mako'
|
||||
This file was generated automatically from 'src/generator/templates/LICENSE.md.mako'
|
||||
DO NOT EDIT !
|
||||
-->
|
||||
The MIT License (MIT)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!---
|
||||
DO NOT EDIT !
|
||||
This file was generated automatically from 'src/mako/cli/README.md.mako'
|
||||
This file was generated automatically from 'src/generator/templates/cli/README.md.mako'
|
||||
DO NOT EDIT !
|
||||
-->
|
||||
The `replicapool1-beta2` command-line interface *(CLI)* allows to use most features of the *Google replicapool* service from the comfort of your terminal.
|
||||
@@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma
|
||||
|
||||
# Usage
|
||||
|
||||
This documentation was generated from the *replicapool* API at revision *20160512*. The CLI is at version *3.1.0*.
|
||||
This documentation was generated from the *replicapool* API at revision *20160512*. The CLI is at version *4.0.1*.
|
||||
|
||||
```bash
|
||||
replicapool1-beta2 [options]
|
||||
@@ -114,4 +114,4 @@ You may consider redirecting standard error into a file for ease of use, e.g. `r
|
||||
[scopes]: https://developers.google.com/+/api/oauth#scopes
|
||||
[revoke-access]: http://webapps.stackexchange.com/a/30849
|
||||
[google-dev-console]: https://console.developers.google.com/
|
||||
[google-project-new]: https://developers.google.com/console/help/new/
|
||||
[google-project-new]: https://developers.google.com/console/help/new/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
site_name: replicapool v3.1.0+20160512
|
||||
site_name: replicapool v4.0.1+20160512
|
||||
site_url: http://byron.github.io/google-apis-rs/google-replicapool1_beta2-cli
|
||||
site_description: A complete library to interact with replicapool (protocol v1beta2)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// DO NOT EDIT !
|
||||
// This file was generated automatically from 'src/mako/cli/main.rs.mako'
|
||||
// This file was generated automatically from 'src/generator/templates/cli/main.rs.mako'
|
||||
// DO NOT EDIT !
|
||||
#![allow(unused_variables, unused_imports, dead_code, unused_mut)]
|
||||
|
||||
@@ -21,25 +21,36 @@ use client::{InvalidOptionsError, CLIError, arg_from_str, writer_from_opts, pars
|
||||
calltype_from_str, remove_json_null_values, ComplexType, JsonType, JsonTypeInfo};
|
||||
|
||||
use std::default::Default;
|
||||
use std::error::Error as StdError;
|
||||
use std::str::FromStr;
|
||||
|
||||
use serde_json as json;
|
||||
use clap::ArgMatches;
|
||||
use http::Uri;
|
||||
use hyper::client::connect;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tower_service;
|
||||
|
||||
enum DoitError {
|
||||
IoError(String, io::Error),
|
||||
ApiError(Error),
|
||||
}
|
||||
|
||||
struct Engine<'n> {
|
||||
struct Engine<'n, S> {
|
||||
opt: ArgMatches<'n>,
|
||||
hub: api::Replicapool,
|
||||
hub: api::Replicapool<S>,
|
||||
gp: Vec<&'static str>,
|
||||
gpm: Vec<(&'static str, &'static str)>,
|
||||
}
|
||||
|
||||
|
||||
impl<'n> Engine<'n> {
|
||||
impl<'n, S> Engine<'n, S>
|
||||
where
|
||||
S: tower_service::Service<Uri> + Clone + Send + Sync + 'static,
|
||||
S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
|
||||
S::Future: Send + Unpin + 'static,
|
||||
S::Error: Into<Box<dyn StdError + Send + Sync>>,
|
||||
{
|
||||
async fn _instance_group_managers_abandon_instances(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
|
||||
@@ -971,7 +982,7 @@ impl<'n> Engine<'n> {
|
||||
}
|
||||
|
||||
// Please note that this call will fail if any part of the opt can't be handled
|
||||
async fn new(opt: ArgMatches<'n>) -> Result<Engine<'n>, InvalidOptionsError> {
|
||||
async fn new(opt: ArgMatches<'n>, connector: S) -> Result<Engine<'n, S>, InvalidOptionsError> {
|
||||
let (config_dir, secret) = {
|
||||
let config_dir = match client::assure_config_dir_exists(opt.value_of("folder").unwrap_or("~/.google-service-cli")) {
|
||||
Err(e) => return Err(InvalidOptionsError::single(e, 3)),
|
||||
@@ -985,18 +996,14 @@ impl<'n> Engine<'n> {
|
||||
}
|
||||
};
|
||||
|
||||
let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
let client = hyper::Client::builder().build(connector);
|
||||
|
||||
let auth = oauth2::InstalledFlowAuthenticator::with_client(
|
||||
secret,
|
||||
oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
client.clone(),
|
||||
).persist_tokens_to_disk(format!("{}/replicapool1-beta2", config_dir)).build().await.unwrap();
|
||||
|
||||
let client = hyper::Client::builder().build(
|
||||
hyper_rustls::HttpsConnectorBuilder::new().with_native_roots()
|
||||
.https_or_http()
|
||||
.enable_http1()
|
||||
.enable_http2()
|
||||
.build()
|
||||
);
|
||||
let engine = Engine {
|
||||
opt: opt,
|
||||
hub: api::Replicapool::new(client, auth),
|
||||
@@ -1476,7 +1483,7 @@ async fn main() {
|
||||
|
||||
let mut app = App::new("replicapool1-beta2")
|
||||
.author("Sebastian Thiel <byronimo@gmail.com>")
|
||||
.version("3.1.0+20160512")
|
||||
.version("4.0.1+20160512")
|
||||
.about("[Deprecated. Please use Instance Group Manager in Compute API] Provides groups of homogenous Compute Engine instances.")
|
||||
.after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_replicapool1_beta2_cli")
|
||||
.arg(Arg::with_name("url")
|
||||
@@ -1538,8 +1545,14 @@ async fn main() {
|
||||
|
||||
let matches = app.get_matches();
|
||||
|
||||
let debug = matches.is_present("debug");
|
||||
match Engine::new(matches).await {
|
||||
let debug = matches.is_present("adebug");
|
||||
let connector = hyper_rustls::HttpsConnectorBuilder::new().with_native_roots()
|
||||
.https_or_http()
|
||||
.enable_http1()
|
||||
.enable_http2()
|
||||
.build();
|
||||
|
||||
match Engine::new(matches, connector).await {
|
||||
Err(err) => {
|
||||
exit_status = err.exit_code;
|
||||
writeln!(io::stderr(), "{}", err).ok();
|
||||
|
||||
Reference in New Issue
Block a user