diff --git a/gen/adexchangebuyer1d3-cli/Cargo.toml b/gen/adexchangebuyer1d3-cli/Cargo.toml index 485c96eefc..65ab7446c1 100644 --- a/gen/adexchangebuyer1d3-cli/Cargo.toml +++ b/gen/adexchangebuyer1d3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangebuyer1d3-cli" -version = "0.3.1+20150520" +version = "0.3.2+20150720" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d3-cli" @@ -17,9 +17,10 @@ keywords = ["adexchangebuyer", "google", "cli"] name = "adexchangebuyer1d3" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/adexchangebuyer1d3-cli/README.md b/gen/adexchangebuyer1d3-cli/README.md index e4c55bb372..d4b552f271 100644 --- a/gen/adexchangebuyer1d3-cli/README.md +++ b/gen/adexchangebuyer1d3-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *Ad Exchange Buyer* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/adexchangebuyer1d3.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/adexchangebuyer1d3.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/adexchangebuyer1d3.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/adexchangebuyer1d3.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d3-cli). # Usage -This documentation was generated from the *Ad Exchange Buyer* API at revision *20150520*. The CLI is at version *0.3.1*. +This documentation was generated from the *Ad Exchange Buyer* API at revision *20150720*. The CLI is at version *0.3.2*. ```bash adexchangebuyer1d3 [options] diff --git a/gen/adexchangebuyer1d3-cli/mkdocs.yml b/gen/adexchangebuyer1d3-cli/mkdocs.yml index f7e80cb4b7..dc16b34fd5 100644 --- a/gen/adexchangebuyer1d3-cli/mkdocs.yml +++ b/gen/adexchangebuyer1d3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ad Exchange Buyer v0.3.1+20150520 +site_name: Ad Exchange Buyer v0.3.2+20150720 site_url: http://byron.github.io/google-apis-rs/google-adexchangebuyer1d3-cli site_description: Write integrating applications with bcore diff --git a/gen/adexchangebuyer1d3-cli/src/cmn.rs b/gen/adexchangebuyer1d3-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/adexchangebuyer1d3-cli/src/cmn.rs +++ b/gen/adexchangebuyer1d3-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/adexchangebuyer1d3-cli/src/main.rs b/gen/adexchangebuyer1d3-cli/src/main.rs index b7071896d5..584d93b3b3 100644 --- a/gen/adexchangebuyer1d3-cli/src/main.rs +++ b/gen/adexchangebuyer1d3-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -2281,7 +2282,7 @@ fn main() { let mut app = App::new("adexchangebuyer1d3") .author("Sebastian Thiel ") - .version("0.3.1+20150520") + .version("0.3.2+20150720") .about("Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adexchangebuyer1d3_cli") .arg(Arg::with_name("url") @@ -2363,7 +2364,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/adexchangebuyer1d3/Cargo.toml b/gen/adexchangebuyer1d3/Cargo.toml index 4f6b2424e8..ec4a2eef43 100644 --- a/gen/adexchangebuyer1d3/Cargo.toml +++ b/gen/adexchangebuyer1d3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangebuyer1d3" -version = "0.1.8+20150520" +version = "0.1.9+20150720" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d3" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/adexchangebuyer1d3/README.md b/gen/adexchangebuyer1d3/README.md index e94b2e6534..f26ec11d2d 100644 --- a/gen/adexchangebuyer1d3/README.md +++ b/gen/adexchangebuyer1d3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-adexchangebuyer1d3` library allows access to all features of the *Google Ad Exchange Buyer* service. -This documentation was generated from *Ad Exchange Buyer* crate version *0.1.8+20150520*, where *20150520* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Ad Exchange Buyer* crate version *0.1.9+20150720*, where *20150720* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *Ad Exchange Buyer* *v1d3* API can be found at the [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). diff --git a/gen/adexchangebuyer1d3/src/cmn.rs b/gen/adexchangebuyer1d3/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/adexchangebuyer1d3/src/cmn.rs +++ b/gen/adexchangebuyer1d3/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/adexchangebuyer1d3/src/lib.rs b/gen/adexchangebuyer1d3/src/lib.rs index 3e470a17fa..bae774ae81 100644 --- a/gen/adexchangebuyer1d3/src/lib.rs +++ b/gen/adexchangebuyer1d3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Ad Exchange Buyer* crate version *0.1.8+20150520*, where *20150520* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Ad Exchange Buyer* crate version *0.1.9+20150720*, where *20150720* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *Ad Exchange Buyer* *v1d3* API can be found at the //! [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). diff --git a/gen/adexchangebuyer1d3/src/lib.rs.in b/gen/adexchangebuyer1d3/src/lib.rs.in index a64273b9cd..88b6f047ad 100644 --- a/gen/adexchangebuyer1d3/src/lib.rs.in +++ b/gen/adexchangebuyer1d3/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -131,7 +132,7 @@ impl<'a, C, A> AdExchangeBuyer AdExchangeBuyer { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -158,7 +159,7 @@ impl<'a, C, A> AdExchangeBuyer } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/adexchangeseller2-cli/Cargo.toml b/gen/adexchangeseller2-cli/Cargo.toml index 630fcb4075..44bdb4d379 100644 --- a/gen/adexchangeseller2-cli/Cargo.toml +++ b/gen/adexchangeseller2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangeseller2-cli" -version = "0.3.1+20150617" +version = "0.3.2+20150719" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Seller (protocol v2.0)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangeseller2-cli" @@ -17,9 +17,10 @@ keywords = ["adexchangeseller", "google", "cli"] name = "adexchangeseller2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/adexchangeseller2-cli/README.md b/gen/adexchangeseller2-cli/README.md index c1c51ad963..90d2a94903 100644 --- a/gen/adexchangeseller2-cli/README.md +++ b/gen/adexchangeseller2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *Ad Exchange Seller* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/adexchangeseller2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/adexchangeseller2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/adexchangeseller2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/adexchangeseller2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangeseller2-cli). # Usage -This documentation was generated from the *Ad Exchange Seller* API at revision *20150617*. The CLI is at version *0.3.1*. +This documentation was generated from the *Ad Exchange Seller* API at revision *20150719*. The CLI is at version *0.3.2*. ```bash adexchangeseller2 [options] diff --git a/gen/adexchangeseller2-cli/mkdocs.yml b/gen/adexchangeseller2-cli/mkdocs.yml index 2cc3cb2034..fac63e774d 100644 --- a/gen/adexchangeseller2-cli/mkdocs.yml +++ b/gen/adexchangeseller2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ad Exchange Seller v0.3.1+20150617 +site_name: Ad Exchange Seller v0.3.2+20150719 site_url: http://byron.github.io/google-apis-rs/google-adexchangeseller2-cli site_description: Write integrating applications with bcore diff --git a/gen/adexchangeseller2-cli/src/cmn.rs b/gen/adexchangeseller2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/adexchangeseller2-cli/src/cmn.rs +++ b/gen/adexchangeseller2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/adexchangeseller2-cli/src/main.rs b/gen/adexchangeseller2-cli/src/main.rs index b6ce7b5e92..6f46120b13 100644 --- a/gen/adexchangeseller2-cli/src/main.rs +++ b/gen/adexchangeseller2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1346,7 +1347,7 @@ fn main() { let mut app = App::new("adexchangeseller2") .author("Sebastian Thiel ") - .version("0.3.1+20150617") + .version("0.3.2+20150719") .about("Gives Ad Exchange seller users access to their inventory and the ability to generate reports") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adexchangeseller2_cli") .arg(Arg::with_name("url") @@ -1428,7 +1429,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/adexchangeseller2/Cargo.toml b/gen/adexchangeseller2/Cargo.toml index 4fbe881fcd..a402a66bc9 100644 --- a/gen/adexchangeseller2/Cargo.toml +++ b/gen/adexchangeseller2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangeseller2" -version = "0.1.8+20150617" +version = "0.1.9+20150719" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Seller (protocol v2.0)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangeseller2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/adexchangeseller2/README.md b/gen/adexchangeseller2/README.md index b3f304d5b5..4e1d1dbf61 100644 --- a/gen/adexchangeseller2/README.md +++ b/gen/adexchangeseller2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-adexchangeseller2` library allows access to all features of the *Google Ad Exchange Seller* service. -This documentation was generated from *Ad Exchange Seller* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Ad Exchange Seller* crate version *0.1.9+20150719*, where *20150719* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *Ad Exchange Seller* *v2* API can be found at the [official documentation site](https://developers.google.com/ad-exchange/seller-rest/). diff --git a/gen/adexchangeseller2/src/cmn.rs b/gen/adexchangeseller2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/adexchangeseller2/src/cmn.rs +++ b/gen/adexchangeseller2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/adexchangeseller2/src/lib.rs b/gen/adexchangeseller2/src/lib.rs index 7d5e45f07b..53857fc7e5 100644 --- a/gen/adexchangeseller2/src/lib.rs +++ b/gen/adexchangeseller2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Ad Exchange Seller* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Ad Exchange Seller* crate version *0.1.9+20150719*, where *20150719* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *Ad Exchange Seller* *v2* API can be found at the //! [official documentation site](https://developers.google.com/ad-exchange/seller-rest/). diff --git a/gen/adexchangeseller2/src/lib.rs.in b/gen/adexchangeseller2/src/lib.rs.in index 078087bf19..dd9f9c6e4d 100644 --- a/gen/adexchangeseller2/src/lib.rs.in +++ b/gen/adexchangeseller2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -136,7 +137,7 @@ impl<'a, C, A> AdExchangeSeller AdExchangeSeller { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -145,7 +146,7 @@ impl<'a, C, A> AdExchangeSeller } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/admin1_directory-cli/Cargo.toml b/gen/admin1_directory-cli/Cargo.toml index 3ba4b2de91..f41dd1096a 100644 --- a/gen/admin1_directory-cli/Cargo.toml +++ b/gen/admin1_directory-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-admin1_directory-cli" -version = "0.3.1+20150326" +version = "0.3.2+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with directory (protocol directory_v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_directory-cli" @@ -17,9 +17,10 @@ keywords = ["admin", "google", "cli"] name = "admin1-directory" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/admin1_directory-cli/README.md b/gen/admin1_directory-cli/README.md index 2ce1e20fa7..3f566740d9 100644 --- a/gen/admin1_directory-cli/README.md +++ b/gen/admin1_directory-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *directory* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/admin1-directory.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/admin1-directory.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/admin1-directory.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/admin1-directory.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_directory-cli). # Usage -This documentation was generated from the *directory* API at revision *20150326*. The CLI is at version *0.3.1*. +This documentation was generated from the *directory* API at revision *20150326*. The CLI is at version *0.3.2*. ```bash admin1-directory [options] diff --git a/gen/admin1_directory-cli/mkdocs.yml b/gen/admin1_directory-cli/mkdocs.yml index 983e5144e9..f9899f0dac 100644 --- a/gen/admin1_directory-cli/mkdocs.yml +++ b/gen/admin1_directory-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: directory v0.3.1+20150326 +site_name: directory v0.3.2+20150326 site_url: http://byron.github.io/google-apis-rs/google-admin1_directory-cli site_description: Write integrating applications with bcore diff --git a/gen/admin1_directory-cli/src/cmn.rs b/gen/admin1_directory-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/admin1_directory-cli/src/cmn.rs +++ b/gen/admin1_directory-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/admin1_directory-cli/src/main.rs b/gen/admin1_directory-cli/src/main.rs index af65a0358b..a925c733a0 100644 --- a/gen/admin1_directory-cli/src/main.rs +++ b/gen/admin1_directory-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -6888,7 +6889,7 @@ fn main() { let mut app = App::new("admin1-directory") .author("Sebastian Thiel ") - .version("0.3.1+20150326") + .version("0.3.2+20150326") .about("The Admin SDK Directory API lets you view and manage enterprise resources such as users and groups, administrative notifications, security features, and more.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_admin1_directory_cli") .arg(Arg::with_name("url") @@ -6970,7 +6971,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/admin1_directory/Cargo.toml b/gen/admin1_directory/Cargo.toml index 10710534a9..432c624280 100644 --- a/gen/admin1_directory/Cargo.toml +++ b/gen/admin1_directory/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-admin1_directory" -version = "0.1.8+20150326" +version = "0.1.9+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with directory (protocol directory_v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_directory" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/admin1_directory/README.md b/gen/admin1_directory/README.md index 50fe4540ac..c20e90e2ff 100644 --- a/gen/admin1_directory/README.md +++ b/gen/admin1_directory/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-admin1_directory` library allows access to all features of the *Google directory* service. -This documentation was generated from *directory* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *directory* crate version *0.1.9+20150326*, where *20150326* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *directory* *v1_directory* API can be found at the [official documentation site](https://developers.google.com/admin-sdk/directory/). diff --git a/gen/admin1_directory/src/cmn.rs b/gen/admin1_directory/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/admin1_directory/src/cmn.rs +++ b/gen/admin1_directory/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/admin1_directory/src/lib.rs b/gen/admin1_directory/src/lib.rs index d1f4e66b1a..dd28ba35e0 100644 --- a/gen/admin1_directory/src/lib.rs +++ b/gen/admin1_directory/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *directory* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *directory* crate version *0.1.9+20150326*, where *20150326* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *directory* *v1_directory* API can be found at the //! [official documentation site](https://developers.google.com/admin-sdk/directory/). diff --git a/gen/admin1_directory/src/lib.rs.in b/gen/admin1_directory/src/lib.rs.in index 650848901a..c88d8f32ec 100644 --- a/gen/admin1_directory/src/lib.rs.in +++ b/gen/admin1_directory/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -215,7 +216,7 @@ impl<'a, C, A> Directory Directory { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -257,7 +258,7 @@ impl<'a, C, A> Directory } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/admin1_reports-cli/Cargo.toml b/gen/admin1_reports-cli/Cargo.toml index d4deffbfaf..1ee58d1646 100644 --- a/gen/admin1_reports-cli/Cargo.toml +++ b/gen/admin1_reports-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-admin1_reports-cli" -version = "0.3.1+20150429" +version = "0.3.2+20150429" authors = ["Sebastian Thiel "] description = "A complete library to interact with reports (protocol reports_v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_reports-cli" @@ -17,9 +17,10 @@ keywords = ["admin", "google", "cli"] name = "admin1-reports" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/admin1_reports-cli/README.md b/gen/admin1_reports-cli/README.md index de7079eaea..4351d0af63 100644 --- a/gen/admin1_reports-cli/README.md +++ b/gen/admin1_reports-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *reports* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/admin1-reports.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/admin1-reports.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/admin1-reports.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/admin1-reports.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_reports-cli). # Usage -This documentation was generated from the *reports* API at revision *20150429*. The CLI is at version *0.3.1*. +This documentation was generated from the *reports* API at revision *20150429*. The CLI is at version *0.3.2*. ```bash admin1-reports [options] diff --git a/gen/admin1_reports-cli/mkdocs.yml b/gen/admin1_reports-cli/mkdocs.yml index 543725ef72..5fdb7f3310 100644 --- a/gen/admin1_reports-cli/mkdocs.yml +++ b/gen/admin1_reports-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: reports v0.3.1+20150429 +site_name: reports v0.3.2+20150429 site_url: http://byron.github.io/google-apis-rs/google-admin1_reports-cli site_description: Write integrating applications with bcore diff --git a/gen/admin1_reports-cli/src/cmn.rs b/gen/admin1_reports-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/admin1_reports-cli/src/cmn.rs +++ b/gen/admin1_reports-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/admin1_reports-cli/src/main.rs b/gen/admin1_reports-cli/src/main.rs index 8ade569fe1..60cc18da35 100644 --- a/gen/admin1_reports-cli/src/main.rs +++ b/gen/admin1_reports-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -734,7 +735,7 @@ fn main() { let mut app = App::new("admin1-reports") .author("Sebastian Thiel ") - .version("0.3.1+20150429") + .version("0.3.2+20150429") .about("Allows the administrators of Google Apps customers to fetch reports about the usage, collaboration, security and risk for their users.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_admin1_reports_cli") .arg(Arg::with_name("url") @@ -816,7 +817,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/admin1_reports/Cargo.toml b/gen/admin1_reports/Cargo.toml index 30b6472592..31e9636cb2 100644 --- a/gen/admin1_reports/Cargo.toml +++ b/gen/admin1_reports/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-admin1_reports" -version = "0.1.8+20150429" +version = "0.1.9+20150429" authors = ["Sebastian Thiel "] description = "A complete library to interact with reports (protocol reports_v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_reports" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/admin1_reports/README.md b/gen/admin1_reports/README.md index 811fd9a576..3c181cb4b5 100644 --- a/gen/admin1_reports/README.md +++ b/gen/admin1_reports/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-admin1_reports` library allows access to all features of the *Google reports* service. -This documentation was generated from *reports* crate version *0.1.8+20150429*, where *20150429* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *reports* crate version *0.1.9+20150429*, where *20150429* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *reports* *v1_reports* API can be found at the [official documentation site](https://developers.google.com/admin-sdk/reports/). diff --git a/gen/admin1_reports/src/cmn.rs b/gen/admin1_reports/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/admin1_reports/src/cmn.rs +++ b/gen/admin1_reports/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/admin1_reports/src/lib.rs b/gen/admin1_reports/src/lib.rs index a81e795401..83c8c2a66f 100644 --- a/gen/admin1_reports/src/lib.rs +++ b/gen/admin1_reports/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *reports* crate version *0.1.8+20150429*, where *20150429* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *reports* crate version *0.1.9+20150429*, where *20150429* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *reports* *v1_reports* API can be found at the //! [official documentation site](https://developers.google.com/admin-sdk/reports/). diff --git a/gen/admin1_reports/src/lib.rs.in b/gen/admin1_reports/src/lib.rs.in index 4b83d3c4c0..080d1c8944 100644 --- a/gen/admin1_reports/src/lib.rs.in +++ b/gen/admin1_reports/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -143,7 +144,7 @@ impl<'a, C, A> Reports Reports { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -161,7 +162,7 @@ impl<'a, C, A> Reports } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/admin2_email_migration-cli/Cargo.toml b/gen/admin2_email_migration-cli/Cargo.toml index 9b5a6d9ba0..8963d5a24f 100644 --- a/gen/admin2_email_migration-cli/Cargo.toml +++ b/gen/admin2_email_migration-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-admin2_email_migration-cli" -version = "0.3.1+20150303" +version = "0.3.2+20150303" authors = ["Sebastian Thiel "] description = "A complete library to interact with admin (protocol email_migration_v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin2_email_migration-cli" @@ -17,9 +17,10 @@ keywords = ["admin", "google", "cli"] name = "admin2-email-migration" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/admin2_email_migration-cli/README.md b/gen/admin2_email_migration-cli/README.md index 30597316f6..37c248eb3e 100644 --- a/gen/admin2_email_migration-cli/README.md +++ b/gen/admin2_email_migration-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *admin* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/admin2-email-migration.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/admin2-email-migration.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/admin2-email-migration.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/admin2-email-migration.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/admin2_email_migration-cli). # Usage -This documentation was generated from the *admin* API at revision *20150303*. The CLI is at version *0.3.1*. +This documentation was generated from the *admin* API at revision *20150303*. The CLI is at version *0.3.2*. ```bash admin2-email-migration [options] diff --git a/gen/admin2_email_migration-cli/mkdocs.yml b/gen/admin2_email_migration-cli/mkdocs.yml index 56fa72f633..08f22981ed 100644 --- a/gen/admin2_email_migration-cli/mkdocs.yml +++ b/gen/admin2_email_migration-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: admin v0.3.1+20150303 +site_name: admin v0.3.2+20150303 site_url: http://byron.github.io/google-apis-rs/google-admin2_email_migration-cli site_description: Write integrating applications with bcore diff --git a/gen/admin2_email_migration-cli/src/cmn.rs b/gen/admin2_email_migration-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/admin2_email_migration-cli/src/cmn.rs +++ b/gen/admin2_email_migration-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/admin2_email_migration-cli/src/main.rs b/gen/admin2_email_migration-cli/src/main.rs index 25e690d613..d4f5031033 100644 --- a/gen/admin2_email_migration-cli/src/main.rs +++ b/gen/admin2_email_migration-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -267,7 +268,7 @@ fn main() { let mut app = App::new("admin2-email-migration") .author("Sebastian Thiel ") - .version("0.3.1+20150303") + .version("0.3.2+20150303") .about("Email Migration API lets you migrate emails of users to Google backends.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_admin2_email_migration_cli") .arg(Arg::with_name("url") @@ -360,7 +361,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/admin2_email_migration/Cargo.toml b/gen/admin2_email_migration/Cargo.toml index 5686d7268d..6a728c0f57 100644 --- a/gen/admin2_email_migration/Cargo.toml +++ b/gen/admin2_email_migration/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-admin2_email_migration" -version = "0.1.8+20150303" +version = "0.1.9+20150303" authors = ["Sebastian Thiel "] description = "A complete library to interact with admin (protocol email_migration_v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin2_email_migration" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/admin2_email_migration/README.md b/gen/admin2_email_migration/README.md index f7191f7c5c..a6e73ee76b 100644 --- a/gen/admin2_email_migration/README.md +++ b/gen/admin2_email_migration/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-admin2_email_migration` library allows access to all features of the *Google admin* service. -This documentation was generated from *admin* crate version *0.1.8+20150303*, where *20150303* is the exact revision of the *admin:email_migration_v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *admin* crate version *0.1.9+20150303*, where *20150303* is the exact revision of the *admin:email_migration_v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *admin* *v2_email_migration* API can be found at the [official documentation site](https://developers.google.com/admin-sdk/email-migration/v2/). diff --git a/gen/admin2_email_migration/src/cmn.rs b/gen/admin2_email_migration/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/admin2_email_migration/src/cmn.rs +++ b/gen/admin2_email_migration/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/admin2_email_migration/src/lib.rs b/gen/admin2_email_migration/src/lib.rs index 06b361ac44..1791501ec7 100644 --- a/gen/admin2_email_migration/src/lib.rs +++ b/gen/admin2_email_migration/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *admin* crate version *0.1.8+20150303*, where *20150303* is the exact revision of the *admin:email_migration_v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *admin* crate version *0.1.9+20150303*, where *20150303* is the exact revision of the *admin:email_migration_v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *admin* *v2_email_migration* API can be found at the //! [official documentation site](https://developers.google.com/admin-sdk/email-migration/v2/). diff --git a/gen/admin2_email_migration/src/lib.rs.in b/gen/admin2_email_migration/src/lib.rs.in index 11db4d9b38..abda685634 100644 --- a/gen/admin2_email_migration/src/lib.rs.in +++ b/gen/admin2_email_migration/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -132,7 +133,7 @@ impl<'a, C, A> Admin Admin { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -141,7 +142,7 @@ impl<'a, C, A> Admin } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/adsense1d4-cli/Cargo.toml b/gen/adsense1d4-cli/Cargo.toml index 38b93b8ce9..9b75bfed94 100644 --- a/gen/adsense1d4-cli/Cargo.toml +++ b/gen/adsense1d4-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adsense1d4-cli" -version = "0.3.1+20150617" +version = "0.3.2+20150719" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdSense (protocol v1.4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adsense1d4-cli" @@ -17,9 +17,10 @@ keywords = ["adsense", "google", "cli"] name = "adsense1d4" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/adsense1d4-cli/README.md b/gen/adsense1d4-cli/README.md index e8808f453d..dd34b0a0f6 100644 --- a/gen/adsense1d4-cli/README.md +++ b/gen/adsense1d4-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *AdSense* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/adsense1d4.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/adsense1d4.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/adsense1d4.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/adsense1d4.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/adsense1d4-cli). # Usage -This documentation was generated from the *AdSense* API at revision *20150617*. The CLI is at version *0.3.1*. +This documentation was generated from the *AdSense* API at revision *20150719*. The CLI is at version *0.3.2*. ```bash adsense1d4 [options] diff --git a/gen/adsense1d4-cli/mkdocs.yml b/gen/adsense1d4-cli/mkdocs.yml index c95ffff2d3..48e4ff30a3 100644 --- a/gen/adsense1d4-cli/mkdocs.yml +++ b/gen/adsense1d4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AdSense v0.3.1+20150617 +site_name: AdSense v0.3.2+20150719 site_url: http://byron.github.io/google-apis-rs/google-adsense1d4-cli site_description: Write integrating applications with bcore diff --git a/gen/adsense1d4-cli/src/cmn.rs b/gen/adsense1d4-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/adsense1d4-cli/src/cmn.rs +++ b/gen/adsense1d4-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/adsense1d4-cli/src/main.rs b/gen/adsense1d4-cli/src/main.rs index a8d378969e..1a12d8f2ea 100644 --- a/gen/adsense1d4-cli/src/main.rs +++ b/gen/adsense1d4-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -3479,7 +3480,7 @@ fn main() { let mut app = App::new("adsense1d4") .author("Sebastian Thiel ") - .version("0.3.1+20150617") + .version("0.3.2+20150719") .about("Gives AdSense publishers access to their inventory and the ability to generate reports") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adsense1d4_cli") .arg(Arg::with_name("url") @@ -3561,7 +3562,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/adsense1d4/Cargo.toml b/gen/adsense1d4/Cargo.toml index 07bdce6120..3d532780a2 100644 --- a/gen/adsense1d4/Cargo.toml +++ b/gen/adsense1d4/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adsense1d4" -version = "0.1.8+20150617" +version = "0.1.9+20150719" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdSense (protocol v1.4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adsense1d4" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/adsense1d4/README.md b/gen/adsense1d4/README.md index c71ab98bae..5c13ce5af4 100644 --- a/gen/adsense1d4/README.md +++ b/gen/adsense1d4/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-adsense1d4` library allows access to all features of the *Google AdSense* service. -This documentation was generated from *AdSense* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *AdSense* crate version *0.1.9+20150719*, where *20150719* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *AdSense* *v1d4* API can be found at the [official documentation site](https://developers.google.com/adsense/management/). diff --git a/gen/adsense1d4/src/cmn.rs b/gen/adsense1d4/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/adsense1d4/src/cmn.rs +++ b/gen/adsense1d4/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/adsense1d4/src/lib.rs b/gen/adsense1d4/src/lib.rs index 22b9dc0d61..2861c66feb 100644 --- a/gen/adsense1d4/src/lib.rs +++ b/gen/adsense1d4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *AdSense* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *AdSense* crate version *0.1.9+20150719*, where *20150719* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *AdSense* *v1d4* API can be found at the //! [official documentation site](https://developers.google.com/adsense/management/). diff --git a/gen/adsense1d4/src/lib.rs.in b/gen/adsense1d4/src/lib.rs.in index b31ba62d2a..a7fe8b7224 100644 --- a/gen/adsense1d4/src/lib.rs.in +++ b/gen/adsense1d4/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -138,7 +139,7 @@ impl<'a, C, A> AdSense AdSense { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -174,7 +175,7 @@ impl<'a, C, A> AdSense } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/adsensehost4d1-cli/Cargo.toml b/gen/adsensehost4d1-cli/Cargo.toml index fa1ca55637..5e999b2afc 100644 --- a/gen/adsensehost4d1-cli/Cargo.toml +++ b/gen/adsensehost4d1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adsensehost4d1-cli" -version = "0.3.1+20150617" +version = "0.3.2+20150719" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdSense Host (protocol v4.1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adsensehost4d1-cli" @@ -17,9 +17,10 @@ keywords = ["adsensehost", "google", "cli"] name = "adsensehost4d1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/adsensehost4d1-cli/README.md b/gen/adsensehost4d1-cli/README.md index 098cccd5b4..9b16d4d7e9 100644 --- a/gen/adsensehost4d1-cli/README.md +++ b/gen/adsensehost4d1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *AdSense Host* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/adsensehost4d1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/adsensehost4d1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/adsensehost4d1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/adsensehost4d1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/adsensehost4d1-cli). # Usage -This documentation was generated from the *AdSense Host* API at revision *20150617*. The CLI is at version *0.3.1*. +This documentation was generated from the *AdSense Host* API at revision *20150719*. The CLI is at version *0.3.2*. ```bash adsensehost4d1 [options] diff --git a/gen/adsensehost4d1-cli/mkdocs.yml b/gen/adsensehost4d1-cli/mkdocs.yml index 27cb9155ef..8d188e2e46 100644 --- a/gen/adsensehost4d1-cli/mkdocs.yml +++ b/gen/adsensehost4d1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AdSense Host v0.3.1+20150617 +site_name: AdSense Host v0.3.2+20150719 site_url: http://byron.github.io/google-apis-rs/google-adsensehost4d1-cli site_description: Write integrating applications with bcore diff --git a/gen/adsensehost4d1-cli/src/cmn.rs b/gen/adsensehost4d1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/adsensehost4d1-cli/src/cmn.rs +++ b/gen/adsensehost4d1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/adsensehost4d1-cli/src/main.rs b/gen/adsensehost4d1-cli/src/main.rs index 08ae445dab..9e49854d93 100644 --- a/gen/adsensehost4d1-cli/src/main.rs +++ b/gen/adsensehost4d1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -2760,7 +2761,7 @@ fn main() { let mut app = App::new("adsensehost4d1") .author("Sebastian Thiel ") - .version("0.3.1+20150617") + .version("0.3.2+20150719") .about("Gives AdSense Hosts access to report generation, ad code generation, and publisher management capabilities.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adsensehost4d1_cli") .arg(Arg::with_name("url") @@ -2842,7 +2843,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/adsensehost4d1/Cargo.toml b/gen/adsensehost4d1/Cargo.toml index 03e8c56f94..2e5b070884 100644 --- a/gen/adsensehost4d1/Cargo.toml +++ b/gen/adsensehost4d1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adsensehost4d1" -version = "0.1.8+20150617" +version = "0.1.9+20150719" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdSense Host (protocol v4.1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adsensehost4d1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/adsensehost4d1/README.md b/gen/adsensehost4d1/README.md index 9e06376dde..30f7f9fa2d 100644 --- a/gen/adsensehost4d1/README.md +++ b/gen/adsensehost4d1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-adsensehost4d1` library allows access to all features of the *Google AdSense Host* service. -This documentation was generated from *AdSense Host* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *AdSense Host* crate version *0.1.9+20150719*, where *20150719* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *AdSense Host* *v4d1* API can be found at the [official documentation site](https://developers.google.com/adsense/host/). diff --git a/gen/adsensehost4d1/src/cmn.rs b/gen/adsensehost4d1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/adsensehost4d1/src/cmn.rs +++ b/gen/adsensehost4d1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/adsensehost4d1/src/lib.rs b/gen/adsensehost4d1/src/lib.rs index 4338415f4d..2997fdf885 100644 --- a/gen/adsensehost4d1/src/lib.rs +++ b/gen/adsensehost4d1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *AdSense Host* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *AdSense Host* crate version *0.1.9+20150719*, where *20150719* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *AdSense Host* *v4d1* API can be found at the //! [official documentation site](https://developers.google.com/adsense/host/). diff --git a/gen/adsensehost4d1/src/lib.rs.in b/gen/adsensehost4d1/src/lib.rs.in index 7c180325ab..0f765b478f 100644 --- a/gen/adsensehost4d1/src/lib.rs.in +++ b/gen/adsensehost4d1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -132,7 +133,7 @@ impl<'a, C, A> AdSenseHost AdSenseHost { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -156,7 +157,7 @@ impl<'a, C, A> AdSenseHost } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/analytics3-cli/Cargo.toml b/gen/analytics3-cli/Cargo.toml index 42181041d2..134f8714be 100644 --- a/gen/analytics3-cli/Cargo.toml +++ b/gen/analytics3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-analytics3-cli" -version = "0.3.1+20150417" +version = "0.3.2+20150417" authors = ["Sebastian Thiel "] description = "A complete library to interact with analytics (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/analytics3-cli" @@ -17,9 +17,10 @@ keywords = ["analytics", "google", "cli"] name = "analytics3" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/analytics3-cli/README.md b/gen/analytics3-cli/README.md index 27934e0943..171b90f6c3 100644 --- a/gen/analytics3-cli/README.md +++ b/gen/analytics3-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *analytics* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/analytics3.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/analytics3.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/analytics3.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/analytics3.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/analytics3-cli). # Usage -This documentation was generated from the *analytics* API at revision *20150417*. The CLI is at version *0.3.1*. +This documentation was generated from the *analytics* API at revision *20150417*. The CLI is at version *0.3.2*. ```bash analytics3 [options] diff --git a/gen/analytics3-cli/mkdocs.yml b/gen/analytics3-cli/mkdocs.yml index 1faded48e8..ed38668783 100644 --- a/gen/analytics3-cli/mkdocs.yml +++ b/gen/analytics3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: analytics v0.3.1+20150417 +site_name: analytics v0.3.2+20150417 site_url: http://byron.github.io/google-apis-rs/google-analytics3-cli site_description: Write integrating applications with bcore diff --git a/gen/analytics3-cli/src/cmn.rs b/gen/analytics3-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/analytics3-cli/src/cmn.rs +++ b/gen/analytics3-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/analytics3-cli/src/main.rs b/gen/analytics3-cli/src/main.rs index 1a5881e8c8..547109b232 100644 --- a/gen/analytics3-cli/src/main.rs +++ b/gen/analytics3-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -9222,7 +9223,7 @@ fn main() { let mut app = App::new("analytics3") .author("Sebastian Thiel ") - .version("0.3.1+20150417") + .version("0.3.2+20150417") .about("View and manage your Google Analytics data") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_analytics3_cli") .arg(Arg::with_name("url") @@ -9315,7 +9316,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/analytics3/Cargo.toml b/gen/analytics3/Cargo.toml index ec293f9699..7f9a6ce5f8 100644 --- a/gen/analytics3/Cargo.toml +++ b/gen/analytics3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-analytics3" -version = "0.1.8+20150417" +version = "0.1.9+20150417" authors = ["Sebastian Thiel "] description = "A complete library to interact with analytics (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/analytics3" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/analytics3/README.md b/gen/analytics3/README.md index 2cec71b86f..404d9b017c 100644 --- a/gen/analytics3/README.md +++ b/gen/analytics3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-analytics3` library allows access to all features of the *Google analytics* service. -This documentation was generated from *analytics* crate version *0.1.8+20150417*, where *20150417* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *analytics* crate version *0.1.9+20150417*, where *20150417* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *analytics* *v3* API can be found at the [official documentation site](https://developers.google.com/analytics/). diff --git a/gen/analytics3/src/cmn.rs b/gen/analytics3/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/analytics3/src/cmn.rs +++ b/gen/analytics3/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/analytics3/src/lib.rs b/gen/analytics3/src/lib.rs index e32828b830..09def7ef2f 100644 --- a/gen/analytics3/src/lib.rs +++ b/gen/analytics3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *analytics* crate version *0.1.8+20150417*, where *20150417* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *analytics* crate version *0.1.9+20150417*, where *20150417* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *analytics* *v3* API can be found at the //! [official documentation site](https://developers.google.com/analytics/). diff --git a/gen/analytics3/src/lib.rs.in b/gen/analytics3/src/lib.rs.in index 6ef0c1304f..38a6334145 100644 --- a/gen/analytics3/src/lib.rs.in +++ b/gen/analytics3/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -151,7 +152,7 @@ impl<'a, C, A> Analytics Analytics { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -169,7 +170,7 @@ impl<'a, C, A> Analytics } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/androidenterprise1-cli/Cargo.toml b/gen/androidenterprise1-cli/Cargo.toml index 8e4ac3cb54..92830f134e 100644 --- a/gen/androidenterprise1-cli/Cargo.toml +++ b/gen/androidenterprise1-cli/Cargo.toml @@ -4,10 +4,11 @@ [package] name = "google-androidenterprise1-cli" -version = "0.3.1+20150303" +version = "0.3.2+20150715" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Enterprise (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidenterprise1-cli" +homepage = "https://developers.google.com/play/enterprise" documentation = "http://byron.github.io/google-apis-rs/google_androidenterprise1_cli" license = "MIT" keywords = ["androidenterprise", "google", "cli"] @@ -16,9 +17,10 @@ keywords = ["androidenterprise", "google", "cli"] name = "androidenterprise1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/androidenterprise1-cli/README.md b/gen/androidenterprise1-cli/README.md index 7019f50404..b83c59ecb7 100644 --- a/gen/androidenterprise1-cli/README.md +++ b/gen/androidenterprise1-cli/README.md @@ -10,18 +10,21 @@ capabilities. Errors will be printed to standard error, and cause the program's If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. +Everything else about the *Android Enterprise* API can be found at the +[official documentation site](https://developers.google.com/play/enterprise). + # Downloads You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/androidenterprise1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/androidenterprise1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/androidenterprise1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/androidenterprise1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/androidenterprise1-cli). # Usage -This documentation was generated from the *Android Enterprise* API at revision *20150303*. The CLI is at version *0.3.1*. +This documentation was generated from the *Android Enterprise* API at revision *20150715*. The CLI is at version *0.3.2*. ```bash androidenterprise1 [options] diff --git a/gen/androidenterprise1-cli/mkdocs.yml b/gen/androidenterprise1-cli/mkdocs.yml index 278e1ec1e5..af32768162 100644 --- a/gen/androidenterprise1-cli/mkdocs.yml +++ b/gen/androidenterprise1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Enterprise v0.3.1+20150303 +site_name: Android Enterprise v0.3.2+20150715 site_url: http://byron.github.io/google-apis-rs/google-androidenterprise1-cli site_description: Write integrating applications with bcore diff --git a/gen/androidenterprise1-cli/src/cmn.rs b/gen/androidenterprise1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/androidenterprise1-cli/src/cmn.rs +++ b/gen/androidenterprise1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/androidenterprise1-cli/src/main.rs b/gen/androidenterprise1-cli/src/main.rs index d649b6ddcc..fa0074c1b9 100644 --- a/gen/androidenterprise1-cli/src/main.rs +++ b/gen/androidenterprise1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -4401,7 +4402,9 @@ fn main() { Some(true)), ]), ("generate-approval-url", - Some(r##"Generates a URL that can be used to display an iframe to view the product's permissions (if any) and approve the product. This URL can be used to approve the product for a limited time (currently 1 hour) using the Products.approve call."##), + Some(r##"Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. + + Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/products_generate-approval-url", vec![ (Some(r##"enterprise-id"##), @@ -4661,7 +4664,7 @@ fn main() { let mut app = App::new("androidenterprise1") .author("Sebastian Thiel ") - .version("0.3.1+20150303") + .version("0.3.2+20150715") .about("Allows MDMs/EMMs and enterprises to manage the deployment of apps to Android for Work users.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli") .arg(Arg::with_name("url") @@ -4743,7 +4746,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/androidenterprise1/Cargo.toml b/gen/androidenterprise1/Cargo.toml index c6c8de1ab7..3af1971366 100644 --- a/gen/androidenterprise1/Cargo.toml +++ b/gen/androidenterprise1/Cargo.toml @@ -4,10 +4,11 @@ [package] name = "google-androidenterprise1" -version = "0.1.8+20150303" +version = "0.1.9+20150715" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Enterprise (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidenterprise1" +homepage = "https://developers.google.com/play/enterprise" documentation = "http://byron.github.io/google-apis-rs/google_androidenterprise1" license = "MIT" keywords = ["androidenterprise", "google", "protocol", "web", "api"] @@ -15,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/androidenterprise1/README.md b/gen/androidenterprise1/README.md index c279327d99..368fe5d941 100644 --- a/gen/androidenterprise1/README.md +++ b/gen/androidenterprise1/README.md @@ -5,7 +5,10 @@ DO NOT EDIT ! --> The `google-androidenterprise1` library allows access to all features of the *Google Android Enterprise* service. -This documentation was generated from *Android Enterprise* crate version *0.1.8+20150303*, where *20150303* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Android Enterprise* crate version *0.1.9+20150715*, where *20150715* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. + +Everything else about the *Android Enterprise* *v1* API can be found at the +[official documentation site](https://developers.google.com/play/enterprise). # Features Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_androidenterprise1/struct.AndroidEnterprise.html) ... diff --git a/gen/androidenterprise1/src/cmn.rs b/gen/androidenterprise1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/androidenterprise1/src/cmn.rs +++ b/gen/androidenterprise1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/androidenterprise1/src/lib.rs b/gen/androidenterprise1/src/lib.rs index a19a2edd6d..a23b849944 100644 --- a/gen/androidenterprise1/src/lib.rs +++ b/gen/androidenterprise1/src/lib.rs @@ -2,7 +2,10 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Android Enterprise* crate version *0.1.8+20150303*, where *20150303* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Android Enterprise* crate version *0.1.9+20150715*, where *20150715* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. +//! +//! Everything else about the *Android Enterprise* *v1* API can be found at the +//! [official documentation site](https://developers.google.com/play/enterprise). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/androidenterprise1). //! # Features //! diff --git a/gen/androidenterprise1/src/lib.rs.in b/gen/androidenterprise1/src/lib.rs.in index 77b78371f0..e8b9ce7e7c 100644 --- a/gen/androidenterprise1/src/lib.rs.in +++ b/gen/androidenterprise1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -131,7 +132,7 @@ impl<'a, C, A> AndroidEnterprise AndroidEnterprise { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -170,7 +171,7 @@ impl<'a, C, A> AndroidEnterprise } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -369,16 +370,16 @@ pub struct ApprovalUrlInfo { impl Part for ApprovalUrlInfo {} -/// App version represents a single APK version. +/// This represents a single version of the app. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AppVersion { - /// Unique increasing identifier for the apk version. + /// Unique increasing identifier for the app version. #[serde(rename="versionCode")] pub version_code: Option, - /// The string used in the Play Store by the app developer to identify a version of an app. The string is not necessarily unique or localized (e.g. "1.4"). + /// The string used in the Play Store by the app developer to identify the version. The string is not necessarily unique or localized (for example, the string could be "1.4"). #[serde(rename="versionString")] pub version_string: Option, } @@ -595,7 +596,7 @@ impl Part for ProductPermission {} pub struct Product { /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#product". pub kind: Option, - /// How and to whom the package is made available. + /// How and to whom the package is made available. The value publicGoogleHosted means that the package is available through the Play Store and not restricted to a specific enterprise. The value privateGoogleHosted means that the package is a private app (restricted to an enterprise) but hosted by Google. The value privateSelfHosted means that the package is a private app (restricted to an enterprise) and is privately hosted. #[serde(rename="distributionChannel")] pub distribution_channel: Option, /// The name of the product. @@ -603,7 +604,7 @@ pub struct Product { /// A link to the Google Play for Work details page for the product, for use by an Enterprise administrator. #[serde(rename="workDetailsUrl")] pub work_details_url: Option, - /// List of app versions available for this product. The returned list contains only public versions. E.g. alpha, beta or canary versions will not be included. + /// App versions currently available for this product. The returned list contains only public versions. Alpha and beta versions are not included. #[serde(rename="appVersion")] pub app_version: Option>, /// A link to an image that can be used as an icon for the product. @@ -618,8 +619,8 @@ pub struct Product { /// A link to the (consumer) Google Play details page for the product. #[serde(rename="detailsUrl")] pub details_url: Option, - /// A string of the form "app: - /// " - e.g. "app:com.google.android.gm" represents the GMail app. + /// A string of the form app: + /// . For example, app:com.google.android.gm represents the Gmail app. #[serde(rename="productId")] pub product_id: Option, } @@ -764,7 +765,7 @@ impl ResponseResult for Collection {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ProductsApproveRequest { - /// no description provided + /// The approval URL that was shown to the user. Only the permissions shown to the user with that URL will be accepted, which may not be the product's entire set of permissions. For example, the URL may only display new permissions from an update after the product was approved, or not include new permissions if the product was updated since the URL was generated. #[serde(rename="approvalUrlInfo")] pub approval_url_info: Option, } @@ -808,7 +809,7 @@ impl ResponseResult for ProductPermissions {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ProductsGenerateApprovalUrlResponse { - /// A iframe-able URL that displays a product's permissions (if any). This URL can be used to approve the product only once and for a limited time (1 hour), using the Products.approve call. If the product is not currently approved and has no permissions, this URL will point to an empty page. If the product is currently approved and all of its permissions (if any) are also approved, this field will not be populated. + /// A URL that can be rendered in an iframe to display the permissions (if any) of a product. This URL can be used to approve the product only once and only within 24 hours of being generated, using the Products.approve call. If the product is currently unapproved and has no permissions, this URL will point to an empty page. If the product is currently approved, a URL will only be generated if that product has added permissions since it was last approved, and the URL will only display those new permissions that have not yet been accepted. pub url: Option, } @@ -887,11 +888,11 @@ impl Resource for Device {} impl ResponseResult for Device {} -/// A group license object indicates a product that an enterprise admin has approved for use in the enterprise. The product may be free or paid. For free products, a group license object is created in these cases: if the enterprise admin approves a product in Google Play, if the product is added to a collection, or if an entitlement for the product is created for a user via the API. For paid products, a group license object is only created as part of the first bulk purchase of that product in Google Play done by the enterprise admin. +/// A group license object indicates a product that an enterprise admin has approved for use in the enterprise. The product may be free or paid. For free products, a group license object is created in these cases: if the enterprise admin approves a product in Google Play, if the product is added to a collection, or if an entitlement for the product is created for a user via the API. For paid products, a group license object is only created as part of the first bulk purchase of that product in Google Play by the enterprise admin. /// -/// The API can be used to query group licenses; the available information includes the total number of licenses purchased (for paid products) and the total number of licenses that have been provisioned, i.e. the total number of user entitlements in existence for the product. +/// The API can be used to query group licenses; the available information includes the total number of licenses purchased (for paid products) and the total number of licenses that have been provisioned, that is, the total number of user entitlements in existence for the product. /// -/// Group license objects are never deleted; if e.g. a free app is added to a collection and then removed, the group license will remain, allowing to keep track of any remaining entitlements. An enterprise admin may indicate they are no longer interested in the group license by marking it as unapproved in Google Play. +/// Group license objects are never deleted. If, for example, a free app is added to a collection and then removed, the group license will remain, allowing the enterprise admin to keep track of any remaining entitlements. An enterprise admin may indicate they are no longer interested in the group license by marking it as unapproved in Google Play. /// /// # Activities /// @@ -2186,7 +2187,9 @@ impl<'a, C, A> ProductMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Generates a URL that can be used to display an iframe to view the product's permissions (if any) and approve the product. This URL can be used to approve the product for a limited time (currently 1 hour) using the Products.approve call. + /// Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. + /// + /// Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. /// /// # Arguments /// @@ -13259,7 +13262,9 @@ impl<'a, C, A> ProductUpdatePermissionCall<'a, C, A> where C: BorrowMut ProductGenerateApprovalUrlCall<'a, C, A> where C: BorrowMut ProductGenerateApprovalUrlCall<'a, C, A> { diff --git a/gen/androidpublisher2-cli/Cargo.toml b/gen/androidpublisher2-cli/Cargo.toml index 3072694a54..f99acf6f2a 100644 --- a/gen/androidpublisher2-cli/Cargo.toml +++ b/gen/androidpublisher2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androidpublisher2-cli" -version = "0.3.1+20150316" +version = "0.3.2+20150316" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Publisher (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidpublisher2-cli" @@ -17,9 +17,10 @@ keywords = ["androidpublisher", "google", "cli"] name = "androidpublisher2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/androidpublisher2-cli/README.md b/gen/androidpublisher2-cli/README.md index 93a5ae9c04..7a06df53fa 100644 --- a/gen/androidpublisher2-cli/README.md +++ b/gen/androidpublisher2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *Android Publisher* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/androidpublisher2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/androidpublisher2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/androidpublisher2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/androidpublisher2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/androidpublisher2-cli). # Usage -This documentation was generated from the *Android Publisher* API at revision *20150316*. The CLI is at version *0.3.1*. +This documentation was generated from the *Android Publisher* API at revision *20150316*. The CLI is at version *0.3.2*. ```bash androidpublisher2 [options] diff --git a/gen/androidpublisher2-cli/mkdocs.yml b/gen/androidpublisher2-cli/mkdocs.yml index 1d38f047c8..9d39604ab3 100644 --- a/gen/androidpublisher2-cli/mkdocs.yml +++ b/gen/androidpublisher2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Publisher v0.3.1+20150316 +site_name: Android Publisher v0.3.2+20150316 site_url: http://byron.github.io/google-apis-rs/google-androidpublisher2-cli site_description: Write integrating applications with bcore diff --git a/gen/androidpublisher2-cli/src/cmn.rs b/gen/androidpublisher2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/androidpublisher2-cli/src/cmn.rs +++ b/gen/androidpublisher2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/androidpublisher2-cli/src/main.rs b/gen/androidpublisher2-cli/src/main.rs index 8eff3779f8..1ecfa3d4e0 100644 --- a/gen/androidpublisher2-cli/src/main.rs +++ b/gen/androidpublisher2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -5465,7 +5466,7 @@ fn main() { let mut app = App::new("androidpublisher2") .author("Sebastian Thiel ") - .version("0.3.1+20150316") + .version("0.3.2+20150316") .about("Lets Android application developers access their Google Play accounts.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_androidpublisher2_cli") .arg(Arg::with_name("url") @@ -5558,7 +5559,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/androidpublisher2/Cargo.toml b/gen/androidpublisher2/Cargo.toml index 00bc9e3fb1..75eab6e4b2 100644 --- a/gen/androidpublisher2/Cargo.toml +++ b/gen/androidpublisher2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androidpublisher2" -version = "0.1.8+20150316" +version = "0.1.9+20150316" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Publisher (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidpublisher2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/androidpublisher2/README.md b/gen/androidpublisher2/README.md index ed38d9f564..40ff397f79 100644 --- a/gen/androidpublisher2/README.md +++ b/gen/androidpublisher2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-androidpublisher2` library allows access to all features of the *Google Android Publisher* service. -This documentation was generated from *Android Publisher* crate version *0.1.8+20150316*, where *20150316* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Android Publisher* crate version *0.1.9+20150316*, where *20150316* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *Android Publisher* *v2* API can be found at the [official documentation site](https://developers.google.com/android-publisher). diff --git a/gen/androidpublisher2/src/cmn.rs b/gen/androidpublisher2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/androidpublisher2/src/cmn.rs +++ b/gen/androidpublisher2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/androidpublisher2/src/lib.rs b/gen/androidpublisher2/src/lib.rs index b0710aa5eb..897746db91 100644 --- a/gen/androidpublisher2/src/lib.rs +++ b/gen/androidpublisher2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Android Publisher* crate version *0.1.8+20150316*, where *20150316* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Android Publisher* crate version *0.1.9+20150316*, where *20150316* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *Android Publisher* *v2* API can be found at the //! [official documentation site](https://developers.google.com/android-publisher). diff --git a/gen/androidpublisher2/src/lib.rs.in b/gen/androidpublisher2/src/lib.rs.in index aa562614d0..96340a3989 100644 --- a/gen/androidpublisher2/src/lib.rs.in +++ b/gen/androidpublisher2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -132,7 +133,7 @@ impl<'a, C, A> AndroidPublisher AndroidPublisher { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -150,7 +151,7 @@ impl<'a, C, A> AndroidPublisher } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/appsactivity1-cli/Cargo.toml b/gen/appsactivity1-cli/Cargo.toml index 66e3cf3baf..2357d0f9b4 100644 --- a/gen/appsactivity1-cli/Cargo.toml +++ b/gen/appsactivity1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appsactivity1-cli" -version = "0.3.1+20150326" +version = "0.3.2+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with appsactivity (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appsactivity1-cli" @@ -17,9 +17,10 @@ keywords = ["appsactivity", "google", "cli"] name = "appsactivity1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/appsactivity1-cli/README.md b/gen/appsactivity1-cli/README.md index 2377d526dd..b58e81e20a 100644 --- a/gen/appsactivity1-cli/README.md +++ b/gen/appsactivity1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *appsactivity* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/appsactivity1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/appsactivity1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/appsactivity1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/appsactivity1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/appsactivity1-cli). # Usage -This documentation was generated from the *appsactivity* API at revision *20150326*. The CLI is at version *0.3.1*. +This documentation was generated from the *appsactivity* API at revision *20150326*. The CLI is at version *0.3.2*. ```bash appsactivity1 [options] diff --git a/gen/appsactivity1-cli/mkdocs.yml b/gen/appsactivity1-cli/mkdocs.yml index 484d65b878..b57dc19052 100644 --- a/gen/appsactivity1-cli/mkdocs.yml +++ b/gen/appsactivity1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appsactivity v0.3.1+20150326 +site_name: appsactivity v0.3.2+20150326 site_url: http://byron.github.io/google-apis-rs/google-appsactivity1-cli site_description: Write integrating applications with bcore diff --git a/gen/appsactivity1-cli/src/cmn.rs b/gen/appsactivity1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/appsactivity1-cli/src/cmn.rs +++ b/gen/appsactivity1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/appsactivity1-cli/src/main.rs b/gen/appsactivity1-cli/src/main.rs index 4f710d959b..5dd7d89e67 100644 --- a/gen/appsactivity1-cli/src/main.rs +++ b/gen/appsactivity1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -239,7 +240,7 @@ fn main() { let mut app = App::new("appsactivity1") .author("Sebastian Thiel ") - .version("0.3.1+20150326") + .version("0.3.2+20150326") .about("Provides a historical view of activity.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_appsactivity1_cli") .arg(Arg::with_name("url") @@ -321,7 +322,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/appsactivity1/Cargo.toml b/gen/appsactivity1/Cargo.toml index 1f50158700..d4456a6373 100644 --- a/gen/appsactivity1/Cargo.toml +++ b/gen/appsactivity1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appsactivity1" -version = "0.1.8+20150326" +version = "0.1.9+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with appsactivity (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appsactivity1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/appsactivity1/README.md b/gen/appsactivity1/README.md index fef082df9d..72df46ec8f 100644 --- a/gen/appsactivity1/README.md +++ b/gen/appsactivity1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-appsactivity1` library allows access to all features of the *Google appsactivity* service. -This documentation was generated from *appsactivity* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *appsactivity* crate version *0.1.9+20150326*, where *20150326* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *appsactivity* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/activity/). diff --git a/gen/appsactivity1/src/cmn.rs b/gen/appsactivity1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/appsactivity1/src/cmn.rs +++ b/gen/appsactivity1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/appsactivity1/src/lib.rs b/gen/appsactivity1/src/lib.rs index 8cf424afcb..75bb7bf531 100644 --- a/gen/appsactivity1/src/lib.rs +++ b/gen/appsactivity1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *appsactivity* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *appsactivity* crate version *0.1.9+20150326*, where *20150326* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *appsactivity* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/activity/). diff --git a/gen/appsactivity1/src/lib.rs.in b/gen/appsactivity1/src/lib.rs.in index 96da5c19a2..5ee1e01357 100644 --- a/gen/appsactivity1/src/lib.rs.in +++ b/gen/appsactivity1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -148,7 +149,7 @@ impl<'a, C, A> Appsactivity Appsactivity { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -157,7 +158,7 @@ impl<'a, C, A> Appsactivity } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/appstate1-cli/Cargo.toml b/gen/appstate1-cli/Cargo.toml index 508577353f..37f6cb21a7 100644 --- a/gen/appstate1-cli/Cargo.toml +++ b/gen/appstate1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appstate1-cli" -version = "0.3.1+20150527" +version = "0.3.2+20150717" authors = ["Sebastian Thiel "] description = "A complete library to interact with App State (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appstate1-cli" @@ -17,9 +17,10 @@ keywords = ["appstate", "google", "cli"] name = "appstate1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/appstate1-cli/README.md b/gen/appstate1-cli/README.md index 1b73d34f89..cdd3f42c17 100644 --- a/gen/appstate1-cli/README.md +++ b/gen/appstate1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *App State* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/appstate1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/appstate1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/appstate1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/appstate1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/appstate1-cli). # Usage -This documentation was generated from the *App State* API at revision *20150527*. The CLI is at version *0.3.1*. +This documentation was generated from the *App State* API at revision *20150717*. The CLI is at version *0.3.2*. ```bash appstate1 [options] diff --git a/gen/appstate1-cli/mkdocs.yml b/gen/appstate1-cli/mkdocs.yml index 679983a096..59787b93b1 100644 --- a/gen/appstate1-cli/mkdocs.yml +++ b/gen/appstate1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: App State v0.3.1+20150527 +site_name: App State v0.3.2+20150717 site_url: http://byron.github.io/google-apis-rs/google-appstate1-cli site_description: Write integrating applications with bcore diff --git a/gen/appstate1-cli/src/cmn.rs b/gen/appstate1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/appstate1-cli/src/cmn.rs +++ b/gen/appstate1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/appstate1-cli/src/main.rs b/gen/appstate1-cli/src/main.rs index 07e5bb2a54..76722b6e17 100644 --- a/gen/appstate1-cli/src/main.rs +++ b/gen/appstate1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -567,7 +568,7 @@ fn main() { let mut app = App::new("appstate1") .author("Sebastian Thiel ") - .version("0.3.1+20150527") + .version("0.3.2+20150717") .about("The Google App State API.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_appstate1_cli") .arg(Arg::with_name("url") @@ -649,7 +650,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/appstate1/Cargo.toml b/gen/appstate1/Cargo.toml index d483693e4d..7ad16e467d 100644 --- a/gen/appstate1/Cargo.toml +++ b/gen/appstate1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appstate1" -version = "0.1.8+20150527" +version = "0.1.9+20150717" authors = ["Sebastian Thiel "] description = "A complete library to interact with App State (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appstate1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/appstate1/README.md b/gen/appstate1/README.md index c9c0485f5e..90ac730490 100644 --- a/gen/appstate1/README.md +++ b/gen/appstate1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-appstate1` library allows access to all features of the *Google App State* service. -This documentation was generated from *App State* crate version *0.1.8+20150527*, where *20150527* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *App State* crate version *0.1.9+20150717*, where *20150717* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *App State* *v1* API can be found at the [official documentation site](https://developers.google.com/games/services/web/api/states). diff --git a/gen/appstate1/src/cmn.rs b/gen/appstate1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/appstate1/src/cmn.rs +++ b/gen/appstate1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/appstate1/src/lib.rs b/gen/appstate1/src/lib.rs index 7bccb23a5f..924266acec 100644 --- a/gen/appstate1/src/lib.rs +++ b/gen/appstate1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *App State* crate version *0.1.8+20150527*, where *20150527* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *App State* crate version *0.1.9+20150717*, where *20150717* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *App State* *v1* API can be found at the //! [official documentation site](https://developers.google.com/games/services/web/api/states). diff --git a/gen/appstate1/src/lib.rs.in b/gen/appstate1/src/lib.rs.in index 3e21edc86b..6b307684e7 100644 --- a/gen/appstate1/src/lib.rs.in +++ b/gen/appstate1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -132,7 +133,7 @@ impl<'a, C, A> AppState AppState { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -141,7 +142,7 @@ impl<'a, C, A> AppState } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/audit1-cli/Cargo.toml b/gen/audit1-cli/Cargo.toml index e5277b00e3..0928d5c26e 100644 --- a/gen/audit1-cli/Cargo.toml +++ b/gen/audit1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-audit1-cli" -version = "0.3.1+20150419" +version = "0.3.2+20150419" authors = ["Sebastian Thiel "] description = "A complete library to interact with audit (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/audit1-cli" @@ -17,9 +17,10 @@ keywords = ["audit", "google", "cli"] name = "audit1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/audit1-cli/README.md b/gen/audit1-cli/README.md index e896829851..a2ecf27800 100644 --- a/gen/audit1-cli/README.md +++ b/gen/audit1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *audit* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/audit1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/audit1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/audit1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/audit1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/audit1-cli). # Usage -This documentation was generated from the *audit* API at revision *20150419*. The CLI is at version *0.3.1*. +This documentation was generated from the *audit* API at revision *20150419*. The CLI is at version *0.3.2*. ```bash audit1 [options] diff --git a/gen/audit1-cli/mkdocs.yml b/gen/audit1-cli/mkdocs.yml index 1970db3f54..662ccdebb5 100644 --- a/gen/audit1-cli/mkdocs.yml +++ b/gen/audit1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: audit v0.3.1+20150419 +site_name: audit v0.3.2+20150419 site_url: http://byron.github.io/google-apis-rs/google-audit1-cli site_description: Write integrating applications with bcore diff --git a/gen/audit1-cli/src/cmn.rs b/gen/audit1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/audit1-cli/src/cmn.rs +++ b/gen/audit1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/audit1-cli/src/main.rs b/gen/audit1-cli/src/main.rs index 4933386542..a7b0d0f7ba 100644 --- a/gen/audit1-cli/src/main.rs +++ b/gen/audit1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -254,7 +255,7 @@ fn main() { let mut app = App::new("audit1") .author("Sebastian Thiel ") - .version("0.3.1+20150419") + .version("0.3.2+20150419") .about("Lets you access user activities in your enterprise made through various applications.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_audit1_cli") .arg(Arg::with_name("folder") @@ -331,7 +332,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/audit1/Cargo.toml b/gen/audit1/Cargo.toml index 66c8d813ef..efe646a1a0 100644 --- a/gen/audit1/Cargo.toml +++ b/gen/audit1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-audit1" -version = "0.1.8+20150419" +version = "0.1.9+20150419" authors = ["Sebastian Thiel "] description = "A complete library to interact with audit (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/audit1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/audit1/README.md b/gen/audit1/README.md index 441395fb62..440a6698f4 100644 --- a/gen/audit1/README.md +++ b/gen/audit1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-audit1` library allows access to all features of the *Google audit* service. -This documentation was generated from *audit* crate version *0.1.8+20150419*, where *20150419* is the exact revision of the *audit:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *audit* crate version *0.1.9+20150419*, where *20150419* is the exact revision of the *audit:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *audit* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/admin-audit/get_started). diff --git a/gen/audit1/src/cmn.rs b/gen/audit1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/audit1/src/cmn.rs +++ b/gen/audit1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/audit1/src/lib.rs b/gen/audit1/src/lib.rs index 66159853d8..ebe87213e6 100644 --- a/gen/audit1/src/lib.rs +++ b/gen/audit1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *audit* crate version *0.1.8+20150419*, where *20150419* is the exact revision of the *audit:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *audit* crate version *0.1.9+20150419*, where *20150419* is the exact revision of the *audit:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *audit* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/admin-audit/get_started). diff --git a/gen/audit1/src/lib.rs.in b/gen/audit1/src/lib.rs.in index aefbe57780..b05c4a2949 100644 --- a/gen/audit1/src/lib.rs.in +++ b/gen/audit1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -112,7 +113,7 @@ impl<'a, C, A> Audit Audit { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -121,7 +122,7 @@ impl<'a, C, A> Audit } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/autoscaler1_beta2-cli/Cargo.toml b/gen/autoscaler1_beta2-cli/Cargo.toml index c3f2f4f6ee..699198f774 100644 --- a/gen/autoscaler1_beta2-cli/Cargo.toml +++ b/gen/autoscaler1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-autoscaler1_beta2-cli" -version = "0.3.1+20150617" +version = "0.3.2+20150629" authors = ["Sebastian Thiel "] description = "A complete library to interact with autoscaler (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/autoscaler1_beta2-cli" @@ -17,9 +17,10 @@ keywords = ["autoscaler", "google", "cli"] name = "autoscaler1-beta2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/autoscaler1_beta2-cli/README.md b/gen/autoscaler1_beta2-cli/README.md index a5cc2a0dc7..052c85dc41 100644 --- a/gen/autoscaler1_beta2-cli/README.md +++ b/gen/autoscaler1_beta2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *autoscaler* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/autoscaler1-beta2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/autoscaler1-beta2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/autoscaler1-beta2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/autoscaler1-beta2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/autoscaler1_beta2-cli). # Usage -This documentation was generated from the *autoscaler* API at revision *20150617*. The CLI is at version *0.3.1*. +This documentation was generated from the *autoscaler* API at revision *20150629*. The CLI is at version *0.3.2*. ```bash autoscaler1-beta2 [options] diff --git a/gen/autoscaler1_beta2-cli/mkdocs.yml b/gen/autoscaler1_beta2-cli/mkdocs.yml index 3f54819d30..4fb165eee2 100644 --- a/gen/autoscaler1_beta2-cli/mkdocs.yml +++ b/gen/autoscaler1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: autoscaler v0.3.1+20150617 +site_name: autoscaler v0.3.2+20150629 site_url: http://byron.github.io/google-apis-rs/google-autoscaler1_beta2-cli site_description: Write integrating applications with bcore diff --git a/gen/autoscaler1_beta2-cli/src/cmn.rs b/gen/autoscaler1_beta2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/autoscaler1_beta2-cli/src/cmn.rs +++ b/gen/autoscaler1_beta2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/autoscaler1_beta2-cli/src/main.rs b/gen/autoscaler1_beta2-cli/src/main.rs index 2552e5c285..3ab912e95a 100644 --- a/gen/autoscaler1_beta2-cli/src/main.rs +++ b/gen/autoscaler1_beta2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1194,7 +1195,7 @@ fn main() { let mut app = App::new("autoscaler1-beta2") .author("Sebastian Thiel ") - .version("0.3.1+20150617") + .version("0.3.2+20150629") .about("The Google Compute Engine Autoscaler API provides autoscaling for groups of Cloud VMs.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_autoscaler1_beta2_cli") .arg(Arg::with_name("url") @@ -1276,7 +1277,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/autoscaler1_beta2/Cargo.toml b/gen/autoscaler1_beta2/Cargo.toml index 52f968bd46..a3d1132a11 100644 --- a/gen/autoscaler1_beta2/Cargo.toml +++ b/gen/autoscaler1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-autoscaler1_beta2" -version = "0.1.8+20150617" +version = "0.1.9+20150629" authors = ["Sebastian Thiel "] description = "A complete library to interact with autoscaler (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/autoscaler1_beta2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/autoscaler1_beta2/README.md b/gen/autoscaler1_beta2/README.md index 437bbb4549..d79fb1dae5 100644 --- a/gen/autoscaler1_beta2/README.md +++ b/gen/autoscaler1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-autoscaler1_beta2` library allows access to all features of the *Google autoscaler* service. -This documentation was generated from *autoscaler* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *autoscaler* crate version *0.1.9+20150629*, where *20150629* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *autoscaler* *v1_beta2* API can be found at the [official documentation site](http://developers.google.com/compute/docs/autoscaler). diff --git a/gen/autoscaler1_beta2/src/cmn.rs b/gen/autoscaler1_beta2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/autoscaler1_beta2/src/cmn.rs +++ b/gen/autoscaler1_beta2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/autoscaler1_beta2/src/lib.rs b/gen/autoscaler1_beta2/src/lib.rs index dd3743ca8f..e90498a33b 100644 --- a/gen/autoscaler1_beta2/src/lib.rs +++ b/gen/autoscaler1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *autoscaler* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *autoscaler* crate version *0.1.9+20150629*, where *20150629* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *autoscaler* *v1_beta2* API can be found at the //! [official documentation site](http://developers.google.com/compute/docs/autoscaler). diff --git a/gen/autoscaler1_beta2/src/lib.rs.in b/gen/autoscaler1_beta2/src/lib.rs.in index a403fefe9c..fa76dd45fa 100644 --- a/gen/autoscaler1_beta2/src/lib.rs.in +++ b/gen/autoscaler1_beta2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -132,7 +133,7 @@ impl<'a, C, A> AutoscalerHub AutoscalerHub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -147,7 +148,7 @@ impl<'a, C, A> AutoscalerHub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/bigquery2-cli/Cargo.toml b/gen/bigquery2-cli/Cargo.toml index c21987d1cb..53e96db961 100644 --- a/gen/bigquery2-cli/Cargo.toml +++ b/gen/bigquery2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-bigquery2-cli" -version = "0.3.1+20150526" +version = "0.3.2+20150720" authors = ["Sebastian Thiel "] description = "A complete library to interact with bigquery (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/bigquery2-cli" @@ -17,9 +17,10 @@ keywords = ["bigquery", "google", "cli"] name = "bigquery2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/bigquery2-cli/README.md b/gen/bigquery2-cli/README.md index dd9a48c223..a69b680898 100644 --- a/gen/bigquery2-cli/README.md +++ b/gen/bigquery2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *bigquery* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/bigquery2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/bigquery2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/bigquery2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/bigquery2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/bigquery2-cli). # Usage -This documentation was generated from the *bigquery* API at revision *20150526*. The CLI is at version *0.3.1*. +This documentation was generated from the *bigquery* API at revision *20150720*. The CLI is at version *0.3.2*. ```bash bigquery2 [options] diff --git a/gen/bigquery2-cli/mkdocs.yml b/gen/bigquery2-cli/mkdocs.yml index ba8247fc47..8e06242ecb 100644 --- a/gen/bigquery2-cli/mkdocs.yml +++ b/gen/bigquery2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: bigquery v0.3.1+20150526 +site_name: bigquery v0.3.2+20150720 site_url: http://byron.github.io/google-apis-rs/google-bigquery2-cli site_description: Write integrating applications with bcore diff --git a/gen/bigquery2-cli/src/cmn.rs b/gen/bigquery2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/bigquery2-cli/src/cmn.rs +++ b/gen/bigquery2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/bigquery2-cli/src/main.rs b/gen/bigquery2-cli/src/main.rs index 16b5758ea5..96a60a83da 100644 --- a/gen/bigquery2-cli/src/main.rs +++ b/gen/bigquery2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1318,7 +1319,7 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "expiration-time" => Some(("expirationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "table-reference.project-id" => Some(("tableReference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1327,14 +1328,15 @@ impl<'n, 'a> Engine<'n, 'a> { "num-rows" => Some(("numRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "num-bytes" => Some(("numBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "friendly-name" => Some(("friendlyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "expiration-time" => Some(("expirationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "view.query" => Some(("view.query", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "description", "etag", "expiration-time", "friendly-name", "id", "kind", "last-modified-time", "num-bytes", "num-rows", "project-id", "query", "self-link", "table-id", "table-reference", "type", "view"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "description", "etag", "expiration-time", "friendly-name", "id", "kind", "last-modified-time", "location", "num-bytes", "num-rows", "project-id", "query", "self-link", "table-id", "table-reference", "type", "view"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1477,7 +1479,7 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "expiration-time" => Some(("expirationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "table-reference.project-id" => Some(("tableReference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1486,14 +1488,15 @@ impl<'n, 'a> Engine<'n, 'a> { "num-rows" => Some(("numRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "num-bytes" => Some(("numBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "friendly-name" => Some(("friendlyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "expiration-time" => Some(("expirationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "view.query" => Some(("view.query", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "description", "etag", "expiration-time", "friendly-name", "id", "kind", "last-modified-time", "num-bytes", "num-rows", "project-id", "query", "self-link", "table-id", "table-reference", "type", "view"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "description", "etag", "expiration-time", "friendly-name", "id", "kind", "last-modified-time", "location", "num-bytes", "num-rows", "project-id", "query", "self-link", "table-id", "table-reference", "type", "view"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1577,7 +1580,7 @@ impl<'n, 'a> Engine<'n, 'a> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "expiration-time" => Some(("expirationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "table-reference.project-id" => Some(("tableReference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1586,14 +1589,15 @@ impl<'n, 'a> Engine<'n, 'a> { "num-rows" => Some(("numRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "num-bytes" => Some(("numBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "friendly-name" => Some(("friendlyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "expiration-time" => Some(("expirationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "view.query" => Some(("view.query", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "description", "etag", "expiration-time", "friendly-name", "id", "kind", "last-modified-time", "num-bytes", "num-rows", "project-id", "query", "self-link", "table-id", "table-reference", "type", "view"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "description", "etag", "expiration-time", "friendly-name", "id", "kind", "last-modified-time", "location", "num-bytes", "num-rows", "project-id", "query", "self-link", "table-id", "table-reference", "type", "view"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2493,7 +2497,7 @@ fn main() { let mut app = App::new("bigquery2") .author("Sebastian Thiel ") - .version("0.3.1+20150526") + .version("0.3.2+20150720") .about("A data platform for customers to create, manage, share and query data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_bigquery2_cli") .arg(Arg::with_name("url") @@ -2586,7 +2590,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/bigquery2/Cargo.toml b/gen/bigquery2/Cargo.toml index d6d4514b14..cc4dd0f5a5 100644 --- a/gen/bigquery2/Cargo.toml +++ b/gen/bigquery2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-bigquery2" -version = "0.1.8+20150526" +version = "0.1.9+20150720" authors = ["Sebastian Thiel "] description = "A complete library to interact with bigquery (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/bigquery2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/bigquery2/README.md b/gen/bigquery2/README.md index 42c9bb04be..9b950efc8d 100644 --- a/gen/bigquery2/README.md +++ b/gen/bigquery2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-bigquery2` library allows access to all features of the *Google bigquery* service. -This documentation was generated from *bigquery* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *bigquery* crate version *0.1.9+20150720*, where *20150720* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *bigquery* *v2* API can be found at the [official documentation site](https://cloud.google.com/bigquery/). diff --git a/gen/bigquery2/src/cmn.rs b/gen/bigquery2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/bigquery2/src/cmn.rs +++ b/gen/bigquery2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/bigquery2/src/lib.rs b/gen/bigquery2/src/lib.rs index 303df3bd4e..792a57aab9 100644 --- a/gen/bigquery2/src/lib.rs +++ b/gen/bigquery2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *bigquery* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *bigquery* crate version *0.1.9+20150720*, where *20150720* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *bigquery* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/bigquery/). diff --git a/gen/bigquery2/src/lib.rs.in b/gen/bigquery2/src/lib.rs.in index 0a840eee8e..fc16ba271a 100644 --- a/gen/bigquery2/src/lib.rs.in +++ b/gen/bigquery2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -151,7 +152,7 @@ impl<'a, C, A> Bigquery Bigquery { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -172,7 +173,7 @@ impl<'a, C, A> Bigquery } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -476,6 +477,23 @@ impl NestedType for DatasetListDatasets {} impl Part for DatasetListDatasets {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserDefinedFunctionResource { + /// [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path). + #[serde(rename="resourceUri")] + pub resource_uri: Option, + /// [Pick one] An inline resource that contains code for a user-defined function (UDF). Providing a inline code resource is equivalent to providing a URI for a file containing the same code. + #[serde(rename="inlineCode")] + pub inline_code: Option, +} + +impl Part for UserDefinedFunctionResource {} + + /// Tables in the requested dataset. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1109,6 +1127,9 @@ pub struct JobConfigurationQuery { /// [Experimental] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source. By defining these properties, the data source can then be queried as if it were a standard BigQuery table. #[serde(rename="tableDefinitions")] pub table_definitions: Option>, + /// [Experimental] Describes user-defined function resources used in the query. + #[serde(rename="userDefinedFunctionResources")] + pub user_defined_function_resources: Option>, } impl Part for JobConfigurationQuery {} @@ -1249,40 +1270,42 @@ impl Part for TableReference {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Table { - /// [Output-only] The type of the resource. - pub kind: Option, - /// [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed. - #[serde(rename="expirationTime")] - pub expiration_time: Option, /// [Optional] A user-friendly description of this table. pub description: Option, - /// [Output-only] The time when this table was created, in milliseconds since the epoch. - #[serde(rename="creationTime")] - pub creation_time: Option, - /// [Output-only] An opaque ID uniquely identifying the table. - pub id: Option, - /// [Output-only] The number of rows of data in this table. This property is unavailable for tables that are actively receiving streaming inserts. - #[serde(rename="numRows")] - pub num_rows: Option, /// [Output-only] The size of the table in bytes. This property is unavailable for tables that are actively receiving streaming inserts. #[serde(rename="numBytes")] pub num_bytes: Option, - /// [Output-only] A hash of this resource. - pub etag: Option, - /// [Optional] A descriptive name for this table. - #[serde(rename="friendlyName")] - pub friendly_name: Option, /// [Output-only] The time when this table was last modified, in milliseconds since the epoch. #[serde(rename="lastModifiedTime")] pub last_modified_time: Option, + /// [Output-only] An opaque ID uniquely identifying the table. + pub id: Option, + /// [Output-only] The type of the resource. + pub kind: Option, + /// [Output-only] The time when this table was created, in milliseconds since the epoch. + #[serde(rename="creationTime")] + pub creation_time: Option, + /// [Required] Reference describing the ID of this table. + #[serde(rename="tableReference")] + pub table_reference: Option, + /// [Output-only] The number of rows of data in this table. This property is unavailable for tables that are actively receiving streaming inserts. + #[serde(rename="numRows")] + pub num_rows: Option, + /// [Output-only] A hash of this resource. + pub etag: Option, + /// [Optional] The backing storage location. + pub location: Option, + /// [Optional] A descriptive name for this table. + #[serde(rename="friendlyName")] + pub friendly_name: Option, + /// [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed. + #[serde(rename="expirationTime")] + pub expiration_time: Option, /// [Optional] Describes the schema of this table. pub schema: Option, /// [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. The default value is TABLE. #[serde(rename="type")] pub type_: Option, - /// [Required] Reference describing the ID of this table. - #[serde(rename="tableReference")] - pub table_reference: Option, /// [Output-only] A URL that can be used to access this resource again. #[serde(rename="selfLink")] pub self_link: Option, @@ -5997,7 +6020,7 @@ impl<'a, C, A> JobGetQueryResultCall<'a, C, A> where C: BorrowMut self._job_id = new_value.to_string(); self } - /// How long to wait for the query to complete, in milliseconds, before returning. Default is to return immediately. If the timeout passes before the job completes, the request will fail with a TIMEOUT error + /// How long to wait for the query to complete, in milliseconds, before returning. Default is 10 seconds. If the timeout passes before the job completes, the 'jobComplete' field in the response will be false /// /// Sets the *timeout ms* query property to the given value. pub fn timeout_ms(mut self, new_value: u32) -> JobGetQueryResultCall<'a, C, A> { diff --git a/gen/blogger3-cli/Cargo.toml b/gen/blogger3-cli/Cargo.toml index f9da0cdcfa..b76eaa3107 100644 --- a/gen/blogger3-cli/Cargo.toml +++ b/gen/blogger3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-blogger3-cli" -version = "0.3.1+20150422" +version = "0.3.2+20150422" authors = ["Sebastian Thiel "] description = "A complete library to interact with blogger (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/blogger3-cli" @@ -17,9 +17,10 @@ keywords = ["blogger", "google", "cli"] name = "blogger3" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/blogger3-cli/README.md b/gen/blogger3-cli/README.md index e0ceeb9ee7..c646a4ce90 100644 --- a/gen/blogger3-cli/README.md +++ b/gen/blogger3-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *blogger* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/blogger3.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/blogger3.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/blogger3.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/blogger3.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/blogger3-cli). # Usage -This documentation was generated from the *blogger* API at revision *20150422*. The CLI is at version *0.3.1*. +This documentation was generated from the *blogger* API at revision *20150422*. The CLI is at version *0.3.2*. ```bash blogger3 [options] diff --git a/gen/blogger3-cli/mkdocs.yml b/gen/blogger3-cli/mkdocs.yml index b0d4f1797f..863fb1beb7 100644 --- a/gen/blogger3-cli/mkdocs.yml +++ b/gen/blogger3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: blogger v0.3.1+20150422 +site_name: blogger v0.3.2+20150422 site_url: http://byron.github.io/google-apis-rs/google-blogger3-cli site_description: Write integrating applications with bcore diff --git a/gen/blogger3-cli/src/cmn.rs b/gen/blogger3-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/blogger3-cli/src/cmn.rs +++ b/gen/blogger3-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/blogger3-cli/src/main.rs b/gen/blogger3-cli/src/main.rs index 98c982da79..e938b95801 100644 --- a/gen/blogger3-cli/src/main.rs +++ b/gen/blogger3-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -3495,7 +3496,7 @@ fn main() { let mut app = App::new("blogger3") .author("Sebastian Thiel ") - .version("0.3.1+20150422") + .version("0.3.2+20150422") .about("API for access to the data within Blogger.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_blogger3_cli") .arg(Arg::with_name("url") @@ -3577,7 +3578,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/blogger3/Cargo.toml b/gen/blogger3/Cargo.toml index eab74c839c..0c426e7da6 100644 --- a/gen/blogger3/Cargo.toml +++ b/gen/blogger3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-blogger3" -version = "0.1.8+20150422" +version = "0.1.9+20150422" authors = ["Sebastian Thiel "] description = "A complete library to interact with blogger (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/blogger3" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/blogger3/README.md b/gen/blogger3/README.md index 50b1463612..2bd0019f42 100644 --- a/gen/blogger3/README.md +++ b/gen/blogger3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-blogger3` library allows access to all features of the *Google blogger* service. -This documentation was generated from *blogger* crate version *0.1.8+20150422*, where *20150422* is the exact revision of the *blogger:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *blogger* crate version *0.1.9+20150422*, where *20150422* is the exact revision of the *blogger:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *blogger* *v3* API can be found at the [official documentation site](https://developers.google.com/blogger/docs/3.0/getting_started). diff --git a/gen/blogger3/src/cmn.rs b/gen/blogger3/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/blogger3/src/cmn.rs +++ b/gen/blogger3/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/blogger3/src/lib.rs b/gen/blogger3/src/lib.rs index d6e338bb77..90f448c591 100644 --- a/gen/blogger3/src/lib.rs +++ b/gen/blogger3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *blogger* crate version *0.1.8+20150422*, where *20150422* is the exact revision of the *blogger:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *blogger* crate version *0.1.9+20150422*, where *20150422* is the exact revision of the *blogger:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *blogger* *v3* API can be found at the //! [official documentation site](https://developers.google.com/blogger/docs/3.0/getting_started). diff --git a/gen/blogger3/src/lib.rs.in b/gen/blogger3/src/lib.rs.in index 212a36ba51..117e81d1f2 100644 --- a/gen/blogger3/src/lib.rs.in +++ b/gen/blogger3/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -139,7 +140,7 @@ impl<'a, C, A> Blogger Blogger { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -169,7 +170,7 @@ impl<'a, C, A> Blogger } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/books1-cli/Cargo.toml b/gen/books1-cli/Cargo.toml index d1d2572e4f..dd7c0c9f94 100644 --- a/gen/books1-cli/Cargo.toml +++ b/gen/books1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-books1-cli" -version = "0.3.1+20150318" +version = "0.3.2+20150318" authors = ["Sebastian Thiel "] description = "A complete library to interact with books (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/books1-cli" @@ -17,9 +17,10 @@ keywords = ["books", "google", "cli"] name = "books1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/books1-cli/README.md b/gen/books1-cli/README.md index 15a36042a1..75c34ab3bd 100644 --- a/gen/books1-cli/README.md +++ b/gen/books1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *books* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/books1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/books1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/books1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/books1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/books1-cli). # Usage -This documentation was generated from the *books* API at revision *20150318*. The CLI is at version *0.3.1*. +This documentation was generated from the *books* API at revision *20150318*. The CLI is at version *0.3.2*. ```bash books1 [options] diff --git a/gen/books1-cli/mkdocs.yml b/gen/books1-cli/mkdocs.yml index d7f0f121f0..78ca08e210 100644 --- a/gen/books1-cli/mkdocs.yml +++ b/gen/books1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: books v0.3.1+20150318 +site_name: books v0.3.2+20150318 site_url: http://byron.github.io/google-apis-rs/google-books1-cli site_description: Write integrating applications with bcore diff --git a/gen/books1-cli/src/cmn.rs b/gen/books1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/books1-cli/src/cmn.rs +++ b/gen/books1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/books1-cli/src/main.rs b/gen/books1-cli/src/main.rs index 6e9681e6ea..4ab00c6b91 100644 --- a/gen/books1-cli/src/main.rs +++ b/gen/books1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -4327,7 +4328,7 @@ fn main() { let mut app = App::new("books1") .author("Sebastian Thiel ") - .version("0.3.1+20150318") + .version("0.3.2+20150318") .about("Lets you search for books and manage your Google Books library.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_books1_cli") .arg(Arg::with_name("url") @@ -4409,7 +4410,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/books1/Cargo.toml b/gen/books1/Cargo.toml index 300a03cbe7..b132a484fa 100644 --- a/gen/books1/Cargo.toml +++ b/gen/books1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-books1" -version = "0.1.8+20150318" +version = "0.1.9+20150318" authors = ["Sebastian Thiel "] description = "A complete library to interact with books (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/books1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/books1/README.md b/gen/books1/README.md index d198556204..7c755fff0f 100644 --- a/gen/books1/README.md +++ b/gen/books1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-books1` library allows access to all features of the *Google books* service. -This documentation was generated from *books* crate version *0.1.8+20150318*, where *20150318* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *books* crate version *0.1.9+20150318*, where *20150318* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *books* *v1* API can be found at the [official documentation site](https://developers.google.com/books/docs/v1/getting_started). diff --git a/gen/books1/src/cmn.rs b/gen/books1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/books1/src/cmn.rs +++ b/gen/books1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/books1/src/lib.rs b/gen/books1/src/lib.rs index a7a8c7904e..43b4a164cd 100644 --- a/gen/books1/src/lib.rs +++ b/gen/books1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *books* crate version *0.1.8+20150318*, where *20150318* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *books* crate version *0.1.9+20150318*, where *20150318* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *books* *v1* API can be found at the //! [official documentation site](https://developers.google.com/books/docs/v1/getting_started). diff --git a/gen/books1/src/lib.rs.in b/gen/books1/src/lib.rs.in index b7df848718..6a488860d5 100644 --- a/gen/books1/src/lib.rs.in +++ b/gen/books1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -137,7 +138,7 @@ impl<'a, C, A> Books Books { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -170,7 +171,7 @@ impl<'a, C, A> Books } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/calendar3-cli/Cargo.toml b/gen/calendar3-cli/Cargo.toml index 864babbab4..5958761203 100644 --- a/gen/calendar3-cli/Cargo.toml +++ b/gen/calendar3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-calendar3-cli" -version = "0.3.1+20150408" +version = "0.3.2+20150715" authors = ["Sebastian Thiel "] description = "A complete library to interact with calendar (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/calendar3-cli" @@ -17,9 +17,10 @@ keywords = ["calendar", "google", "cli"] name = "calendar3" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/calendar3-cli/README.md b/gen/calendar3-cli/README.md index ef96c007be..a27eaba45b 100644 --- a/gen/calendar3-cli/README.md +++ b/gen/calendar3-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *calendar* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/calendar3.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/calendar3.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/calendar3.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/calendar3.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/calendar3-cli). # Usage -This documentation was generated from the *calendar* API at revision *20150408*. The CLI is at version *0.3.1*. +This documentation was generated from the *calendar* API at revision *20150715*. The CLI is at version *0.3.2*. ```bash calendar3 [options] diff --git a/gen/calendar3-cli/mkdocs.yml b/gen/calendar3-cli/mkdocs.yml index 73dbcda3bd..3daa6d2c68 100644 --- a/gen/calendar3-cli/mkdocs.yml +++ b/gen/calendar3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: calendar v0.3.1+20150408 +site_name: calendar v0.3.2+20150715 site_url: http://byron.github.io/google-apis-rs/google-calendar3-cli site_description: Write integrating applications with bcore diff --git a/gen/calendar3-cli/src/cmn.rs b/gen/calendar3-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/calendar3-cli/src/cmn.rs +++ b/gen/calendar3-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/calendar3-cli/src/main.rs b/gen/calendar3-cli/src/main.rs index d0a6af0cf2..f0e6e859c8 100644 --- a/gen/calendar3-cli/src/main.rs +++ b/gen/calendar3-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1929,6 +1930,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "supports-attachments" => { + call = call.supports_attachments(arg_from_str(value.unwrap_or("false"), err, "supports-attachments", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1942,6 +1946,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["supports-attachments"].iter().map(|v|*v)); v } )); } } @@ -2069,6 +2074,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "supports-attachments" => { + call = call.supports_attachments(arg_from_str(value.unwrap_or("false"), err, "supports-attachments", "boolean")); + }, "send-notifications" => { call = call.send_notifications(arg_from_str(value.unwrap_or("false"), err, "send-notifications", "boolean")); }, @@ -2088,7 +2096,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["max-attendees", "send-notifications"].iter().map(|v|*v)); + v.extend(["supports-attachments", "max-attendees", "send-notifications"].iter().map(|v|*v)); v } )); } } @@ -2456,6 +2464,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "supports-attachments" => { + call = call.supports_attachments(arg_from_str(value.unwrap_or("false"), err, "supports-attachments", "boolean")); + }, "send-notifications" => { call = call.send_notifications(arg_from_str(value.unwrap_or("false"), err, "send-notifications", "boolean")); }, @@ -2478,7 +2489,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["max-attendees", "always-include-email", "send-notifications"].iter().map(|v|*v)); + v.extend(["supports-attachments", "max-attendees", "always-include-email", "send-notifications"].iter().map(|v|*v)); v } )); } } @@ -2662,6 +2673,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "supports-attachments" => { + call = call.supports_attachments(arg_from_str(value.unwrap_or("false"), err, "supports-attachments", "boolean")); + }, "send-notifications" => { call = call.send_notifications(arg_from_str(value.unwrap_or("false"), err, "send-notifications", "boolean")); }, @@ -2684,7 +2698,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["max-attendees", "always-include-email", "send-notifications"].iter().map(|v|*v)); + v.extend(["supports-attachments", "max-attendees", "always-include-email", "send-notifications"].iter().map(|v|*v)); v } )); } } @@ -4371,7 +4385,7 @@ fn main() { let mut app = App::new("calendar3") .author("Sebastian Thiel ") - .version("0.3.1+20150408") + .version("0.3.2+20150715") .about("Lets you manipulate events and other calendar data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_calendar3_cli") .arg(Arg::with_name("url") @@ -4453,7 +4467,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/calendar3/Cargo.toml b/gen/calendar3/Cargo.toml index 6ebf63a8db..5128b249c2 100644 --- a/gen/calendar3/Cargo.toml +++ b/gen/calendar3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-calendar3" -version = "0.1.8+20150408" +version = "0.1.9+20150715" authors = ["Sebastian Thiel "] description = "A complete library to interact with calendar (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/calendar3" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/calendar3/README.md b/gen/calendar3/README.md index df7e5611ea..3615c0e8e7 100644 --- a/gen/calendar3/README.md +++ b/gen/calendar3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-calendar3` library allows access to all features of the *Google calendar* service. -This documentation was generated from *calendar* crate version *0.1.8+20150408*, where *20150408* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *calendar* crate version *0.1.9+20150715*, where *20150715* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *calendar* *v3* API can be found at the [official documentation site](https://developers.google.com/google-apps/calendar/firstapp). diff --git a/gen/calendar3/src/cmn.rs b/gen/calendar3/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/calendar3/src/cmn.rs +++ b/gen/calendar3/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/calendar3/src/lib.rs b/gen/calendar3/src/lib.rs index bdff40849e..777ca58265 100644 --- a/gen/calendar3/src/lib.rs +++ b/gen/calendar3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *calendar* crate version *0.1.8+20150408*, where *20150408* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *calendar* crate version *0.1.9+20150715*, where *20150715* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *calendar* *v3* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/calendar/firstapp). @@ -136,22 +136,22 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.events().watch(req, "calendarId") -//! .updated_min("ut") -//! .time_zone("amet.") -//! .time_min("ipsum") -//! .time_max("ut") -//! .sync_token("dolor") +//! .updated_min("dolor") +//! .time_zone("sea") +//! .time_min("ut") +//! .time_max("eirmod") +//! .sync_token("sanctus") //! .single_events(true) -//! .show_hidden_invitations(true) +//! .show_hidden_invitations(false) //! .show_deleted(true) -//! .add_shared_extended_property("sanctus") -//! .q("voluptua.") -//! .add_private_extended_property("dolor") -//! .page_token("et") +//! .add_shared_extended_property("et") +//! .q("vero") +//! .add_private_extended_property("ut") +//! .page_token("sed") //! .order_by("et") -//! .max_results(-26) -//! .max_attendees(-36) -//! .i_cal_uid("sed") +//! .max_results(-55) +//! .max_attendees(-20) +//! .i_cal_uid("dolore") //! .always_include_email(true) //! .doit(); //! diff --git a/gen/calendar3/src/lib.rs.in b/gen/calendar3/src/lib.rs.in index f53dc9b4c0..30ef568546 100644 --- a/gen/calendar3/src/lib.rs.in +++ b/gen/calendar3/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -152,7 +153,7 @@ impl<'a, C, A> CalendarHub CalendarHub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -182,7 +183,7 @@ impl<'a, C, A> CalendarHub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -292,6 +293,33 @@ pub struct Settings { impl ResponseResult for Settings {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EventAttachment { + /// Internet media type (MIME type) of the attachment. + #[serde(rename="mimeType")] + pub mime_type: Option, + /// URL link to the attachment's icon. Read-only. + #[serde(rename="iconLink")] + pub icon_link: Option, + /// URL link to the attachment. + /// For adding Google Drive file attachments use the same format as in alternateLink property of the Files resource in the Drive API. + #[serde(rename="fileUrl")] + pub file_url: Option, + /// ID of the attached file. Read-only. + /// E.g. for Google Drive files this is the ID of the corresponding Files resource entry in the Drive API. + #[serde(rename="fileId")] + pub file_id: Option, + /// Attachment title. + pub title: Option, +} + +impl Part for EventAttachment {} + + /// There is no detailed description. /// /// # Activities @@ -932,7 +960,7 @@ pub struct EventReminder { pub minutes: Option, /// The method used by this reminder. Possible values are: /// - "email" - Reminders are sent via email. - /// - "sms" - Reminders are sent via SMS. + /// - "sms" - Reminders are sent via SMS. They are only available for Google Apps for Work, Education, and Government customers. Requests to set SMS reminders for the other accounts will be ignored. /// - "popup" - Reminders are sent via a UI popup. pub method: Option, } @@ -971,7 +999,7 @@ pub struct CalendarNotification { pub type_: Option, /// The method used to deliver the notification. Possible values are: /// - "email" - Reminders are sent via email. - /// - "sms" - Reminders are sent via SMS. This value is read-only and is ignored on inserts and updates. + /// - "sms" - Reminders are sent via SMS. This value is read-only and is ignored on inserts and updates. Furthermore, SMS reminders are only available for Google Apps for Work, Education, and Government customers. pub method: Option, } @@ -999,6 +1027,10 @@ impl Part for CalendarNotification {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Event { + /// File attachments for the event. Currently only Google Drive attachments are supported. + /// In order to modify attachments the supportsAttachments request parameter should be set to true. + /// There can be at most 25 attachments per event, + pub attachments: Option>, /// The creator of the event. Read-only. pub creator: Option, /// The organizer of the event. If the organizer is also an attendee, this is indicated with a separate entry in attendees with the organizer field set to True. To change the organizer, use the move operation. Read-only, except when importing an event. @@ -1947,6 +1979,7 @@ impl<'a, C, A> EventMethods<'a, C, A> { hub: self.hub, _request: request, _calendar_id: calendar_id.to_string(), + _supports_attachments: Default::default(), _send_notifications: Default::default(), _max_attendees: Default::default(), _delegate: Default::default(), @@ -1968,6 +2001,7 @@ impl<'a, C, A> EventMethods<'a, C, A> { hub: self.hub, _request: request, _calendar_id: calendar_id.to_string(), + _supports_attachments: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2073,6 +2107,7 @@ impl<'a, C, A> EventMethods<'a, C, A> { _request: request, _calendar_id: calendar_id.to_string(), _event_id: event_id.to_string(), + _supports_attachments: Default::default(), _send_notifications: Default::default(), _max_attendees: Default::default(), _always_include_email: Default::default(), @@ -2119,6 +2154,7 @@ impl<'a, C, A> EventMethods<'a, C, A> { _request: request, _calendar_id: calendar_id.to_string(), _event_id: event_id.to_string(), + _supports_attachments: Default::default(), _send_notifications: Default::default(), _max_attendees: Default::default(), _always_include_email: Default::default(), @@ -9109,8 +9145,9 @@ impl<'a, C, A> EventDeleteCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.events().insert(req, "calendarId") +/// .supports_attachments(true) /// .send_notifications(true) -/// .max_attendees(-7) +/// .max_attendees(-58) /// .doit(); /// # } /// ``` @@ -9120,6 +9157,7 @@ pub struct EventInsertCall<'a, C, A> hub: &'a CalendarHub, _request: Event, _calendar_id: String, + _supports_attachments: Option, _send_notifications: Option, _max_attendees: Option, _delegate: Option<&'a mut Delegate>, @@ -9143,15 +9181,18 @@ impl<'a, C, A> EventInsertCall<'a, C, A> where C: BorrowMut, A: o }; dlg.begin(MethodInfo { id: "calendar.events.insert", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); params.push(("calendarId", self._calendar_id.to_string())); + if let Some(value) = self._supports_attachments { + params.push(("supportsAttachments", value.to_string())); + } if let Some(value) = self._send_notifications { params.push(("sendNotifications", value.to_string())); } if let Some(value) = self._max_attendees { params.push(("maxAttendees", value.to_string())); } - for &field in ["alt", "calendarId", "sendNotifications", "maxAttendees"].iter() { + for &field in ["alt", "calendarId", "supportsAttachments", "sendNotifications", "maxAttendees"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9301,6 +9342,13 @@ impl<'a, C, A> EventInsertCall<'a, C, A> where C: BorrowMut, A: o self._calendar_id = new_value.to_string(); self } + /// Whether API client performing operation supports event attachments. Optional. The default is False. + /// + /// Sets the *supports attachments* query property to the given value. + pub fn supports_attachments(mut self, new_value: bool) -> EventInsertCall<'a, C, A> { + self._supports_attachments = Some(new_value); + self + } /// Whether to send notifications about the creation of the new event. Optional. The default is False. /// /// Sets the *send notifications* query property to the given value. @@ -9400,6 +9448,7 @@ impl<'a, C, A> EventInsertCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.events().import(req, "calendarId") +/// .supports_attachments(false) /// .doit(); /// # } /// ``` @@ -9409,6 +9458,7 @@ pub struct EventImportCall<'a, C, A> hub: &'a CalendarHub, _request: Event, _calendar_id: String, + _supports_attachments: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -9430,9 +9480,12 @@ impl<'a, C, A> EventImportCall<'a, C, A> where C: BorrowMut, A: o }; dlg.begin(MethodInfo { id: "calendar.events.import", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("calendarId", self._calendar_id.to_string())); - for &field in ["alt", "calendarId"].iter() { + if let Some(value) = self._supports_attachments { + params.push(("supportsAttachments", value.to_string())); + } + for &field in ["alt", "calendarId", "supportsAttachments"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9582,6 +9635,13 @@ impl<'a, C, A> EventImportCall<'a, C, A> where C: BorrowMut, A: o self._calendar_id = new_value.to_string(); self } + /// Whether API client performing operation supports event attachments. Optional. The default is False. + /// + /// Sets the *supports attachments* query property to the given value. + pub fn supports_attachments(mut self, new_value: bool) -> EventImportCall<'a, C, A> { + self._supports_attachments = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -9661,15 +9721,15 @@ impl<'a, C, A> EventImportCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.events().instances("calendarId", "eventId") -/// .time_zone("invidunt") -/// .time_min("ea") -/// .time_max("sadipscing") -/// .show_deleted(false) -/// .page_token("dolore") -/// .original_start("nonumy") -/// .max_results(-29) -/// .max_attendees(-82) -/// .always_include_email(false) +/// .time_zone("sadipscing") +/// .time_min("rebum.") +/// .time_max("dolore") +/// .show_deleted(true) +/// .page_token("sed") +/// .original_start("aliquyam") +/// .max_results(-53) +/// .max_attendees(-40) +/// .always_include_email(true) /// .doit(); /// # } /// ``` @@ -10017,9 +10077,9 @@ impl<'a, C, A> EventInstanceCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.events().get("calendarId", "eventId") -/// .time_zone("labore") -/// .max_attendees(-30) -/// .always_include_email(true) +/// .time_zone("ea") +/// .max_attendees(-62) +/// .always_include_email(false) /// .doit(); /// # } /// ``` @@ -10301,22 +10361,22 @@ impl<'a, C, A> EventGetCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.events().list("calendarId") -/// .updated_min("aliquyam") -/// .time_zone("eos") -/// .time_min("tempor") -/// .time_max("sea") -/// .sync_token("labore") +/// .updated_min("tempor") +/// .time_zone("sea") +/// .time_min("labore") +/// .time_max("ipsum") +/// .sync_token("aliquyam") /// .single_events(false) -/// .show_hidden_invitations(true) -/// .show_deleted(false) -/// .add_shared_extended_property("sit") -/// .q("diam") -/// .add_private_extended_property("ut") -/// .page_token("justo") -/// .order_by("est") -/// .max_results(-46) -/// .max_attendees(-23) -/// .i_cal_uid("clita") +/// .show_hidden_invitations(false) +/// .show_deleted(true) +/// .add_shared_extended_property("ut") +/// .q("justo") +/// .add_private_extended_property("est") +/// .page_token("amet") +/// .order_by("accusam") +/// .max_results(-13) +/// .max_attendees(-79) +/// .i_cal_uid("justo") /// .always_include_email(false) /// .doit(); /// # } @@ -10770,8 +10830,9 @@ impl<'a, C, A> EventListCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.events().patch(req, "calendarId", "eventId") -/// .send_notifications(false) -/// .max_attendees(-37) +/// .supports_attachments(false) +/// .send_notifications(true) +/// .max_attendees(-24) /// .always_include_email(false) /// .doit(); /// # } @@ -10783,6 +10844,7 @@ pub struct EventPatchCall<'a, C, A> _request: Event, _calendar_id: String, _event_id: String, + _supports_attachments: Option, _send_notifications: Option, _max_attendees: Option, _always_include_email: Option, @@ -10807,9 +10869,12 @@ impl<'a, C, A> EventPatchCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "calendar.events.patch", http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); params.push(("calendarId", self._calendar_id.to_string())); params.push(("eventId", self._event_id.to_string())); + if let Some(value) = self._supports_attachments { + params.push(("supportsAttachments", value.to_string())); + } if let Some(value) = self._send_notifications { params.push(("sendNotifications", value.to_string())); } @@ -10819,7 +10884,7 @@ impl<'a, C, A> EventPatchCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._always_include_email { params.push(("alwaysIncludeEmail", value.to_string())); } - for &field in ["alt", "calendarId", "eventId", "sendNotifications", "maxAttendees", "alwaysIncludeEmail"].iter() { + for &field in ["alt", "calendarId", "eventId", "supportsAttachments", "sendNotifications", "maxAttendees", "alwaysIncludeEmail"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10979,6 +11044,13 @@ impl<'a, C, A> EventPatchCall<'a, C, A> where C: BorrowMut, A: oa self._event_id = new_value.to_string(); self } + /// Whether API client performing operation supports event attachments. Optional. The default is False. + /// + /// Sets the *supports attachments* query property to the given value. + pub fn supports_attachments(mut self, new_value: bool) -> EventPatchCall<'a, C, A> { + self._supports_attachments = Some(new_value); + self + } /// Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False. /// /// Sets the *send notifications* query property to the given value. @@ -11079,7 +11151,7 @@ impl<'a, C, A> EventPatchCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.events().move_("calendarId", "eventId", "destination") -/// .send_notifications(true) +/// .send_notifications(false) /// .doit(); /// # } /// ``` @@ -11357,8 +11429,9 @@ impl<'a, C, A> EventMoveCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.events().update(req, "calendarId", "eventId") -/// .send_notifications(false) -/// .max_attendees(-17) +/// .supports_attachments(true) +/// .send_notifications(true) +/// .max_attendees(-62) /// .always_include_email(false) /// .doit(); /// # } @@ -11370,6 +11443,7 @@ pub struct EventUpdateCall<'a, C, A> _request: Event, _calendar_id: String, _event_id: String, + _supports_attachments: Option, _send_notifications: Option, _max_attendees: Option, _always_include_email: Option, @@ -11394,9 +11468,12 @@ impl<'a, C, A> EventUpdateCall<'a, C, A> where C: BorrowMut, A: o }; dlg.begin(MethodInfo { id: "calendar.events.update", http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); params.push(("calendarId", self._calendar_id.to_string())); params.push(("eventId", self._event_id.to_string())); + if let Some(value) = self._supports_attachments { + params.push(("supportsAttachments", value.to_string())); + } if let Some(value) = self._send_notifications { params.push(("sendNotifications", value.to_string())); } @@ -11406,7 +11483,7 @@ impl<'a, C, A> EventUpdateCall<'a, C, A> where C: BorrowMut, A: o if let Some(value) = self._always_include_email { params.push(("alwaysIncludeEmail", value.to_string())); } - for &field in ["alt", "calendarId", "eventId", "sendNotifications", "maxAttendees", "alwaysIncludeEmail"].iter() { + for &field in ["alt", "calendarId", "eventId", "supportsAttachments", "sendNotifications", "maxAttendees", "alwaysIncludeEmail"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11566,6 +11643,13 @@ impl<'a, C, A> EventUpdateCall<'a, C, A> where C: BorrowMut, A: o self._event_id = new_value.to_string(); self } + /// Whether API client performing operation supports event attachments. Optional. The default is False. + /// + /// Sets the *supports attachments* query property to the given value. + pub fn supports_attachments(mut self, new_value: bool) -> EventUpdateCall<'a, C, A> { + self._supports_attachments = Some(new_value); + self + } /// Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False. /// /// Sets the *send notifications* query property to the given value. @@ -11672,22 +11756,22 @@ impl<'a, C, A> EventUpdateCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.events().watch(req, "calendarId") -/// .updated_min("diam") -/// .time_zone("kasd") +/// .updated_min("Lorem") +/// .time_zone("clita") /// .time_min("invidunt") -/// .time_max("rebum.") -/// .sync_token("Lorem") +/// .time_max("eirmod") +/// .sync_token("At") /// .single_events(false) /// .show_hidden_invitations(true) /// .show_deleted(false) -/// .add_shared_extended_property("At") -/// .q("consetetur") -/// .add_private_extended_property("et") -/// .page_token("sed") -/// .order_by("sit") -/// .max_results(-8) -/// .max_attendees(-43) -/// .i_cal_uid("nonumy") +/// .add_shared_extended_property("sit") +/// .q("takimata") +/// .add_private_extended_property("elitr") +/// .page_token("nonumy") +/// .order_by("rebum.") +/// .max_results(-6) +/// .max_attendees(-50) +/// .i_cal_uid("diam") /// .always_include_email(true) /// .doit(); /// # } @@ -12160,7 +12244,7 @@ impl<'a, C, A> EventWatchCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.events().quick_add("calendarId", "text") -/// .send_notifications(true) +/// .send_notifications(false) /// .doit(); /// # } /// ``` diff --git a/gen/civicinfo2-cli/Cargo.toml b/gen/civicinfo2-cli/Cargo.toml index 3a1da85a55..e2eeb3c6a9 100644 --- a/gen/civicinfo2-cli/Cargo.toml +++ b/gen/civicinfo2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-civicinfo2-cli" -version = "0.3.1+20150302" +version = "0.3.2+20150707" authors = ["Sebastian Thiel "] description = "A complete library to interact with Civic Info (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/civicinfo2-cli" @@ -17,9 +17,10 @@ keywords = ["civicinfo", "google", "cli"] name = "civicinfo2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/civicinfo2-cli/README.md b/gen/civicinfo2-cli/README.md index 98b273be43..b4d7c536ed 100644 --- a/gen/civicinfo2-cli/README.md +++ b/gen/civicinfo2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *Civic Info* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/civicinfo2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/civicinfo2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/civicinfo2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/civicinfo2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/civicinfo2-cli). # Usage -This documentation was generated from the *Civic Info* API at revision *20150302*. The CLI is at version *0.3.1*. +This documentation was generated from the *Civic Info* API at revision *20150707*. The CLI is at version *0.3.2*. ```bash civicinfo2 [options] diff --git a/gen/civicinfo2-cli/mkdocs.yml b/gen/civicinfo2-cli/mkdocs.yml index 91b804a125..c81c7b9ae9 100644 --- a/gen/civicinfo2-cli/mkdocs.yml +++ b/gen/civicinfo2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Civic Info v0.3.1+20150302 +site_name: Civic Info v0.3.2+20150707 site_url: http://byron.github.io/google-apis-rs/google-civicinfo2-cli site_description: Write integrating applications with bcore diff --git a/gen/civicinfo2-cli/src/cmn.rs b/gen/civicinfo2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/civicinfo2-cli/src/cmn.rs +++ b/gen/civicinfo2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/civicinfo2-cli/src/main.rs b/gen/civicinfo2-cli/src/main.rs index 060b76197a..710a614835 100644 --- a/gen/civicinfo2-cli/src/main.rs +++ b/gen/civicinfo2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -554,7 +555,7 @@ fn main() { let mut app = App::new("civicinfo2") .author("Sebastian Thiel ") - .version("0.3.1+20150302") + .version("0.3.2+20150707") .about("An API for accessing civic information.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_civicinfo2_cli") .arg(Arg::with_name("folder") @@ -631,7 +632,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/civicinfo2/Cargo.toml b/gen/civicinfo2/Cargo.toml index c6c3b29c68..7a092f9820 100644 --- a/gen/civicinfo2/Cargo.toml +++ b/gen/civicinfo2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-civicinfo2" -version = "0.1.8+20150302" +version = "0.1.9+20150707" authors = ["Sebastian Thiel "] description = "A complete library to interact with Civic Info (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/civicinfo2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/civicinfo2/README.md b/gen/civicinfo2/README.md index 8b03edc25a..ea113184ef 100644 --- a/gen/civicinfo2/README.md +++ b/gen/civicinfo2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-civicinfo2` library allows access to all features of the *Google Civic Info* service. -This documentation was generated from *Civic Info* crate version *0.1.8+20150302*, where *20150302* is the exact revision of the *civicinfo:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Civic Info* crate version *0.1.9+20150707*, where *20150707* is the exact revision of the *civicinfo:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *Civic Info* *v2* API can be found at the [official documentation site](https://developers.google.com/civic-information). diff --git a/gen/civicinfo2/src/cmn.rs b/gen/civicinfo2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/civicinfo2/src/cmn.rs +++ b/gen/civicinfo2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/civicinfo2/src/lib.rs b/gen/civicinfo2/src/lib.rs index 4f2aa296d2..a38468bcfb 100644 --- a/gen/civicinfo2/src/lib.rs +++ b/gen/civicinfo2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Civic Info* crate version *0.1.8+20150302*, where *20150302* is the exact revision of the *civicinfo:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Civic Info* crate version *0.1.9+20150707*, where *20150707* is the exact revision of the *civicinfo:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *Civic Info* *v2* API can be found at the //! [official documentation site](https://developers.google.com/civic-information). diff --git a/gen/civicinfo2/src/lib.rs.in b/gen/civicinfo2/src/lib.rs.in index c149119094..8dba27501b 100644 --- a/gen/civicinfo2/src/lib.rs.in +++ b/gen/civicinfo2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -105,7 +106,7 @@ impl<'a, C, A> CivicInfo CivicInfo { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -120,7 +121,7 @@ impl<'a, C, A> CivicInfo } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -257,16 +258,30 @@ impl Part for Candidate {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Contest { + /// The threshold of votes that the referendum needs in order to pass, e.g. "two-thirds". This field is only populated for contests of type 'Referendum'. + #[serde(rename="referendumPassageThreshold")] + pub referendum_passage_threshold: Option, + /// The full text of the referendum. This field is only populated for contests of type 'Referendum'. + #[serde(rename="referendumText")] + pub referendum_text: Option, /// The name of the office for this contest. pub office: Option, + /// Specifies a short summary of the referendum that is on the ballot below the title but above the text. This field is only populated for contests of type 'Referendum'. + #[serde(rename="referendumBrief")] + pub referendum_brief: Option, /// A list of sources for this contest. If multiple sources are listed, the data has been aggregated from those sources. pub sources: Option>, /// If this is a partisan election, the name of the party it is for. #[serde(rename="primaryParty")] pub primary_party: Option, + /// A brief description of the referendum. This field is only populated for contests of type 'Referendum'. + #[serde(rename="referendumSubtitle")] + pub referendum_subtitle: Option, /// A description of any additional eligibility requirements for voting in this contest. #[serde(rename="electorateSpecifications")] pub electorate_specifications: Option, + /// The roles which this office fulfills. + pub roles: Option>, /// The number of candidates that will be elected to office in this contest. #[serde(rename="numberElected")] pub number_elected: Option, @@ -280,21 +295,28 @@ pub struct Contest { pub id: Option, /// "Yes" or "No" depending on whether this a contest being held outside the normal election cycle. pub special: Option, + /// Specifies what effect abstaining (not voting) on the proposition will have (i.e. whether abstaining is considered a vote against it). This field is only populated for contests of type 'Referendum'. + #[serde(rename="referendumEffectOfAbstain")] + pub referendum_effect_of_abstain: Option, /// The number of candidates that a voter may vote for in this contest. #[serde(rename="numberVotingFor")] pub number_voting_for: Option, + /// A statement in opposition to the referendum. It does not necessarily appear on the ballot. This field is only populated for contests of type 'Referendum'. + #[serde(rename="referendumConStatement")] + pub referendum_con_statement: Option, /// Information about the electoral district that this contest is in. pub district: Option, - /// The roles which this office fulfills. - pub roles: Option>, /// The levels of government of the office for this contest. There may be more than one in cases where a jurisdiction effectively acts at two different levels of government; for example, the mayor of the District of Columbia acts at "locality" level, but also effectively at both "administrative-area-2" and "administrative-area-1". pub level: Option>, /// A number specifying the position of this contest on the voter's ballot. #[serde(rename="ballotPlacement")] pub ballot_placement: Option, - /// A brief description of the referendum. This field is only populated for contests of type 'Referendum'. - #[serde(rename="referendumSubtitle")] - pub referendum_subtitle: Option, + /// The set of ballot responses for the referendum. A ballot response represents a line on the ballot. Common examples might include "yes" or "no" for referenda, or a judge's name for a retention contest. This field is only populated for contests of type 'Referendum'. + #[serde(rename="referendumBallotResponses")] + pub referendum_ballot_responses: Option>, + /// A statement in favor of the referendum. It does not necessarily appear on the ballot. This field is only populated for contests of type 'Referendum'. + #[serde(rename="referendumProStatement")] + pub referendum_pro_statement: Option, /// The candidate choices for this contest. pub candidates: Option>, /// The type of contest. Usually this will be 'General', 'Primary', or 'Run-off' for contests with candidates. For referenda this will be 'Referendum'. @@ -622,6 +644,9 @@ pub struct VoterInfoResponse { /// If no election ID was specified in the query, and there was more than one election with data for the given voter, this will contain information about the other elections that could apply. #[serde(rename="otherElections")] pub other_elections: Option>, + /// Specifies whether voters in the precinct vote only by mailing their ballots (with the possible option of dropping off their ballots as well). + #[serde(rename="mailOnly")] + pub mail_only: Option, /// Identifies what kind of resource this is. Value: the fixed string "civicinfo#voterInfoResponse". pub kind: Option, /// The normalized version of the requested address diff --git a/gen/cloudlatencytest2-cli/Cargo.toml b/gen/cloudlatencytest2-cli/Cargo.toml index ec51839a0e..72a99d582d 100644 --- a/gen/cloudlatencytest2-cli/Cargo.toml +++ b/gen/cloudlatencytest2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudlatencytest2-cli" -version = "0.3.1+20150508" +version = "0.3.2+20150508" authors = ["Sebastian Thiel "] description = "A complete library to interact with cloudlatencytest (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudlatencytest2-cli" @@ -16,9 +16,10 @@ keywords = ["cloudlatencytest", "google", "cli"] name = "cloudlatencytest2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/cloudlatencytest2-cli/README.md b/gen/cloudlatencytest2-cli/README.md index 61a9de0b09..a6219cebed 100644 --- a/gen/cloudlatencytest2-cli/README.md +++ b/gen/cloudlatencytest2-cli/README.md @@ -14,14 +14,14 @@ If data-structures are requested, these will be returned as pretty-printed JSON, You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/cloudlatencytest2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/cloudlatencytest2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/cloudlatencytest2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/cloudlatencytest2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudlatencytest2-cli). # Usage -This documentation was generated from the *cloudlatencytest* API at revision *20150508*. The CLI is at version *0.3.1*. +This documentation was generated from the *cloudlatencytest* API at revision *20150508*. The CLI is at version *0.3.2*. ```bash cloudlatencytest2 [options] diff --git a/gen/cloudlatencytest2-cli/mkdocs.yml b/gen/cloudlatencytest2-cli/mkdocs.yml index 7cceb4158c..0ae046a843 100644 --- a/gen/cloudlatencytest2-cli/mkdocs.yml +++ b/gen/cloudlatencytest2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: cloudlatencytest v0.3.1+20150508 +site_name: cloudlatencytest v0.3.2+20150508 site_url: http://byron.github.io/google-apis-rs/google-cloudlatencytest2-cli site_description: Write integrating applications with bcore diff --git a/gen/cloudlatencytest2-cli/src/cmn.rs b/gen/cloudlatencytest2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/cloudlatencytest2-cli/src/cmn.rs +++ b/gen/cloudlatencytest2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/cloudlatencytest2-cli/src/main.rs b/gen/cloudlatencytest2-cli/src/main.rs index 539bd38478..47721243ca 100644 --- a/gen/cloudlatencytest2-cli/src/main.rs +++ b/gen/cloudlatencytest2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -365,7 +366,7 @@ fn main() { let mut app = App::new("cloudlatencytest2") .author("Sebastian Thiel ") - .version("0.3.1+20150508") + .version("0.3.2+20150508") .about("A Test API to report latency data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudlatencytest2_cli") .arg(Arg::with_name("url") @@ -447,7 +448,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/cloudlatencytest2/Cargo.toml b/gen/cloudlatencytest2/Cargo.toml index eddfa9eda2..ee330781dd 100644 --- a/gen/cloudlatencytest2/Cargo.toml +++ b/gen/cloudlatencytest2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudlatencytest2" -version = "0.1.8+20150508" +version = "0.1.9+20150508" authors = ["Sebastian Thiel "] description = "A complete library to interact with cloudlatencytest (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudlatencytest2" @@ -15,9 +15,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/cloudlatencytest2/README.md b/gen/cloudlatencytest2/README.md index efb535e049..c644dbb844 100644 --- a/gen/cloudlatencytest2/README.md +++ b/gen/cloudlatencytest2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-cloudlatencytest2` library allows access to all features of the *Google cloudlatencytest* service. -This documentation was generated from *cloudlatencytest* crate version *0.1.8+20150508*, where *20150508* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *cloudlatencytest* crate version *0.1.9+20150508*, where *20150508* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. # Features Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_cloudlatencytest2/struct.Cloudlatencytest.html) ... diff --git a/gen/cloudlatencytest2/src/cmn.rs b/gen/cloudlatencytest2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/cloudlatencytest2/src/cmn.rs +++ b/gen/cloudlatencytest2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/cloudlatencytest2/src/lib.rs b/gen/cloudlatencytest2/src/lib.rs index a69569dda6..42b5f13b4d 100644 --- a/gen/cloudlatencytest2/src/lib.rs +++ b/gen/cloudlatencytest2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *cloudlatencytest* crate version *0.1.8+20150508*, where *20150508* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *cloudlatencytest* crate version *0.1.9+20150508*, where *20150508* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudlatencytest2). //! # Features //! diff --git a/gen/cloudlatencytest2/src/lib.rs.in b/gen/cloudlatencytest2/src/lib.rs.in index bf946be227..218f7d16da 100644 --- a/gen/cloudlatencytest2/src/lib.rs.in +++ b/gen/cloudlatencytest2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -131,7 +132,7 @@ impl<'a, C, A> Cloudlatencytest Cloudlatencytest { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -140,7 +141,7 @@ impl<'a, C, A> Cloudlatencytest } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/cloudmonitoring2_beta2-cli/Cargo.toml b/gen/cloudmonitoring2_beta2-cli/Cargo.toml index bfb43e8123..42c579fe9a 100644 --- a/gen/cloudmonitoring2_beta2-cli/Cargo.toml +++ b/gen/cloudmonitoring2_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudmonitoring2_beta2-cli" -version = "0.3.1+20150616" +version = "0.3.2+20150713" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Monitoring (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudmonitoring2_beta2-cli" @@ -17,9 +17,10 @@ keywords = ["cloudmonitoring", "google", "cli"] name = "cloudmonitoring2-beta2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/cloudmonitoring2_beta2-cli/README.md b/gen/cloudmonitoring2_beta2-cli/README.md index f468a27fe8..5a0124d16f 100644 --- a/gen/cloudmonitoring2_beta2-cli/README.md +++ b/gen/cloudmonitoring2_beta2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *Cloud Monitoring* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/cloudmonitoring2-beta2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/cloudmonitoring2-beta2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/cloudmonitoring2-beta2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/cloudmonitoring2-beta2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudmonitoring2_beta2-cli). # Usage -This documentation was generated from the *Cloud Monitoring* API at revision *20150616*. The CLI is at version *0.3.1*. +This documentation was generated from the *Cloud Monitoring* API at revision *20150713*. The CLI is at version *0.3.2*. ```bash cloudmonitoring2-beta2 [options] diff --git a/gen/cloudmonitoring2_beta2-cli/mkdocs.yml b/gen/cloudmonitoring2_beta2-cli/mkdocs.yml index 28e9a3620e..0e8758557a 100644 --- a/gen/cloudmonitoring2_beta2-cli/mkdocs.yml +++ b/gen/cloudmonitoring2_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Monitoring v0.3.1+20150616 +site_name: Cloud Monitoring v0.3.2+20150713 site_url: http://byron.github.io/google-apis-rs/google-cloudmonitoring2_beta2-cli site_description: Write integrating applications with bcore diff --git a/gen/cloudmonitoring2_beta2-cli/src/cmn.rs b/gen/cloudmonitoring2_beta2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/cloudmonitoring2_beta2-cli/src/cmn.rs +++ b/gen/cloudmonitoring2_beta2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/cloudmonitoring2_beta2-cli/src/main.rs b/gen/cloudmonitoring2_beta2-cli/src/main.rs index d914518c33..975101d443 100644 --- a/gen/cloudmonitoring2_beta2-cli/src/main.rs +++ b/gen/cloudmonitoring2_beta2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -913,7 +914,7 @@ fn main() { let mut app = App::new("cloudmonitoring2-beta2") .author("Sebastian Thiel ") - .version("0.3.1+20150616") + .version("0.3.2+20150713") .about("API for accessing Google Cloud and API monitoring data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudmonitoring2_beta2_cli") .arg(Arg::with_name("url") @@ -995,7 +996,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/cloudmonitoring2_beta2/Cargo.toml b/gen/cloudmonitoring2_beta2/Cargo.toml index d7e6b78870..39e9ecd952 100644 --- a/gen/cloudmonitoring2_beta2/Cargo.toml +++ b/gen/cloudmonitoring2_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudmonitoring2_beta2" -version = "0.1.8+20150616" +version = "0.1.9+20150713" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Monitoring (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudmonitoring2_beta2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/cloudmonitoring2_beta2/README.md b/gen/cloudmonitoring2_beta2/README.md index ec55c2e3f2..02029bbf47 100644 --- a/gen/cloudmonitoring2_beta2/README.md +++ b/gen/cloudmonitoring2_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-cloudmonitoring2_beta2` library allows access to all features of the *Google Cloud Monitoring* service. -This documentation was generated from *Cloud Monitoring* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Cloud Monitoring* crate version *0.1.9+20150713*, where *20150713* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *Cloud Monitoring* *v2_beta2* API can be found at the [official documentation site](https://cloud.google.com/monitoring/v2beta2/). diff --git a/gen/cloudmonitoring2_beta2/src/cmn.rs b/gen/cloudmonitoring2_beta2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/cloudmonitoring2_beta2/src/cmn.rs +++ b/gen/cloudmonitoring2_beta2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/cloudmonitoring2_beta2/src/lib.rs b/gen/cloudmonitoring2_beta2/src/lib.rs index 19861d35c0..d413fdee53 100644 --- a/gen/cloudmonitoring2_beta2/src/lib.rs +++ b/gen/cloudmonitoring2_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Monitoring* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Cloud Monitoring* crate version *0.1.9+20150713*, where *20150713* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *Cloud Monitoring* *v2_beta2* API can be found at the //! [official documentation site](https://cloud.google.com/monitoring/v2beta2/). diff --git a/gen/cloudmonitoring2_beta2/src/lib.rs.in b/gen/cloudmonitoring2_beta2/src/lib.rs.in index a385673d95..3c0043835f 100644 --- a/gen/cloudmonitoring2_beta2/src/lib.rs.in +++ b/gen/cloudmonitoring2_beta2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -34,6 +35,9 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { + /// View and manage your data across Google Cloud Platform services + CloudPlatform, + /// View and write monitoring data for all of your Google and third-party Cloud and API projects Monitoring, } @@ -41,6 +45,7 @@ pub enum Scope { impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", Scope::Monitoring => "https://www.googleapis.com/auth/monitoring", } } @@ -134,7 +139,7 @@ impl<'a, C, A> CloudMonitoring CloudMonitoring { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -149,7 +154,7 @@ impl<'a, C, A> CloudMonitoring } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -963,7 +968,7 @@ impl<'a, C, A> TimeseriesDescriptorListCall<'a, C, A> where C: BorrowMut TimeseriesDescriptorListCall<'a, C, A> where C: BorrowMut TimeseryWriteCall<'a, C, A> where C: BorrowMut, A: let mut url = "https://www.googleapis.com/cloudmonitoring/v2beta2/projects/{project}/timeseries:write".to_string(); if self._scopes.len() == 0 { - self._scopes.insert(Scope::Monitoring.as_ref().to_string(), ()); + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{project}", "project")].iter() { @@ -1488,7 +1493,7 @@ impl<'a, C, A> TimeseryWriteCall<'a, C, A> where C: BorrowMut, A: /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Monitoring`. + /// `Scope::CloudPlatform`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -1626,7 +1631,7 @@ impl<'a, C, A> TimeseryListCall<'a, C, A> where C: BorrowMut, A: let mut url = "https://www.googleapis.com/cloudmonitoring/v2beta2/projects/{project}/timeseries/{metric}".to_string(); if self._scopes.len() == 0 { - self._scopes.insert(Scope::Monitoring.as_ref().to_string(), ()); + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{project}", "project"), ("{metric}", "metric")].iter() { @@ -1884,7 +1889,7 @@ impl<'a, C, A> TimeseryListCall<'a, C, A> where C: BorrowMut, A: /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Monitoring`. + /// `Scope::CloudPlatform`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -1994,7 +1999,7 @@ impl<'a, C, A> MetricDescriptorListCall<'a, C, A> where C: BorrowMut MetricDescriptorListCall<'a, C, A> where C: BorrowMut MetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut MetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut MetricDescriptorCreateCall<'a, C, A> where C: BorrowMut MetricDescriptorCreateCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with cloudresourcemanager (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1_beta1-cli" @@ -17,9 +17,10 @@ keywords = ["cloudresourcemanager", "google", "cli"] name = "cloudresourcemanager1-beta1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/cloudresourcemanager1_beta1-cli/README.md b/gen/cloudresourcemanager1_beta1-cli/README.md index ff55dc2287..2d9fc4d055 100644 --- a/gen/cloudresourcemanager1_beta1-cli/README.md +++ b/gen/cloudresourcemanager1_beta1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *cloudresourcemanager* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/cloudresourcemanager1-beta1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/cloudresourcemanager1-beta1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/cloudresourcemanager1-beta1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/cloudresourcemanager1-beta1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1_beta1-cli). # Usage -This documentation was generated from the *cloudresourcemanager* API at revision *20150603*. The CLI is at version *0.3.1*. +This documentation was generated from the *cloudresourcemanager* API at revision *20150711*. The CLI is at version *0.3.2*. ```bash cloudresourcemanager1-beta1 [options] diff --git a/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml b/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml index f82726501b..4ac43669e6 100644 --- a/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml +++ b/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: cloudresourcemanager v0.3.1+20150603 +site_name: cloudresourcemanager v0.3.2+20150711 site_url: http://byron.github.io/google-apis-rs/google-cloudresourcemanager1_beta1-cli site_description: Write integrating applications with bcore diff --git a/gen/cloudresourcemanager1_beta1-cli/src/cmn.rs b/gen/cloudresourcemanager1_beta1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/cloudresourcemanager1_beta1-cli/src/cmn.rs +++ b/gen/cloudresourcemanager1_beta1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/cloudresourcemanager1_beta1-cli/src/main.rs b/gen/cloudresourcemanager1_beta1-cli/src/main.rs index 9634512e2a..ce6bc958b4 100644 --- a/gen/cloudresourcemanager1_beta1-cli/src/main.rs +++ b/gen/cloudresourcemanager1_beta1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -583,7 +584,7 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Marks the project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the project if it has a lifecycle state of [ACTIVE][cloudresourcemanager.projects.v1beta2.LifecycleState.ACTIVE] when this method is called. Otherwise this method does nothing (since all other states are phases of deletion). This method changes the project's lifecycle state from [ACTIVE][cloudresourcemanager.projects.v1beta2.LifecycleState.ACTIVE] to [DELETE_REQUESTED] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_REQUESTED]. The deletion starts at an unspecified time, at which point the lifecycle state changes to [DELETE_IN_PROGRESS] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_IN_PROGRESS]. Until the deletion completes, you can check the lifecycle state checked by retrieving the project with [GetProject] [cloudresourcemanager.projects.v1beta2.Projects.GetProject], and the project remains visible to [ListProjects] [cloudresourcemanager.projects.v1beta2.Projects.ListProjects]. However, you cannot update the project. After the deletion completes, the project is not retrievable by the [GetProject] [cloudresourcemanager.projects.v1beta2.Projects.GetProject] and [ListProjects] [cloudresourcemanager.projects.v1beta2.Projects.ListProjects] methods. The caller must have modify permissions for this project."##), + Some(r##"Marks the project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the project if the following criteria are met: + The project does not have a billing account associated with it. + The project has a lifecycle state of [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE]. This method changes the project's lifecycle state from [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE] to [DELETE_REQUESTED] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUESTED]. The deletion starts at an unspecified time, at which point the lifecycle state changes to [DELETE_IN_PROGRESS] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROGRESS]. Until the deletion completes, you can check the lifecycle state checked by retrieving the project with [GetProject] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject], and the project remains visible to [ListProjects] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects]. However, you cannot update the project. After the deletion completes, the project is not retrievable by the [GetProject] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject] and [ListProjects] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects] methods. The caller must have modify permissions for this project."##), "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1_cli/projects_delete", vec![ (Some(r##"project-id"##), @@ -643,7 +644,7 @@ fn main() { Some(false)), ]), ("undelete", - Some(r##"Restores the project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a project that has a lifecycle state of [DELETE_REQUESTED] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_REQUESTED]. After deletion starts, as indicated by a lifecycle state of [DELETE_IN_PROGRESS] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_IN_PROGRESS], the project cannot be restored. The caller must have modify permissions for this project."##), + Some(r##"Restores the project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a project that has a lifecycle state of [DELETE_REQUESTED] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUESTED]. After deletion starts, as indicated by a lifecycle state of [DELETE_IN_PROGRESS] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROGRESS], the project cannot be restored. The caller must have modify permissions for this project."##), "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1_cli/projects_undelete", vec![ (Some(r##"project-id"##), @@ -698,8 +699,8 @@ fn main() { let mut app = App::new("cloudresourcemanager1-beta1") .author("Sebastian Thiel ") - .version("0.3.1+20150603") - .about("The Google Cloud Resource Manager API provides methods for creating, reading, and updating of project metadata, including IAM policies, and will shortly provide the same for other high-level entities (e.g. customers and resource groups). Longer term, we expect the cloudresourcemanager API to encompass other Cloud resources as well.") + .version("0.3.2+20150711") + .about("The Google Cloud Resource Manager API provides methods for creating, reading, and updating of project metadata.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1_cli") .arg(Arg::with_name("url") .long("scope") @@ -780,7 +781,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/cloudresourcemanager1_beta1/Cargo.toml b/gen/cloudresourcemanager1_beta1/Cargo.toml index 3f7ce7d247..ad73e2601a 100644 --- a/gen/cloudresourcemanager1_beta1/Cargo.toml +++ b/gen/cloudresourcemanager1_beta1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudresourcemanager1_beta1" -version = "0.1.8+20150603" +version = "0.1.9+20150711" authors = ["Sebastian Thiel "] description = "A complete library to interact with cloudresourcemanager (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1_beta1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/cloudresourcemanager1_beta1/README.md b/gen/cloudresourcemanager1_beta1/README.md index dd2248265d..34792babe8 100644 --- a/gen/cloudresourcemanager1_beta1/README.md +++ b/gen/cloudresourcemanager1_beta1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-cloudresourcemanager1_beta1` library allows access to all features of the *Google cloudresourcemanager* service. -This documentation was generated from *cloudresourcemanager* crate version *0.1.8+20150603*, where *20150603* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *cloudresourcemanager* crate version *0.1.9+20150711*, where *20150711* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *cloudresourcemanager* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/resource-manager). diff --git a/gen/cloudresourcemanager1_beta1/src/cmn.rs b/gen/cloudresourcemanager1_beta1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/cloudresourcemanager1_beta1/src/cmn.rs +++ b/gen/cloudresourcemanager1_beta1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/cloudresourcemanager1_beta1/src/lib.rs b/gen/cloudresourcemanager1_beta1/src/lib.rs index 9efdb64868..c4cba7dc7e 100644 --- a/gen/cloudresourcemanager1_beta1/src/lib.rs +++ b/gen/cloudresourcemanager1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *cloudresourcemanager* crate version *0.1.8+20150603*, where *20150603* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *cloudresourcemanager* crate version *0.1.9+20150711*, where *20150711* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *cloudresourcemanager* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/resource-manager). diff --git a/gen/cloudresourcemanager1_beta1/src/lib.rs.in b/gen/cloudresourcemanager1_beta1/src/lib.rs.in index 6758dba347..d53420666b 100644 --- a/gen/cloudresourcemanager1_beta1/src/lib.rs.in +++ b/gen/cloudresourcemanager1_beta1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -128,7 +129,7 @@ impl<'a, C, A> Cloudresourcemanager Cloudresourcemanager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -137,7 +138,7 @@ impl<'a, C, A> Cloudresourcemanager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -151,7 +152,7 @@ impl<'a, C, A> Cloudresourcemanager // ############ // SCHEMAS ### // ########## -/// A Project is a high-level Google Cloud Platform entity. It is a container for ACLs, APIs, AppEngine Apps, VMs, and other Google Cloud Platform resources. Projects are subordinate to Customers. +/// A Project is a high-level Google Cloud Platform entity. It is a container for ACLs, APIs, AppEngine Apps, VMs, and other Google Cloud Platform resources. /// /// # Activities /// @@ -167,14 +168,14 @@ impl<'a, C, A> Cloudresourcemanager /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Project { - /// The user-assigned name of the project. This field is optional and can remain unset. Allowed characters are: lower- and upper-case letters, numbers, hyphen, single-quote, double-quotes, space, and exclamation point. Example: "My Project" Read-write. + /// The user-assigned name of the project. This field is optional and can remain unset. Allowed characters are: lowercase and uppercase letters, numbers, hyphen, single-quote, double-quote, space, and exclamation point. Example: My Project Read-write. pub name: Option, - /// The unique, user-assigned id of the project. It must be 6 to 30 lowercase letters, digits, or hyphens. It must start with a letter. Trailing hyphens are prohibited. Example: "tokyo-rain-123" Read-only after creation. + /// The unique, user-assigned ID of the project. It must be 6 to 30 lowercase letters, digits, or hyphens. It must start with a letter. Trailing hyphens are prohibited. Example: tokyo-rain-123 Read-only after creation. #[serde(rename="projectId")] pub project_id: Option, - /// The labels associated with this project. Label keys must be between 1 and 63 characters long and must conform to the following regular expression: [a-z]([-a-z0-9]*[a-z0-9])?. Label values must be between 0 and 63 characters long and must conform to the regular expression ([a-z]([-a-z0-9]*[a-z0-9])?)?. No more than 256 labels can be associated with a given resource. Note that additional character may be included in labels in the future. Clients should store labels in a representation such as JSON that does not depend on specific characters being disallowed. Example: "environment" : "dev" Read-write. + /// The labels associated with this project. Label keys must be between 1 and 63 characters long and must conform to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. Label values must be between 0 and 63 characters long and must conform to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. No more than 256 labels can be associated with a given resource. Clients should store labels in a representation such as JSON that does not depend on specific characters being disallowed. Example: "environment" : "dev" Read-write. pub labels: Option>, - /// The number uniquely identifying the project. Example: 415104041262. Read-only. + /// The number uniquely identifying the project. Example: 415104041262 Read-only. #[serde(rename="projectNumber")] pub project_number: Option, /// Creation time. Read-only. @@ -190,7 +191,7 @@ impl Resource for Project {} impl ResponseResult for Project {} -/// A page of the response received from the [ListProjects][cloudresourcemanager.projects.v1beta1.Projects.ListProjects] method. A paginated response where more pages are available has `next_page_token` set. This token can be used in a subsequent request to retrieve the next request page. +/// A page of the response received from the [ListProjects][google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects] method. A paginated response where more pages are available has `next_page_token` set. This token can be used in a subsequent request to retrieve the next request page. /// /// # Activities /// @@ -211,7 +212,7 @@ pub struct ListProjectsResponse { impl ResponseResult for ListProjectsResponse {} -/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } +/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`. /// /// # Activities /// @@ -272,7 +273,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Marks the project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the project if it has a lifecycle state of [ACTIVE][cloudresourcemanager.projects.v1beta2.LifecycleState.ACTIVE] when this method is called. Otherwise this method does nothing (since all other states are phases of deletion). This method changes the project's lifecycle state from [ACTIVE][cloudresourcemanager.projects.v1beta2.LifecycleState.ACTIVE] to [DELETE_REQUESTED] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_REQUESTED]. The deletion starts at an unspecified time, at which point the lifecycle state changes to [DELETE_IN_PROGRESS] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_IN_PROGRESS]. Until the deletion completes, you can check the lifecycle state checked by retrieving the project with [GetProject] [cloudresourcemanager.projects.v1beta2.Projects.GetProject], and the project remains visible to [ListProjects] [cloudresourcemanager.projects.v1beta2.Projects.ListProjects]. However, you cannot update the project. After the deletion completes, the project is not retrievable by the [GetProject] [cloudresourcemanager.projects.v1beta2.Projects.GetProject] and [ListProjects] [cloudresourcemanager.projects.v1beta2.Projects.ListProjects] methods. The caller must have modify permissions for this project. + /// Marks the project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the project if the following criteria are met: + The project does not have a billing account associated with it. + The project has a lifecycle state of [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE]. This method changes the project's lifecycle state from [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE] to [DELETE_REQUESTED] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUESTED]. The deletion starts at an unspecified time, at which point the lifecycle state changes to [DELETE_IN_PROGRESS] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROGRESS]. Until the deletion completes, you can check the lifecycle state checked by retrieving the project with [GetProject] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject], and the project remains visible to [ListProjects] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects]. However, you cannot update the project. After the deletion completes, the project is not retrievable by the [GetProject] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject] and [ListProjects] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects] methods. The caller must have modify permissions for this project. /// /// # Arguments /// @@ -289,7 +290,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Restores the project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a project that has a lifecycle state of [DELETE_REQUESTED] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_REQUESTED]. After deletion starts, as indicated by a lifecycle state of [DELETE_IN_PROGRESS] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_IN_PROGRESS], the project cannot be restored. The caller must have modify permissions for this project. + /// Restores the project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a project that has a lifecycle state of [DELETE_REQUESTED] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUESTED]. After deletion starts, as indicated by a lifecycle state of [DELETE_IN_PROGRESS] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROGRESS], the project cannot be restored. The caller must have modify permissions for this project. /// /// # Arguments /// @@ -381,7 +382,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# -/// Marks the project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the project if it has a lifecycle state of [ACTIVE][cloudresourcemanager.projects.v1beta2.LifecycleState.ACTIVE] when this method is called. Otherwise this method does nothing (since all other states are phases of deletion). This method changes the project's lifecycle state from [ACTIVE][cloudresourcemanager.projects.v1beta2.LifecycleState.ACTIVE] to [DELETE_REQUESTED] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_REQUESTED]. The deletion starts at an unspecified time, at which point the lifecycle state changes to [DELETE_IN_PROGRESS] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_IN_PROGRESS]. Until the deletion completes, you can check the lifecycle state checked by retrieving the project with [GetProject] [cloudresourcemanager.projects.v1beta2.Projects.GetProject], and the project remains visible to [ListProjects] [cloudresourcemanager.projects.v1beta2.Projects.ListProjects]. However, you cannot update the project. After the deletion completes, the project is not retrievable by the [GetProject] [cloudresourcemanager.projects.v1beta2.Projects.GetProject] and [ListProjects] [cloudresourcemanager.projects.v1beta2.Projects.ListProjects] methods. The caller must have modify permissions for this project. +/// Marks the project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the project if the following criteria are met: + The project does not have a billing account associated with it. + The project has a lifecycle state of [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE]. This method changes the project's lifecycle state from [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE] to [DELETE_REQUESTED] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUESTED]. The deletion starts at an unspecified time, at which point the lifecycle state changes to [DELETE_IN_PROGRESS] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROGRESS]. Until the deletion completes, you can check the lifecycle state checked by retrieving the project with [GetProject] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject], and the project remains visible to [ListProjects] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects]. However, you cannot update the project. After the deletion completes, the project is not retrievable by the [GetProject] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject] and [ListProjects] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects] methods. The caller must have modify permissions for this project. /// /// A builder for the *delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -623,7 +624,7 @@ impl<'a, C, A> ProjectDeleteCall<'a, C, A> where C: BorrowMut, A: } -/// Restores the project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a project that has a lifecycle state of [DELETE_REQUESTED] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_REQUESTED]. After deletion starts, as indicated by a lifecycle state of [DELETE_IN_PROGRESS] [cloudresourcemanager.projects.v1beta2.LifecycleState.DELETE_IN_PROGRESS], the project cannot be restored. The caller must have modify permissions for this project. +/// Restores the project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a project that has a lifecycle state of [DELETE_REQUESTED] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUESTED]. After deletion starts, as indicated by a lifecycle state of [DELETE_IN_PROGRESS] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROGRESS], the project cannot be restored. The caller must have modify permissions for this project. /// /// A builder for the *undelete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -1800,7 +1801,7 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o self._page_size = Some(new_value); self } - /// An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: name id labels. where is a the name of a label Examples: name:* ==> The project has a name. name:Howl ==> The project’s name is `Howl` or 'howl'. name:HOWL ==> Equivalent to above. NAME:howl ==> Equivalent to above. labels.color:* ==> The project has the label "color". labels.color:red ==> The project’s label `color` has the value `red`. labels.color:red label.size:big ==> The project's label `color` has the value `red` and its label `size` has the value `big`. Optional. + /// An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: + `name` + `id` + labels.key where *key* is the name of a label Some examples of using labels as filters: |Filter|Description| |------|-----------| |name:*|The project has a name.| |name:Howl|The project's name is `Howl` or `howl`.| |name:HOWL|Equivalent to above.| |NAME:howl|Equivalent to above.| |labels.color:*|The project has the label `color`.| |labels.color:red|The project's label `color` has the value `red`.| |labels.color:red label.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`. Optional. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ProjectListCall<'a, C, A> { diff --git a/gen/compute1-cli/Cargo.toml b/gen/compute1-cli/Cargo.toml index aae9a82fc8..97feb1a3a6 100644 --- a/gen/compute1-cli/Cargo.toml +++ b/gen/compute1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-compute1-cli" -version = "0.3.1+20150305" +version = "0.3.2+20150713" authors = ["Sebastian Thiel "] description = "A complete library to interact with compute (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/compute1-cli" @@ -17,9 +17,10 @@ keywords = ["compute", "google", "cli"] name = "compute1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/compute1-cli/README.md b/gen/compute1-cli/README.md index 4bfc4e7ec3..865edf8d4a 100644 --- a/gen/compute1-cli/README.md +++ b/gen/compute1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *compute* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/compute1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/compute1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/compute1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/compute1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/compute1-cli). # Usage -This documentation was generated from the *compute* API at revision *20150305*. The CLI is at version *0.3.1*. +This documentation was generated from the *compute* API at revision *20150713*. The CLI is at version *0.3.2*. ```bash compute1 [options] @@ -34,6 +34,14 @@ compute1 [options] get
[-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] + autoscalers + aggregated-list [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] backend-services delete [-p ]... [-o ] get [-p ]... [-o ] @@ -96,6 +104,29 @@ compute1 [options] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] + instance-group-managers + abandon-instances (-r )... [-p ]... [-o ] + aggregated-list [-p ]... [-o ] + delete [-p ]... [-o ] + delete-instances (-r )... [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + list-managed-instances [-p ]... [-o ] + recreate-instances (-r )... [-p ]... [-o ] + resize [-p ]... [-o ] + set-instance-template (-r )... [-p ]... [-o ] + set-target-pools (-r )... [-p ]... [-o ] + instance-groups + add-instances (-r )... [-p ]... [-o ] + aggregated-list [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + list-instances (-r )... [-p ]... [-o ] + remove-instances (-r )... [-p ]... [-o ] + set-named-ports (-r )... [-p ]... [-o ] instance-templates delete [-p ]... [-o ] get [-p ]... [-o ] diff --git a/gen/compute1-cli/mkdocs.yml b/gen/compute1-cli/mkdocs.yml index 764d6c63f6..a9c7ce2310 100644 --- a/gen/compute1-cli/mkdocs.yml +++ b/gen/compute1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: compute v0.3.1+20150305 +site_name: compute v0.3.2+20150713 site_url: http://byron.github.io/google-apis-rs/google-compute1-cli site_description: Write integrating applications with bcore @@ -14,6 +14,13 @@ pages: - ['addresses_get.md', 'Addresses', 'Get'] - ['addresses_insert.md', 'Addresses', 'Insert'] - ['addresses_list.md', 'Addresses', 'List'] +- ['autoscalers_aggregated-list.md', 'Autoscalers', 'Aggregated List'] +- ['autoscalers_delete.md', 'Autoscalers', 'Delete'] +- ['autoscalers_get.md', 'Autoscalers', 'Get'] +- ['autoscalers_insert.md', 'Autoscalers', 'Insert'] +- ['autoscalers_list.md', 'Autoscalers', 'List'] +- ['autoscalers_patch.md', 'Autoscalers', 'Patch'] +- ['autoscalers_update.md', 'Autoscalers', 'Update'] - ['backend-services_delete.md', 'Backend Services', 'Delete'] - ['backend-services_get.md', 'Backend Services', 'Get'] - ['backend-services_get-health.md', 'Backend Services', 'Get Health'] @@ -66,6 +73,27 @@ pages: - ['images_get.md', 'Images', 'Get'] - ['images_insert.md', 'Images', 'Insert'] - ['images_list.md', 'Images', 'List'] +- ['instance-group-managers_abandon-instances.md', 'Instance Group Managers', 'Abandon Instances'] +- ['instance-group-managers_aggregated-list.md', 'Instance Group Managers', 'Aggregated List'] +- ['instance-group-managers_delete.md', 'Instance Group Managers', 'Delete'] +- ['instance-group-managers_delete-instances.md', 'Instance Group Managers', 'Delete Instances'] +- ['instance-group-managers_get.md', 'Instance Group Managers', 'Get'] +- ['instance-group-managers_insert.md', 'Instance Group Managers', 'Insert'] +- ['instance-group-managers_list.md', 'Instance Group Managers', 'List'] +- ['instance-group-managers_list-managed-instances.md', 'Instance Group Managers', 'List Managed Instances'] +- ['instance-group-managers_recreate-instances.md', 'Instance Group Managers', 'Recreate Instances'] +- ['instance-group-managers_resize.md', 'Instance Group Managers', 'Resize'] +- ['instance-group-managers_set-instance-template.md', 'Instance Group Managers', 'Set Instance Template'] +- ['instance-group-managers_set-target-pools.md', 'Instance Group Managers', 'Set Target Pools'] +- ['instance-groups_add-instances.md', 'Instance Groups', 'Add Instances'] +- ['instance-groups_aggregated-list.md', 'Instance Groups', 'Aggregated List'] +- ['instance-groups_delete.md', 'Instance Groups', 'Delete'] +- ['instance-groups_get.md', 'Instance Groups', 'Get'] +- ['instance-groups_insert.md', 'Instance Groups', 'Insert'] +- ['instance-groups_list.md', 'Instance Groups', 'List'] +- ['instance-groups_list-instances.md', 'Instance Groups', 'List Instances'] +- ['instance-groups_remove-instances.md', 'Instance Groups', 'Remove Instances'] +- ['instance-groups_set-named-ports.md', 'Instance Groups', 'Set Named Ports'] - ['instance-templates_delete.md', 'Instance Templates', 'Delete'] - ['instance-templates_get.md', 'Instance Templates', 'Get'] - ['instance-templates_insert.md', 'Instance Templates', 'Insert'] diff --git a/gen/compute1-cli/src/cmn.rs b/gen/compute1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/compute1-cli/src/cmn.rs +++ b/gen/compute1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/compute1-cli/src/main.rs b/gen/compute1-cli/src/main.rs index 411a1af9b2..7d1beb572b 100644 --- a/gen/compute1-cli/src/main.rs +++ b/gen/compute1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -366,6 +367,529 @@ impl<'n, 'a> Engine<'n, 'a> { } } + fn _autoscalers_aggregated_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.autoscalers().aggregated_list(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _autoscalers_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.autoscalers().delete(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("autoscaler").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _autoscalers_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.autoscalers().get(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("autoscaler").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _autoscalers_insert(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "autoscaling-policy.max-num-replicas" => Some(("autoscalingPolicy.maxNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling-policy.cool-down-period-sec" => Some(("autoscalingPolicy.coolDownPeriodSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling-policy.load-balancing-utilization.utilization-target" => Some(("autoscalingPolicy.loadBalancingUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "name", "self-link", "target", "utilization-target", "zone"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Autoscaler = json::value::from_value(object).unwrap(); + let mut call = self.hub.autoscalers().insert(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _autoscalers_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.autoscalers().list(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _autoscalers_patch(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "autoscaling-policy.max-num-replicas" => Some(("autoscalingPolicy.maxNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling-policy.cool-down-period-sec" => Some(("autoscalingPolicy.coolDownPeriodSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling-policy.load-balancing-utilization.utilization-target" => Some(("autoscalingPolicy.loadBalancingUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "name", "self-link", "target", "utilization-target", "zone"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Autoscaler = json::value::from_value(object).unwrap(); + let mut call = self.hub.autoscalers().patch(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("autoscaler").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _autoscalers_update(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "autoscaling-policy.max-num-replicas" => Some(("autoscalingPolicy.maxNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling-policy.cool-down-period-sec" => Some(("autoscalingPolicy.coolDownPeriodSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling-policy.load-balancing-utilization.utilization-target" => Some(("autoscalingPolicy.loadBalancingUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "name", "self-link", "target", "utilization-target", "zone"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Autoscaler = json::value::from_value(object).unwrap(); + let mut call = self.hub.autoscalers().update(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "autoscaler" => { + call = call.autoscaler(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["autoscaler"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _backend_services_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.backend_services().delete(opt.value_of("project").unwrap_or(""), opt.value_of("backend-service").unwrap_or("")); @@ -4012,6 +4536,1540 @@ impl<'n, 'a> Engine<'n, 'a> { } } + fn _instance_group_managers_abandon_instances(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "instances" => Some(("instances", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["instances"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstanceGroupManagersAbandonInstancesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instance_group_managers().abandon_instances(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_group_managers_aggregated_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.instance_group_managers().aggregated_list(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_group_managers_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.instance_group_managers().delete(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_group_managers_delete_instances(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "instances" => Some(("instances", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["instances"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstanceGroupManagersDeleteInstancesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instance_group_managers().delete_instances(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_group_managers_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.instance_group_managers().get(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_group_managers_insert(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "target-size" => Some(("targetSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "instance-group" => Some(("instanceGroup", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "current-actions.none" => Some(("currentActions.none", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "current-actions.recreating" => Some(("currentActions.recreating", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "current-actions.creating" => Some(("currentActions.creating", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "current-actions.restarting" => Some(("currentActions.restarting", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "current-actions.abandoning" => Some(("currentActions.abandoning", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "current-actions.deleting" => Some(("currentActions.deleting", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "current-actions.refreshing" => Some(("currentActions.refreshing", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "target-pools" => Some(("targetPools", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "base-instance-name" => Some(("baseInstanceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "instance-template" => Some(("instanceTemplate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["abandoning", "base-instance-name", "creating", "creation-timestamp", "current-actions", "deleting", "description", "fingerprint", "id", "instance-group", "instance-template", "kind", "name", "none", "recreating", "refreshing", "restarting", "self-link", "target-pools", "target-size", "zone"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstanceGroupManager = json::value::from_value(object).unwrap(); + let mut call = self.hub.instance_group_managers().insert(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_group_managers_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.instance_group_managers().list(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_group_managers_list_managed_instances(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.instance_group_managers().list_managed_instances(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_group_managers_recreate_instances(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "instances" => Some(("instances", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["instances"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstanceGroupManagersRecreateInstancesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instance_group_managers().recreate_instances(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_group_managers_resize(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let size: i32 = arg_from_str(&opt.value_of("size").unwrap_or(""), err, "", "integer"); + let mut call = self.hub.instance_group_managers().resize(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or(""), size); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_group_managers_set_instance_template(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "instance-template" => Some(("instanceTemplate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["instance-template"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstanceGroupManagersSetInstanceTemplateRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instance_group_managers().set_instance_template(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_group_managers_set_target_pools(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "target-pools" => Some(("targetPools", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["fingerprint", "target-pools"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstanceGroupManagersSetTargetPoolsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instance_group_managers().set_target_pools(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_groups_add_instances(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstanceGroupsAddInstancesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instance_groups().add_instances(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_groups_aggregated_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.instance_groups().aggregated_list(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_groups_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.instance_groups().delete(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_groups_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.instance_groups().get(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_groups_insert(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size" => Some(("size", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "fingerprint", "id", "kind", "name", "network", "self-link", "size", "zone"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstanceGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.instance_groups().insert(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_groups_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.instance_groups().list(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_groups_list_instances(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "port-name" => Some(("portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "instance-state" => Some(("instanceState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["instance-state", "port-name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstanceGroupsListInstancesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instance_groups().list_instances(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_groups_remove_instances(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstanceGroupsRemoveInstancesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instance_groups().remove_instances(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_groups_set_named_ports(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["fingerprint"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstanceGroupsSetNamedPortsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instance_groups().set_named_ports(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _instance_templates_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.instance_templates().delete(opt.value_of("project").unwrap_or(""), opt.value_of("instance-template").unwrap_or("")); @@ -9989,6 +12047,35 @@ impl<'n, 'a> Engine<'n, 'a> { } } }, + ("autoscalers", Some(opt)) => { + match opt.subcommand() { + ("aggregated-list", Some(opt)) => { + call_result = self._autoscalers_aggregated_list(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._autoscalers_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._autoscalers_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._autoscalers_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._autoscalers_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._autoscalers_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._autoscalers_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("autoscalers".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("backend-services", Some(opt)) => { match opt.subcommand() { ("delete", Some(opt)) => { @@ -10225,6 +12312,85 @@ impl<'n, 'a> Engine<'n, 'a> { } } }, + ("instance-group-managers", Some(opt)) => { + match opt.subcommand() { + ("abandon-instances", Some(opt)) => { + call_result = self._instance_group_managers_abandon_instances(opt, dry_run, &mut err); + }, + ("aggregated-list", Some(opt)) => { + call_result = self._instance_group_managers_aggregated_list(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._instance_group_managers_delete(opt, dry_run, &mut err); + }, + ("delete-instances", Some(opt)) => { + call_result = self._instance_group_managers_delete_instances(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._instance_group_managers_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._instance_group_managers_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._instance_group_managers_list(opt, dry_run, &mut err); + }, + ("list-managed-instances", Some(opt)) => { + call_result = self._instance_group_managers_list_managed_instances(opt, dry_run, &mut err); + }, + ("recreate-instances", Some(opt)) => { + call_result = self._instance_group_managers_recreate_instances(opt, dry_run, &mut err); + }, + ("resize", Some(opt)) => { + call_result = self._instance_group_managers_resize(opt, dry_run, &mut err); + }, + ("set-instance-template", Some(opt)) => { + call_result = self._instance_group_managers_set_instance_template(opt, dry_run, &mut err); + }, + ("set-target-pools", Some(opt)) => { + call_result = self._instance_group_managers_set_target_pools(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("instance-group-managers".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("instance-groups", Some(opt)) => { + match opt.subcommand() { + ("add-instances", Some(opt)) => { + call_result = self._instance_groups_add_instances(opt, dry_run, &mut err); + }, + ("aggregated-list", Some(opt)) => { + call_result = self._instance_groups_aggregated_list(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._instance_groups_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._instance_groups_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._instance_groups_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._instance_groups_list(opt, dry_run, &mut err); + }, + ("list-instances", Some(opt)) => { + call_result = self._instance_groups_list_instances(opt, dry_run, &mut err); + }, + ("remove-instances", Some(opt)) => { + call_result = self._instance_groups_remove_instances(opt, dry_run, &mut err); + }, + ("set-named-ports", Some(opt)) => { + call_result = self._instance_groups_set_named_ports(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("instance-groups".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("instance-templates", Some(opt)) => { match opt.subcommand() { ("delete", Some(opt)) => { @@ -10873,6 +13039,235 @@ fn main() { ]), ]), + ("autoscalers", "methods: 'aggregated-list', 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("aggregated-list", + Some(r##"Retrieves the list of autoscalers grouped by scope."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/autoscalers_aggregated-list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Name of the project scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes the specified autoscaler resource."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/autoscalers_delete", + vec![ + (Some(r##"project"##), + None, + Some(r##"Name of the project scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"Name of the zone scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"autoscaler"##), + None, + Some(r##"Name of the persistent autoscaler resource to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Returns the specified autoscaler resource."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/autoscalers_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"Name of the project scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"Name of the zone scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"autoscaler"##), + None, + Some(r##"Name of the persistent autoscaler resource to return."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("insert", + Some(r##"Creates an autoscaler resource in the specified project using the data included in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/autoscalers_insert", + vec![ + (Some(r##"project"##), + None, + Some(r##"Name of the project scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"Name of the zone scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Retrieves the list of autoscaler resources contained within the specified zone."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/autoscalers_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Name of the project scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"Name of the zone scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Updates an autoscaler resource in the specified project using the data included in the request. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/autoscalers_patch", + vec![ + (Some(r##"project"##), + None, + Some(r##"Name of the project scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"Name of the zone scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"autoscaler"##), + None, + Some(r##"Name of the autoscaler resource to update."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update", + Some(r##"Updates an autoscaler resource in the specified project using the data included in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/autoscalers_update", + vec![ + (Some(r##"project"##), + None, + Some(r##"Name of the project scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"Name of the zone scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("backend-services", "methods: 'delete', 'get', 'get-health', 'insert', 'list', 'patch' and 'update'", vec![ ("delete", Some(r##"Deletes the specified BackendService resource."##), @@ -11235,7 +13630,7 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes the specified persistent disk."##), + Some(r##"Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/disks_delete", vec![ (Some(r##"project"##), @@ -12014,7 +14409,7 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes the specified operation resource."##), + Some(r##"Deletes the specified Operations resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-operations_delete", vec![ (Some(r##"project"##), @@ -12025,7 +14420,7 @@ fn main() { (Some(r##"operation"##), None, - Some(r##"Name of the operation resource to delete."##), + Some(r##"Name of the Operations resource to delete."##), Some(true), Some(false)), @@ -12036,7 +14431,7 @@ fn main() { Some(true)), ]), ("get", - Some(r##"Retrieves the specified operation resource."##), + Some(r##"Retrieves the specified Operations resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-operations_get", vec![ (Some(r##"project"##), @@ -12047,7 +14442,7 @@ fn main() { (Some(r##"operation"##), None, - Some(r##"Name of the operation resource to return."##), + Some(r##"Name of the Operations resource to return."##), Some(true), Some(false)), @@ -12064,7 +14459,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Retrieves the list of operation resources contained within the specified project."##), + Some(r##"Retrieves the list of Operation resources contained within the specified project."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-operations_list", vec![ (Some(r##"project"##), @@ -12409,6 +14804,750 @@ fn main() { ]), ]), + ("instance-group-managers", "methods: 'abandon-instances', 'aggregated-list', 'delete', 'delete-instances', 'get', 'insert', 'list', 'list-managed-instances', 'recreate-instances', 'resize', 'set-instance-template' and 'set-target-pools'", vec![ + ("abandon-instances", + Some(r##"Removes the specified instances from the managed instance group, and from any target pools where they are a member. The instances are not deleted. The managed instance group automatically reduces its targetSize value by the number of instances that you abandon from the group."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_abandon-instances", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the managed instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the instance group manager."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("aggregated-list", + Some(r##"Retrieves the list of managed instance groups, and groups them by project and zone."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_aggregated-list", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes the specified managed instance group resource."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_delete", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the managed instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the instance group manager to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete-instances", + Some(r##"Deletes the specified instances. The instances are deleted and removed from the instance group and any target pools where they are a member. The managed instance group automatically reduces its targetSize value by the number of instances that you delete."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_delete-instances", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the managed instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the instance group manager."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Returns the specified managed instance group resource."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the managed instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the instance group manager resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("insert", + Some(r##"Creates a managed instance group resource in the specified project using the data that is included in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_insert", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the managed instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Retrieves a list of managed instance groups that are contained within the specified project and zone."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the managed instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list-managed-instances", + Some(r##"Lists managed instances."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_list-managed-instances", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the managed instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the managed instance group."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("recreate-instances", + Some(r##"Recreates the specified instances. The instances are deleted, then recreated using the managed instance group's current instance template."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_recreate-instances", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the managed instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the instance group manager."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("resize", + Some(r##"Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group removes instances in the order that is outlined in Resizing a managed instance group."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_resize", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the managed instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the instance group manager."##), + Some(true), + Some(false)), + + (Some(r##"size"##), + None, + Some(r##"The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("set-instance-template", + Some(r##"Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_set-instance-template", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the managed instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the instance group manager."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("set-target-pools", + Some(r##"Modifies the target pools to which all new instances in this group are assigned. The target pools for existing instances in the group do not change unless you recreate them."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_set-target-pools", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the managed instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the instance group manager."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("instance-groups", "methods: 'add-instances', 'aggregated-list', 'delete', 'get', 'insert', 'list', 'list-instances', 'remove-instances' and 'set-named-ports'", vec![ + ("add-instances", + Some(r##"Adds a list of instances to an instance group. All of the instances in the instance group must be in the same network."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-groups_add-instances", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group"##), + None, + Some(r##"The name of the instance group where you are adding instances."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("aggregated-list", + Some(r##"Retrieves the list of instance groups, and sorts them by zone."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-groups_aggregated-list", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes the specified instance group."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-groups_delete", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group"##), + None, + Some(r##"The name of the instance group to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Returns the specified instance group resource."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-groups_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group"##), + None, + Some(r##"The name of the instance group."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("insert", + Some(r##"Creates an instance group in the specified project using the parameters that are included in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-groups_insert", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Retrieves the list of instance groups that are located in the specified project and zone."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-groups_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list-instances", + Some(r##"Lists instances in an instance group. The parameters for this method specify whether the list filters instances by state and named ports information."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-groups_list-instances", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group"##), + None, + Some(r##"The name of the instance group from which you want to generate a list of included instances."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("remove-instances", + Some(r##"Removes a list of instances from an instance group."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-groups_remove-instances", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group"##), + None, + Some(r##"The name of the instance group where the specified instances will be removed."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("set-named-ports", + Some(r##"Sets the named ports in an instance group."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-groups_set-named-ports", + vec![ + (Some(r##"project"##), + None, + Some(r##"The project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The URL of the zone where the instance group is located."##), + Some(true), + Some(false)), + + (Some(r##"instance-group"##), + None, + Some(r##"The name of the instance group where the named ports are updated."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("instance-templates", "methods: 'delete', 'get', 'insert' and 'list'", vec![ ("delete", Some(r##"Deletes the specified instance template."##), @@ -13513,7 +16652,7 @@ fn main() { ("region-operations", "methods: 'delete', 'get' and 'list'", vec![ ("delete", - Some(r##"Deletes the specified region-specific operation resource."##), + Some(r##"Deletes the specified region-specific Operations resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-operations_delete", vec![ (Some(r##"project"##), @@ -13530,7 +16669,7 @@ fn main() { (Some(r##"operation"##), None, - Some(r##"Name of the operation resource to delete."##), + Some(r##"Name of the Operations resource to delete."##), Some(true), Some(false)), @@ -13541,7 +16680,7 @@ fn main() { Some(true)), ]), ("get", - Some(r##"Retrieves the specified region-specific operation resource."##), + Some(r##"Retrieves the specified region-specific Operations resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-operations_get", vec![ (Some(r##"project"##), @@ -13558,7 +16697,7 @@ fn main() { (Some(r##"operation"##), None, - Some(r##"Name of the operation resource to return."##), + Some(r##"Name of the Operations resource to return."##), Some(true), Some(false)), @@ -13575,7 +16714,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Retrieves the list of operation resources contained within the specified region."##), + Some(r##"Retrieves the list of Operation resources contained within the specified region."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-operations_list", vec![ (Some(r##"project"##), @@ -13768,7 +16907,9 @@ fn main() { ("snapshots", "methods: 'delete', 'get' and 'list'", vec![ ("delete", - Some(r##"Deletes the specified persistent disk snapshot resource."##), + Some(r##"Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. + + For more information, see Deleting snaphots."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/snapshots_delete", vec![ (Some(r##"project"##), @@ -13779,7 +16920,7 @@ fn main() { (Some(r##"snapshot"##), None, - Some(r##"Name of the persistent disk snapshot resource to delete."##), + Some(r##"Name of the Snapshot resource to delete."##), Some(true), Some(false)), @@ -13796,7 +16937,7 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Returns the specified persistent disk snapshot resource."##), + Some(r##"Returns the specified Snapshot resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/snapshots_get", vec![ (Some(r##"project"##), @@ -13807,7 +16948,7 @@ fn main() { (Some(r##"snapshot"##), None, - Some(r##"Name of the persistent disk snapshot resource to return."##), + Some(r##"Name of the Snapshot resource to return."##), Some(true), Some(false)), @@ -13824,7 +16965,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Retrieves the list of persistent disk snapshot resources contained within the specified project."##), + Some(r##"Retrieves the list of Snapshot resources contained within the specified project."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/snapshots_list", vec![ (Some(r##"project"##), @@ -15063,7 +18204,7 @@ fn main() { ("zone-operations", "methods: 'delete', 'get' and 'list'", vec![ ("delete", - Some(r##"Deletes the specified zone-specific operation resource."##), + Some(r##"Deletes the specified zone-specific Operations resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/zone-operations_delete", vec![ (Some(r##"project"##), @@ -15080,7 +18221,7 @@ fn main() { (Some(r##"operation"##), None, - Some(r##"Name of the operation resource to delete."##), + Some(r##"Name of the Operations resource to delete."##), Some(true), Some(false)), @@ -15091,7 +18232,7 @@ fn main() { Some(true)), ]), ("get", - Some(r##"Retrieves the specified zone-specific operation resource."##), + Some(r##"Retrieves the specified zone-specific Operations resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/zone-operations_get", vec![ (Some(r##"project"##), @@ -15108,7 +18249,7 @@ fn main() { (Some(r##"operation"##), None, - Some(r##"Name of the operation resource to return."##), + Some(r##"Name of the Operations resource to return."##), Some(true), Some(false)), @@ -15125,7 +18266,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Retrieves the list of operation resources contained within the specified zone."##), + Some(r##"Retrieves the list of Operation resources contained within the specified zone."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/zone-operations_list", vec![ (Some(r##"project"##), @@ -15211,7 +18352,7 @@ fn main() { let mut app = App::new("compute1") .author("Sebastian Thiel ") - .version("0.3.1+20150305") + .version("0.3.2+20150713") .about("API for the Google Compute Engine service.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_compute1_cli") .arg(Arg::with_name("url") @@ -15293,7 +18434,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/compute1/Cargo.toml b/gen/compute1/Cargo.toml index 5f9d9158c4..d02bcb33e3 100644 --- a/gen/compute1/Cargo.toml +++ b/gen/compute1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-compute1" -version = "0.1.8+20150305" +version = "0.1.9+20150713" authors = ["Sebastian Thiel "] description = "A complete library to interact with compute (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/compute1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/compute1/README.md b/gen/compute1/README.md index cdcfac87ce..c20f451ecc 100644 --- a/gen/compute1/README.md +++ b/gen/compute1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-compute1` library allows access to all features of the *Google compute* service. -This documentation was generated from *compute* crate version *0.1.8+20150305*, where *20150305* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *compute* crate version *0.1.9+20150713*, where *20150713* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *compute* *v1* API can be found at the [official documentation site](https://developers.google.com/compute/docs/reference/latest/). @@ -15,6 +15,8 @@ Handle the following *Resources* with ease from the central [hub](http://byron.g * addresses * [*aggregated list*](http://byron.github.io/google-apis-rs/google_compute1/struct.AddresseAggregatedListCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_compute1/struct.AddresseDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_compute1/struct.AddresseGetCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_compute1/struct.AddresseInsertCall.html) and [*list*](http://byron.github.io/google-apis-rs/google_compute1/struct.AddresseListCall.html) +* [autoscalers](http://byron.github.io/google-apis-rs/google_compute1/struct.Autoscaler.html) + * [*aggregated list*](http://byron.github.io/google-apis-rs/google_compute1/struct.AutoscalerAggregatedListCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_compute1/struct.AutoscalerDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_compute1/struct.AutoscalerGetCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_compute1/struct.AutoscalerInsertCall.html), [*list*](http://byron.github.io/google-apis-rs/google_compute1/struct.AutoscalerListCall.html), [*patch*](http://byron.github.io/google-apis-rs/google_compute1/struct.AutoscalerPatchCall.html) and [*update*](http://byron.github.io/google-apis-rs/google_compute1/struct.AutoscalerUpdateCall.html) * [backend services](http://byron.github.io/google-apis-rs/google_compute1/struct.BackendService.html) * [*delete*](http://byron.github.io/google-apis-rs/google_compute1/struct.BackendServiceDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_compute1/struct.BackendServiceGetCall.html), [*get health*](http://byron.github.io/google-apis-rs/google_compute1/struct.BackendServiceGetHealthCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_compute1/struct.BackendServiceInsertCall.html), [*list*](http://byron.github.io/google-apis-rs/google_compute1/struct.BackendServiceListCall.html), [*patch*](http://byron.github.io/google-apis-rs/google_compute1/struct.BackendServicePatchCall.html) and [*update*](http://byron.github.io/google-apis-rs/google_compute1/struct.BackendServiceUpdateCall.html) * [disk types](http://byron.github.io/google-apis-rs/google_compute1/struct.DiskType.html) @@ -35,6 +37,10 @@ Handle the following *Resources* with ease from the central [hub](http://byron.g * [*delete*](http://byron.github.io/google-apis-rs/google_compute1/struct.HttpHealthCheckDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_compute1/struct.HttpHealthCheckGetCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_compute1/struct.HttpHealthCheckInsertCall.html), [*list*](http://byron.github.io/google-apis-rs/google_compute1/struct.HttpHealthCheckListCall.html), [*patch*](http://byron.github.io/google-apis-rs/google_compute1/struct.HttpHealthCheckPatchCall.html) and [*update*](http://byron.github.io/google-apis-rs/google_compute1/struct.HttpHealthCheckUpdateCall.html) * [images](http://byron.github.io/google-apis-rs/google_compute1/struct.Image.html) * [*delete*](http://byron.github.io/google-apis-rs/google_compute1/struct.ImageDeleteCall.html), [*deprecate*](http://byron.github.io/google-apis-rs/google_compute1/struct.ImageDeprecateCall.html), [*get*](http://byron.github.io/google-apis-rs/google_compute1/struct.ImageGetCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_compute1/struct.ImageInsertCall.html) and [*list*](http://byron.github.io/google-apis-rs/google_compute1/struct.ImageListCall.html) +* [instance group managers](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupManager.html) + * [*abandon instances*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupManagerAbandonInstanceCall.html), [*aggregated list*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupManagerAggregatedListCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupManagerDeleteCall.html), [*delete instances*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupManagerDeleteInstanceCall.html), [*get*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupManagerGetCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupManagerInsertCall.html), [*list*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupManagerListCall.html), [*list managed instances*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupManagerListManagedInstanceCall.html), [*recreate instances*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupManagerRecreateInstanceCall.html), [*resize*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupManagerResizeCall.html), [*set instance template*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupManagerSetInstanceTemplateCall.html) and [*set target pools*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupManagerSetTargetPoolCall.html) +* [instance groups](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroup.html) + * [*add instances*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupAddInstanceCall.html), [*aggregated list*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupAggregatedListCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupGetCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupInsertCall.html), [*list*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupListCall.html), [*list instances*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupListInstanceCall.html), [*remove instances*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupRemoveInstanceCall.html) and [*set named ports*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceGroupSetNamedPortCall.html) * [instance templates](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceTemplate.html) * [*delete*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceTemplateDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceTemplateGetCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceTemplateInsertCall.html) and [*list*](http://byron.github.io/google-apis-rs/google_compute1/struct.InstanceTemplateListCall.html) * [instances](http://byron.github.io/google-apis-rs/google_compute1/struct.Instance.html) @@ -103,81 +109,98 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.target_instances().delete(...).doit() -let r = hub.instances().stop(...).doit() -let r = hub.target_pools().add_instance(...).doit() -let r = hub.target_pools().add_health_check(...).doit() -let r = hub.target_pools().remove_health_check(...).doit() -let r = hub.backend_services().update(...).doit() -let r = hub.target_pools().delete(...).doit() -let r = hub.firewalls().update(...).doit() -let r = hub.networks().insert(...).doit() -let r = hub.addresses().insert(...).doit() -let r = hub.backend_services().patch(...).doit() -let r = hub.instances().set_tags(...).doit() -let r = hub.instances().set_disk_auto_delete(...).doit() -let r = hub.target_http_proxies().insert(...).doit() -let r = hub.projects().set_usage_export_bucket(...).doit() -let r = hub.url_maps().update(...).doit() -let r = hub.instance_templates().insert(...).doit() +let r = hub.instance_group_managers().resize(...).doit() +let r = hub.autoscalers().patch(...).doit() let r = hub.firewalls().patch(...).doit() let r = hub.vpn_tunnels().delete(...).doit() -let r = hub.firewalls().delete(...).doit() -let r = hub.instances().detach_disk(...).doit() -let r = hub.instances().delete_access_config(...).doit() -let r = hub.backend_services().delete(...).doit() let r = hub.instances().insert(...).doit() +let r = hub.global_forwarding_rules().delete(...).doit() +let r = hub.vpn_tunnels().insert(...).doit() +let r = hub.disks().delete(...).doit() +let r = hub.instance_groups().add_instances(...).doit() +let r = hub.target_http_proxies().delete(...).doit() +let r = hub.instances().set_scheduling(...).doit() +let r = hub.instances().delete(...).doit() +let r = hub.target_pools().add_health_check(...).doit() +let r = hub.instance_group_managers().insert(...).doit() +let r = hub.global_addresses().insert(...).doit() let r = hub.global_forwarding_rules().set_target(...).doit() +let r = hub.autoscalers().insert(...).doit() +let r = hub.instance_groups().insert(...).doit() +let r = hub.instance_group_managers().delete_instances(...).doit() +let r = hub.instance_group_managers().set_instance_template(...).doit() +let r = hub.target_pools().insert(...).doit() +let r = hub.instances().set_disk_auto_delete(...).doit() +let r = hub.instance_group_managers().set_target_pools(...).doit() +let r = hub.disks().insert(...).doit() +let r = hub.target_pools().remove_health_check(...).doit() +let r = hub.backend_services().delete(...).doit() let r = hub.url_maps().insert(...).doit() let r = hub.instances().add_access_config(...).doit() -let r = hub.target_vpn_gateways().delete(...).doit() -let r = hub.region_operations().get(...).doit() -let r = hub.backend_services().insert(...).doit() -let r = hub.global_operations().get(...).doit() -let r = hub.disks().insert(...).doit() -let r = hub.instance_templates().delete(...).doit() -let r = hub.global_forwarding_rules().delete(...).doit() +let r = hub.addresses().insert(...).doit() let r = hub.global_forwarding_rules().insert(...).doit() -let r = hub.disks().delete(...).doit() -let r = hub.global_addresses().delete(...).doit() -let r = hub.projects().set_common_instance_metadata(...).doit() -let r = hub.target_pools().insert(...).doit() -let r = hub.target_http_proxies().delete(...).doit() -let r = hub.networks().delete(...).doit() -let r = hub.target_vpn_gateways().insert(...).doit() -let r = hub.url_maps().delete(...).doit() -let r = hub.instances().set_scheduling(...).doit() -let r = hub.instances().attach_disk(...).doit() +let r = hub.global_operations().get(...).doit() let r = hub.addresses().delete(...).doit() -let r = hub.instances().reset(...).doit() -let r = hub.target_http_proxies().set_url_map(...).doit() +let r = hub.target_vpn_gateways().insert(...).doit() let r = hub.disks().create_snapshot(...).doit() -let r = hub.routes().insert(...).doit() -let r = hub.global_addresses().insert(...).doit() -let r = hub.images().deprecate(...).doit() -let r = hub.http_health_checks().patch(...).doit() -let r = hub.http_health_checks().delete(...).doit() +let r = hub.instance_groups().remove_instances(...).doit() let r = hub.instances().set_metadata(...).doit() -let r = hub.http_health_checks().insert(...).doit() -let r = hub.images().delete(...).doit() -let r = hub.snapshots().delete(...).doit() let r = hub.forwarding_rules().insert(...).doit() -let r = hub.images().insert(...).doit() let r = hub.instances().start(...).doit() -let r = hub.target_pools().set_backup(...).doit() +let r = hub.instance_group_managers().delete(...).doit() let r = hub.target_instances().insert(...).doit() -let r = hub.forwarding_rules().delete(...).doit() -let r = hub.projects().move_instance(...).doit() let r = hub.forwarding_rules().set_target(...).doit() let r = hub.projects().move_disk(...).doit() -let r = hub.vpn_tunnels().insert(...).doit() let r = hub.firewalls().insert(...).doit() +let r = hub.target_pools().set_backup(...).doit() +let r = hub.routes().insert(...).doit() +let r = hub.instance_groups().delete(...).doit() +let r = hub.instances().delete_access_config(...).doit() +let r = hub.networks().insert(...).doit() +let r = hub.instance_group_managers().abandon_instances(...).doit() +let r = hub.instances().set_tags(...).doit() +let r = hub.snapshots().delete(...).doit() +let r = hub.instances().detach_disk(...).doit() +let r = hub.backend_services().update(...).doit() +let r = hub.instance_group_managers().recreate_instances(...).doit() +let r = hub.images().delete(...).doit() +let r = hub.projects().set_common_instance_metadata(...).doit() +let r = hub.region_operations().get(...).doit() +let r = hub.backend_services().patch(...).doit() +let r = hub.target_http_proxies().set_url_map(...).doit() +let r = hub.images().deprecate(...).doit() +let r = hub.http_health_checks().patch(...).doit() +let r = hub.images().insert(...).doit() +let r = hub.instance_groups().set_named_ports(...).doit() +let r = hub.projects().move_instance(...).doit() +let r = hub.autoscalers().delete(...).doit() +let r = hub.url_maps().patch(...).doit() +let r = hub.instances().stop(...).doit() +let r = hub.target_pools().add_instance(...).doit() let r = hub.target_pools().remove_instance(...).doit() -let r = hub.instances().delete(...).doit() +let r = hub.target_pools().delete(...).doit() +let r = hub.firewalls().update(...).doit() +let r = hub.instance_templates().delete(...).doit() +let r = hub.projects().set_usage_export_bucket(...).doit() +let r = hub.target_http_proxies().insert(...).doit() +let r = hub.networks().delete(...).doit() +let r = hub.instance_templates().insert(...).doit() +let r = hub.target_instances().delete(...).doit() +let r = hub.target_vpn_gateways().delete(...).doit() +let r = hub.global_addresses().delete(...).doit() +let r = hub.url_maps().update(...).doit() +let r = hub.url_maps().delete(...).doit() +let r = hub.instances().reset(...).doit() +let r = hub.backend_services().insert(...).doit() +let r = hub.http_health_checks().delete(...).doit() +let r = hub.http_health_checks().insert(...).doit() +let r = hub.instances().attach_disk(...).doit() +let r = hub.autoscalers().update(...).doit() +let r = hub.forwarding_rules().delete(...).doit() +let r = hub.firewalls().delete(...).doit() let r = hub.zone_operations().get(...).doit() let r = hub.http_health_checks().update(...).doit() let r = hub.routes().delete(...).doit() -let r = hub.url_maps().patch(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` diff --git a/gen/compute1/src/cmn.rs b/gen/compute1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/compute1/src/cmn.rs +++ b/gen/compute1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/compute1/src/lib.rs b/gen/compute1/src/lib.rs index af39ff3ede..ebba35e9f7 100644 --- a/gen/compute1/src/lib.rs +++ b/gen/compute1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *compute* crate version *0.1.8+20150305*, where *20150305* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *compute* crate version *0.1.9+20150713*, where *20150713* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *compute* *v1* API can be found at the //! [official documentation site](https://developers.google.com/compute/docs/reference/latest/). @@ -13,6 +13,8 @@ //! //! * addresses //! * [*aggregated list*](struct.AddresseAggregatedListCall.html), [*delete*](struct.AddresseDeleteCall.html), [*get*](struct.AddresseGetCall.html), [*insert*](struct.AddresseInsertCall.html) and [*list*](struct.AddresseListCall.html) +//! * [autoscalers](struct.Autoscaler.html) +//! * [*aggregated list*](struct.AutoscalerAggregatedListCall.html), [*delete*](struct.AutoscalerDeleteCall.html), [*get*](struct.AutoscalerGetCall.html), [*insert*](struct.AutoscalerInsertCall.html), [*list*](struct.AutoscalerListCall.html), [*patch*](struct.AutoscalerPatchCall.html) and [*update*](struct.AutoscalerUpdateCall.html) //! * [backend services](struct.BackendService.html) //! * [*delete*](struct.BackendServiceDeleteCall.html), [*get*](struct.BackendServiceGetCall.html), [*get health*](struct.BackendServiceGetHealthCall.html), [*insert*](struct.BackendServiceInsertCall.html), [*list*](struct.BackendServiceListCall.html), [*patch*](struct.BackendServicePatchCall.html) and [*update*](struct.BackendServiceUpdateCall.html) //! * [disk types](struct.DiskType.html) @@ -33,6 +35,10 @@ //! * [*delete*](struct.HttpHealthCheckDeleteCall.html), [*get*](struct.HttpHealthCheckGetCall.html), [*insert*](struct.HttpHealthCheckInsertCall.html), [*list*](struct.HttpHealthCheckListCall.html), [*patch*](struct.HttpHealthCheckPatchCall.html) and [*update*](struct.HttpHealthCheckUpdateCall.html) //! * [images](struct.Image.html) //! * [*delete*](struct.ImageDeleteCall.html), [*deprecate*](struct.ImageDeprecateCall.html), [*get*](struct.ImageGetCall.html), [*insert*](struct.ImageInsertCall.html) and [*list*](struct.ImageListCall.html) +//! * [instance group managers](struct.InstanceGroupManager.html) +//! * [*abandon instances*](struct.InstanceGroupManagerAbandonInstanceCall.html), [*aggregated list*](struct.InstanceGroupManagerAggregatedListCall.html), [*delete*](struct.InstanceGroupManagerDeleteCall.html), [*delete instances*](struct.InstanceGroupManagerDeleteInstanceCall.html), [*get*](struct.InstanceGroupManagerGetCall.html), [*insert*](struct.InstanceGroupManagerInsertCall.html), [*list*](struct.InstanceGroupManagerListCall.html), [*list managed instances*](struct.InstanceGroupManagerListManagedInstanceCall.html), [*recreate instances*](struct.InstanceGroupManagerRecreateInstanceCall.html), [*resize*](struct.InstanceGroupManagerResizeCall.html), [*set instance template*](struct.InstanceGroupManagerSetInstanceTemplateCall.html) and [*set target pools*](struct.InstanceGroupManagerSetTargetPoolCall.html) +//! * [instance groups](struct.InstanceGroup.html) +//! * [*add instances*](struct.InstanceGroupAddInstanceCall.html), [*aggregated list*](struct.InstanceGroupAggregatedListCall.html), [*delete*](struct.InstanceGroupDeleteCall.html), [*get*](struct.InstanceGroupGetCall.html), [*insert*](struct.InstanceGroupInsertCall.html), [*list*](struct.InstanceGroupListCall.html), [*list instances*](struct.InstanceGroupListInstanceCall.html), [*remove instances*](struct.InstanceGroupRemoveInstanceCall.html) and [*set named ports*](struct.InstanceGroupSetNamedPortCall.html) //! * [instance templates](struct.InstanceTemplate.html) //! * [*delete*](struct.InstanceTemplateDeleteCall.html), [*get*](struct.InstanceTemplateGetCall.html), [*insert*](struct.InstanceTemplateInsertCall.html) and [*list*](struct.InstanceTemplateListCall.html) //! * [instances](struct.Instance.html) @@ -103,81 +109,98 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.target_instances().delete(...).doit() -//! let r = hub.instances().stop(...).doit() -//! let r = hub.target_pools().add_instance(...).doit() -//! let r = hub.target_pools().add_health_check(...).doit() -//! let r = hub.target_pools().remove_health_check(...).doit() -//! let r = hub.backend_services().update(...).doit() -//! let r = hub.target_pools().delete(...).doit() -//! let r = hub.firewalls().update(...).doit() -//! let r = hub.networks().insert(...).doit() -//! let r = hub.addresses().insert(...).doit() -//! let r = hub.backend_services().patch(...).doit() -//! let r = hub.instances().set_tags(...).doit() -//! let r = hub.instances().set_disk_auto_delete(...).doit() -//! let r = hub.target_http_proxies().insert(...).doit() -//! let r = hub.projects().set_usage_export_bucket(...).doit() -//! let r = hub.url_maps().update(...).doit() -//! let r = hub.instance_templates().insert(...).doit() +//! let r = hub.instance_group_managers().resize(...).doit() +//! let r = hub.autoscalers().patch(...).doit() //! let r = hub.firewalls().patch(...).doit() //! let r = hub.vpn_tunnels().delete(...).doit() -//! let r = hub.firewalls().delete(...).doit() -//! let r = hub.instances().detach_disk(...).doit() -//! let r = hub.instances().delete_access_config(...).doit() -//! let r = hub.backend_services().delete(...).doit() //! let r = hub.instances().insert(...).doit() +//! let r = hub.global_forwarding_rules().delete(...).doit() +//! let r = hub.vpn_tunnels().insert(...).doit() +//! let r = hub.disks().delete(...).doit() +//! let r = hub.instance_groups().add_instances(...).doit() +//! let r = hub.target_http_proxies().delete(...).doit() +//! let r = hub.instances().set_scheduling(...).doit() +//! let r = hub.instances().delete(...).doit() +//! let r = hub.target_pools().add_health_check(...).doit() +//! let r = hub.instance_group_managers().insert(...).doit() +//! let r = hub.global_addresses().insert(...).doit() //! let r = hub.global_forwarding_rules().set_target(...).doit() +//! let r = hub.autoscalers().insert(...).doit() +//! let r = hub.instance_groups().insert(...).doit() +//! let r = hub.instance_group_managers().delete_instances(...).doit() +//! let r = hub.instance_group_managers().set_instance_template(...).doit() +//! let r = hub.target_pools().insert(...).doit() +//! let r = hub.instances().set_disk_auto_delete(...).doit() +//! let r = hub.instance_group_managers().set_target_pools(...).doit() +//! let r = hub.disks().insert(...).doit() +//! let r = hub.target_pools().remove_health_check(...).doit() +//! let r = hub.backend_services().delete(...).doit() //! let r = hub.url_maps().insert(...).doit() //! let r = hub.instances().add_access_config(...).doit() -//! let r = hub.target_vpn_gateways().delete(...).doit() -//! let r = hub.region_operations().get(...).doit() -//! let r = hub.backend_services().insert(...).doit() -//! let r = hub.global_operations().get(...).doit() -//! let r = hub.disks().insert(...).doit() -//! let r = hub.instance_templates().delete(...).doit() -//! let r = hub.global_forwarding_rules().delete(...).doit() +//! let r = hub.addresses().insert(...).doit() //! let r = hub.global_forwarding_rules().insert(...).doit() -//! let r = hub.disks().delete(...).doit() -//! let r = hub.global_addresses().delete(...).doit() -//! let r = hub.projects().set_common_instance_metadata(...).doit() -//! let r = hub.target_pools().insert(...).doit() -//! let r = hub.target_http_proxies().delete(...).doit() -//! let r = hub.networks().delete(...).doit() -//! let r = hub.target_vpn_gateways().insert(...).doit() -//! let r = hub.url_maps().delete(...).doit() -//! let r = hub.instances().set_scheduling(...).doit() -//! let r = hub.instances().attach_disk(...).doit() +//! let r = hub.global_operations().get(...).doit() //! let r = hub.addresses().delete(...).doit() -//! let r = hub.instances().reset(...).doit() -//! let r = hub.target_http_proxies().set_url_map(...).doit() +//! let r = hub.target_vpn_gateways().insert(...).doit() //! let r = hub.disks().create_snapshot(...).doit() -//! let r = hub.routes().insert(...).doit() -//! let r = hub.global_addresses().insert(...).doit() -//! let r = hub.images().deprecate(...).doit() -//! let r = hub.http_health_checks().patch(...).doit() -//! let r = hub.http_health_checks().delete(...).doit() +//! let r = hub.instance_groups().remove_instances(...).doit() //! let r = hub.instances().set_metadata(...).doit() -//! let r = hub.http_health_checks().insert(...).doit() -//! let r = hub.images().delete(...).doit() -//! let r = hub.snapshots().delete(...).doit() //! let r = hub.forwarding_rules().insert(...).doit() -//! let r = hub.images().insert(...).doit() //! let r = hub.instances().start(...).doit() -//! let r = hub.target_pools().set_backup(...).doit() +//! let r = hub.instance_group_managers().delete(...).doit() //! let r = hub.target_instances().insert(...).doit() -//! let r = hub.forwarding_rules().delete(...).doit() -//! let r = hub.projects().move_instance(...).doit() //! let r = hub.forwarding_rules().set_target(...).doit() //! let r = hub.projects().move_disk(...).doit() -//! let r = hub.vpn_tunnels().insert(...).doit() //! let r = hub.firewalls().insert(...).doit() +//! let r = hub.target_pools().set_backup(...).doit() +//! let r = hub.routes().insert(...).doit() +//! let r = hub.instance_groups().delete(...).doit() +//! let r = hub.instances().delete_access_config(...).doit() +//! let r = hub.networks().insert(...).doit() +//! let r = hub.instance_group_managers().abandon_instances(...).doit() +//! let r = hub.instances().set_tags(...).doit() +//! let r = hub.snapshots().delete(...).doit() +//! let r = hub.instances().detach_disk(...).doit() +//! let r = hub.backend_services().update(...).doit() +//! let r = hub.instance_group_managers().recreate_instances(...).doit() +//! let r = hub.images().delete(...).doit() +//! let r = hub.projects().set_common_instance_metadata(...).doit() +//! let r = hub.region_operations().get(...).doit() +//! let r = hub.backend_services().patch(...).doit() +//! let r = hub.target_http_proxies().set_url_map(...).doit() +//! let r = hub.images().deprecate(...).doit() +//! let r = hub.http_health_checks().patch(...).doit() +//! let r = hub.images().insert(...).doit() +//! let r = hub.instance_groups().set_named_ports(...).doit() +//! let r = hub.projects().move_instance(...).doit() +//! let r = hub.autoscalers().delete(...).doit() +//! let r = hub.url_maps().patch(...).doit() +//! let r = hub.instances().stop(...).doit() +//! let r = hub.target_pools().add_instance(...).doit() //! let r = hub.target_pools().remove_instance(...).doit() -//! let r = hub.instances().delete(...).doit() +//! let r = hub.target_pools().delete(...).doit() +//! let r = hub.firewalls().update(...).doit() +//! let r = hub.instance_templates().delete(...).doit() +//! let r = hub.projects().set_usage_export_bucket(...).doit() +//! let r = hub.target_http_proxies().insert(...).doit() +//! let r = hub.networks().delete(...).doit() +//! let r = hub.instance_templates().insert(...).doit() +//! let r = hub.target_instances().delete(...).doit() +//! let r = hub.target_vpn_gateways().delete(...).doit() +//! let r = hub.global_addresses().delete(...).doit() +//! let r = hub.url_maps().update(...).doit() +//! let r = hub.url_maps().delete(...).doit() +//! let r = hub.instances().reset(...).doit() +//! let r = hub.backend_services().insert(...).doit() +//! let r = hub.http_health_checks().delete(...).doit() +//! let r = hub.http_health_checks().insert(...).doit() +//! let r = hub.instances().attach_disk(...).doit() +//! let r = hub.autoscalers().update(...).doit() +//! let r = hub.forwarding_rules().delete(...).doit() +//! let r = hub.firewalls().delete(...).doit() //! let r = hub.zone_operations().get(...).doit() //! let r = hub.http_health_checks().update(...).doit() //! let r = hub.routes().delete(...).doit() -//! let r = hub.url_maps().patch(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -223,7 +246,7 @@ //! // 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.instances().set_disk_auto_delete("project", "zone", "instance", true, "deviceName") +//! let result = hub.instances().set_disk_auto_delete("project", "zone", "instance", false, "deviceName") //! .doit(); //! //! match result { diff --git a/gen/compute1/src/lib.rs.in b/gen/compute1/src/lib.rs.in index 6350cb0573..c556c86afd 100644 --- a/gen/compute1/src/lib.rs.in +++ b/gen/compute1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -145,13 +146,16 @@ impl<'a, C, A> Compute Compute { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } pub fn addresses(&'a self) -> AddresseMethods<'a, C, A> { AddresseMethods { hub: &self } } + pub fn autoscalers(&'a self) -> AutoscalerMethods<'a, C, A> { + AutoscalerMethods { hub: &self } + } pub fn backend_services(&'a self) -> BackendServiceMethods<'a, C, A> { BackendServiceMethods { hub: &self } } @@ -182,6 +186,12 @@ impl<'a, C, A> Compute pub fn images(&'a self) -> ImageMethods<'a, C, A> { ImageMethods { hub: &self } } + pub fn instance_group_managers(&'a self) -> InstanceGroupManagerMethods<'a, C, A> { + InstanceGroupManagerMethods { hub: &self } + } + pub fn instance_groups(&'a self) -> InstanceGroupMethods<'a, C, A> { + InstanceGroupMethods { hub: &self } + } pub fn instance_templates(&'a self) -> InstanceTemplateMethods<'a, C, A> { InstanceTemplateMethods { hub: &self } } @@ -238,7 +248,7 @@ impl<'a, C, A> Compute } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -268,42 +278,41 @@ pub struct VpnTunnelsScopedList { impl Part for VpnTunnelsScopedList {} -/// An instance's serial console output. +/// [Output Only] Metadata for this warning in key: value format. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ForwardingRulesScopedListWarningData { + /// [Output Only] A key for the warning data. + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for ForwardingRulesScopedListWarningData {} +impl Part for ForwardingRulesScopedListWarningData {} + + +/// There is no detailed description. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [get serial port output instances](struct.InstanceGetSerialPortOutputCall.html) (response) +/// * [set named ports instance groups](struct.InstanceGroupSetNamedPortCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SerialPortOutput { - /// [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output. - pub kind: Option, - /// [Output Only] The contents of the console output. - pub contents: Option, - /// [Output Only] Server defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, +pub struct InstanceGroupsSetNamedPortsRequest { + /// The fingerprint of the named ports information, which is a hash of the contents. Use this field for optimistic locking when you update the named ports entries. + pub fingerprint: Option, + /// The list of named ports to set for this instance group. + #[serde(rename="namedPorts")] + pub named_ports: Option>, } -impl ResponseResult for SerialPortOutput {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationsScopedList { - /// [Output Only] List of operations contained in this scope. - pub operations: Option>, - /// [Output Only] Informational warning which replaces the list of operations when the list is empty. - pub warning: Option, -} - -impl Part for OperationsScopedList {} +impl RequestValue for InstanceGroupsSetNamedPortsRequest {} /// Contains a list of UrlMap resources. @@ -317,16 +326,16 @@ impl Part for OperationsScopedList {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UrlMapList { - /// A token used to continue a truncated list request (output only). + /// [Output Only] A token used to continue a truncated list request. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// A list of UrlMap resources. pub items: Option>, /// Type of resource. pub kind: Option, - /// Unique identifier for the resource; defined by the server (output only). + /// [Output Only] Unique identifier for the resource. Set by the server. pub id: Option, - /// Server defined URL for this resource (output only). + /// [Output Only] Server defined URL for this resource. #[serde(rename="selfLink")] pub self_link: Option, } @@ -334,40 +343,23 @@ pub struct UrlMapList { impl ResponseResult for UrlMapList {} -/// Informational warning which replaces the list of addresses when the list is empty. +/// There is no detailed description. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set instance template instance group managers](struct.InstanceGroupManagerSetInstanceTemplateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstancesScopedListWarning { - /// [Output Only] Optional human-readable details for this warning. - pub message: Option, - /// [Output Only] The warning type identifier for this warning. - pub code: Option, - /// [Output Only] Metadata for this warning in key: value format. - pub data: Option>, +pub struct InstanceGroupManagersSetInstanceTemplateRequest { + /// The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. + #[serde(rename="instanceTemplate")] + pub instance_template: Option, } -impl NestedType for TargetInstancesScopedListWarning {} -impl Part for TargetInstancesScopedListWarning {} - - -/// [Output Only] Informational warning which replaces the list of instances when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstancesScopedListWarning { - /// [Output Only] Optional human-readable details for this warning. - pub message: Option, - /// [Output Only] The warning type identifier for this warning. - pub code: Option, - /// [Output Only] Metadata for this warning in key: value format. - pub data: Option>, -} - -impl NestedType for InstancesScopedListWarning {} -impl Part for InstancesScopedListWarning {} +impl RequestValue for InstanceGroupManagersSetInstanceTemplateRequest {} /// A disk type resource. @@ -413,86 +405,6 @@ impl Resource for DiskType {} impl ResponseResult for DiskType {} -/// An Instance resource. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get serial port output instances](struct.InstanceGetSerialPortOutputCall.html) (none) -/// * [attach disk instances](struct.InstanceAttachDiskCall.html) (none) -/// * [insert instances](struct.InstanceInsertCall.html) (request) -/// * [stop instances](struct.InstanceStopCall.html) (none) -/// * [set metadata instances](struct.InstanceSetMetadataCall.html) (none) -/// * [start instances](struct.InstanceStartCall.html) (none) -/// * [detach disk instances](struct.InstanceDetachDiskCall.html) (none) -/// * [delete access config instances](struct.InstanceDeleteAccessConfigCall.html) (none) -/// * [get instances](struct.InstanceGetCall.html) (response) -/// * [set tags instances](struct.InstanceSetTagCall.html) (none) -/// * [set scheduling instances](struct.InstanceSetSchedulingCall.html) (none) -/// * [list instances](struct.InstanceListCall.html) (none) -/// * [delete instances](struct.InstanceDeleteCall.html) (none) -/// * [reset instances](struct.InstanceResetCall.html) (none) -/// * [aggregated list instances](struct.InstanceAggregatedListCall.html) (none) -/// * [add access config instances](struct.InstanceAddAccessConfigCall.html) (none) -/// * [set disk auto delete instances](struct.InstanceSetDiskAutoDeleteCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Instance { - /// [Output Only] The CPU platform used by this instance. - #[serde(rename="cpuPlatform")] - pub cpu_platform: Option, - /// [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, and TERMINATED. - pub status: Option, - /// Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding. - #[serde(rename="canIpForward")] - pub can_ip_forward: Option, - /// An optional textual description of the resource; provided by the client when the resource is created. - pub description: Option, - /// A list of tags to appy to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035. - pub tags: Option, - /// Scheduling options for this instance. - pub scheduling: Option, - /// Full or partial URL of the machine type resource to use for this instance. This is provided by the client when the instance is created. For example, the following is a valid partial url: - /// - /// zones/zone/machineTypes/machine-type - #[serde(rename="machineType")] - pub machine_type: Option, - /// A list of service accounts, with their specified scopes, authorized for this instance. Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Authenticating from Google Compute Engine for more information. - #[serde(rename="serviceAccounts")] - pub service_accounts: Option>, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// An array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. - #[serde(rename="networkInterfaces")] - pub network_interfaces: Option>, - /// [Output Only] Type of the resource. Always compute#instance for instances. - pub kind: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// [Output Only] URL of the zone where the instance resides. - pub zone: Option, - /// Array of disks associated with this instance. Persistent disks must be created before you can assign them. - pub disks: Option>, - /// [Output Only] Server defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output Only] An optional, human-readable explanation of the status. - #[serde(rename="statusMessage")] - pub status_message: Option, - /// The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys. - pub metadata: Option, -} - -impl RequestValue for Instance {} -impl Resource for Instance {} -impl ResponseResult for Instance {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -537,62 +449,6 @@ pub struct VpnTunnelAggregatedList { impl ResponseResult for VpnTunnelAggregatedList {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list global operations](struct.GlobalOperationAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationAggregatedList { - /// [Output Only] A token used to continue a truncated list request. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] A map of scoped operation lists. - pub items: Option>, - /// [Output Only] Type of resource. Always compute#operationAggregatedList for aggregated lists of operations. - pub kind: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for OperationAggregatedList {} - - -/// Contains a list of Image resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list images](struct.ImageListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ImageList { - /// A token used to continue a truncated list request (output only). - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// A list of Image resources. - pub items: Option>, - /// Type of resource. - pub kind: Option, - /// Unique identifier for the resource; defined by the server (output only). - pub id: Option, - /// Server defined URL for this resource (output only). - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for ImageList {} - - /// A metadata key/value entry. /// /// # Activities @@ -616,62 +472,6 @@ pub struct Metadata { impl RequestValue for Metadata {} -/// [Output Only] Informational warning which replaces the list of disk types when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskTypesScopedListWarning { - /// [Output Only] Optional human-readable details for this warning. - pub message: Option, - /// [Output Only] The warning type identifier for this warning. - pub code: Option, - /// [Output Only] Metadata for this warning in key: value format. - pub data: Option>, -} - -impl NestedType for DiskTypesScopedListWarning {} -impl Part for DiskTypesScopedListWarning {} - - -/// [Output Only] Metadata for this warning in key: value format. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ForwardingRulesScopedListWarningData { - /// [Output Only] A key for the warning data. - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for ForwardingRulesScopedListWarningData {} -impl Part for ForwardingRulesScopedListWarningData {} - - -/// A set of instance tags. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set tags instances](struct.InstanceSetTagCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Tags { - /// An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. - pub items: Option>, - /// Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata. - /// - /// To see the latest fingerprint, make get() request to the instance. - pub fingerprint: Option, -} - -impl RequestValue for Tags {} - - /// There is no detailed description. /// /// # Activities @@ -679,15 +479,51 @@ impl RequestValue for Tags {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [validate url maps](struct.UrlMapValidateCall.html) (request) +/// * [recreate instances instance group managers](struct.InstanceGroupManagerRecreateInstanceCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlMapsValidateRequest { - /// Content of the UrlMap to be validated. - pub resource: Option, +pub struct InstanceGroupManagersRecreateInstancesRequest { + /// The names of one or more instances to recreate. + pub instances: Option>, } -impl RequestValue for UrlMapsValidateRequest {} +impl RequestValue for InstanceGroupManagersRecreateInstancesRequest {} + + +/// [Output Only] The warning that replaces the list of managed instance groups when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagersScopedListWarning { + /// [Output Only] Optional human-readable details for this warning. + pub message: Option, + /// [Output Only] The warning type identifier for this warning. + pub code: Option, + /// [Output Only] Metadata for this warning in key: value format. + pub data: Option>, +} + +impl NestedType for InstanceGroupManagersScopedListWarning {} +impl Part for InstanceGroupManagersScopedListWarning {} + + +/// [Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouteWarnings { + /// [Output Only] Optional human-readable details for this warning. + pub message: Option, + /// [Output Only] The warning type identifier for this warning. + pub code: Option, + /// [Output Only] Metadata for this warning in key: value format. + pub data: Option>, +} + +impl NestedType for RouteWarnings {} +impl Part for RouteWarnings {} /// A TargetHttpProxy resource. This resource defines an HTTP proxy. @@ -702,22 +538,22 @@ impl RequestValue for UrlMapsValidateRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TargetHttpProxy { - /// Type of the resource. + /// [Output Only] Type of resource. Always compute#Operation for Operation resources. pub kind: Option, /// An optional textual description of the resource; provided by the client when the resource is created. pub description: Option, /// URL to the UrlMap resource that defines the mapping from URL to the BackendService. #[serde(rename="urlMap")] pub url_map: Option, - /// Creation timestamp in RFC3339 text format (output only). + /// [Output Only] Creation timestamp in RFC3339 text format. #[serde(rename="creationTimestamp")] pub creation_timestamp: Option, - /// Unique identifier for the resource; defined by the server (output only). + /// [Output Only] Unique identifier for the resource. Defined by the server. pub id: Option, - /// Server defined URL for the resource (output only). + /// [Output Only] Server defined URL for the resource. #[serde(rename="selfLink")] pub self_link: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. pub name: Option, } @@ -725,134 +561,18 @@ impl RequestValue for TargetHttpProxy {} impl ResponseResult for TargetHttpProxy {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list disks](struct.DiskAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskAggregatedList { - /// [Output Only] A token used to continue a truncated list request. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] A map of scoped disk lists. - pub items: Option>, - /// [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks. - pub kind: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for DiskAggregatedList {} - - -/// There is no detailed description. +/// [Output Only] If errors are generated during processing of the operation, this field will be populated. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AddressesScopedList { - /// [Output Only] Informational warning which replaces the list of addresses when the list is empty. - pub warning: Option, - /// [Output Only] List of addresses contained in this scope. - pub addresses: Option>, +pub struct OperationError { + /// [Output Only] The array of errors encountered while processing this operation. + pub errors: Option>, } -impl Part for AddressesScopedList {} - - -/// A Machine Type resource. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list machine types](struct.MachineTypeListCall.html) (none) -/// * [aggregated list machine types](struct.MachineTypeAggregatedListCall.html) (none) -/// * [get machine types](struct.MachineTypeGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineType { - /// [Output Only] The tumber of CPUs exposed to the instance. - #[serde(rename="guestCpus")] - pub guest_cpus: Option, - /// [Deprecated] This property is deprecated and will never be populated with any relevant values. - #[serde(rename="imageSpaceGb")] - pub image_space_gb: Option, - /// Type of the resource. - pub kind: Option, - /// [Output Only] An optional textual description of the resource. - pub description: Option, - /// [Output Only] The name of the zone where the machine type resides, such as us-central1-a. - pub zone: Option, - /// [Output Only] Maximum total persistent disks size (GB) allowed. - #[serde(rename="maximumPersistentDisksSizeGb")] - pub maximum_persistent_disks_size_gb: Option, - /// [Output Only] The deprecation status associated with this machine type. - pub deprecated: Option, - /// [Output Only] Maximum persistent disks allowed. - #[serde(rename="maximumPersistentDisks")] - pub maximum_persistent_disks: Option, - /// [Output Only] The amount of physical memory available to the instance, defined in MB. - #[serde(rename="memoryMb")] - pub memory_mb: Option, - /// [Output Only] List of extended scratch disks assigned to the instance. - #[serde(rename="scratchDisks")] - pub scratch_disks: Option>, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output Only] Name of the resource. - pub name: Option, -} - -impl Resource for MachineType {} -impl ResponseResult for MachineType {} - - -/// Array of key/value pairs. The total size of all keys and values must be less than 512 KB. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MetadataItems { - /// Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. - pub key: Option, - /// Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes. - pub value: Option, -} - -impl NestedType for MetadataItems {} -impl Part for MetadataItems {} - - -/// [Output Only] Metadata for this warning in key: value format. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstancesScopedListWarningData { - /// [Output Only] A key for the warning data. - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for InstancesScopedListWarningData {} -impl Part for InstancesScopedListWarningData {} +impl NestedType for OperationError {} +impl Part for OperationError {} /// Contains a list of address resources. @@ -884,76 +604,22 @@ pub struct AddressList { impl ResponseResult for AddressList {} -/// Contains a list of disk type resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list disk types](struct.DiskTypeListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskTypeList { - /// [Output Only] A token used to continue a truncated list request. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] A list of Disk Type resources. - pub items: Option>, - /// [Output Only] Type of resource. Always compute#diskTypeList for disk types. - pub kind: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for DiskTypeList {} - - -/// [Output Only] Metadata for this warning in key: value format. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetVpnGatewaysScopedListWarningData { - /// [Output Only] A key for the warning data. - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, +pub struct InstanceWithNamedPorts { + /// The status of the instance. + pub status: Option, + /// The URL of the instance. + pub instance: Option, + /// The named ports that belong to this instance group. + #[serde(rename="namedPorts")] + pub named_ports: Option>, } -impl NestedType for TargetVpnGatewaysScopedListWarningData {} -impl Part for TargetVpnGatewaysScopedListWarningData {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list addresses](struct.AddresseAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AddressAggregatedList { - /// [Output Only] A token used to continue a truncated list request. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] A map of scoped address lists. - pub items: Option>, - /// [Output Only] Type of resource. Always compute#addressAggregatedList for aggregated lists of addresses. - pub kind: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for AddressAggregatedList {} +impl Part for InstanceWithNamedPorts {} /// Message representing the validation result for a UrlMap. @@ -979,22 +645,29 @@ pub struct UrlMapValidationResult { impl Part for UrlMapValidationResult {} -/// Informational warning which replaces the list of addresses when the list is empty. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolsScopedListWarning { - /// [Output Only] Optional human-readable details for this warning. - pub message: Option, - /// [Output Only] The warning type identifier for this warning. - pub code: Option, - /// [Output Only] Metadata for this warning in key: value format. - pub data: Option>, +pub struct InstanceGroupManagerActionsSummary { + /// no description provided + pub none: Option, + /// no description provided + pub recreating: Option, + /// no description provided + pub creating: Option, + /// no description provided + pub refreshing: Option, + /// no description provided + pub abandoning: Option, + /// no description provided + pub deleting: Option, + /// no description provided + pub restarting: Option, } -impl NestedType for TargetPoolsScopedListWarning {} -impl Part for TargetPoolsScopedListWarning {} +impl Part for InstanceGroupManagerActionsSummary {} /// A matcher for the path portion of the URL. The BackendService from the longest-matched rule will serve the URL. If no rule was matched, the default_service will be used. @@ -1009,7 +682,7 @@ pub struct PathMatcher { /// The list of path rules. #[serde(rename="pathRules")] pub path_rules: Option>, - /// no description provided + /// An optional textual description of the resource. pub description: Option, /// The name to which this PathMatcher is referred by the HostRule. pub name: Option, @@ -1018,48 +691,17 @@ pub struct PathMatcher { impl Part for PathMatcher {} -/// [Output Only] Metadata for this warning in key: value format. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstancesScopedListWarningData { - /// [Output Only] A key for the warning data. - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, +pub struct ManagedInstanceLastAttempt { + /// Encountered errors during the last attempt to create or delete the instance. + pub errors: Option, } -impl NestedType for TargetInstancesScopedListWarningData {} -impl Part for TargetInstancesScopedListWarningData {} - - -/// Contains a list of persistent disk snapshot resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list snapshots](struct.SnapshotListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SnapshotList { - /// A token used to continue a truncated list request (output only). - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// A list of Snapshot resources. - pub items: Option>, - /// Type of resource. - pub kind: Option, - /// Unique identifier for the resource; defined by the server (output only). - pub id: Option, - /// Server defined URL for this resource (output only). - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for SnapshotList {} +impl Part for ManagedInstanceLastAttempt {} /// Region resource. @@ -1117,21 +759,6 @@ pub struct PathRule { impl Part for PathRule {} -/// A service account. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ServiceAccount { - /// The list of scopes to be made available for this service account. - pub scopes: Option>, - /// Email address of the service account. - pub email: Option, -} - -impl Part for ServiceAccount {} - - /// A Project resource. Projects can only be created in the Google Developers Console. Unless marked otherwise, values can only be modified in the console. /// /// # Activities @@ -1175,151 +802,74 @@ impl Resource for Project {} impl ResponseResult for Project {} -/// [Output Only] Metadata for this warning in key: value format. +/// InstanceGroupManagers /// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineTypesScopedListWarningData { - /// [Output Only] A key for the warning data. - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for MachineTypesScopedListWarningData {} -impl Part for MachineTypesScopedListWarningData {} - - -/// A persistent disk snapshot resource. +/// Next available tag: 17 /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [list snapshots](struct.SnapshotListCall.html) (none) -/// * [create snapshot disks](struct.DiskCreateSnapshotCall.html) (request) -/// * [delete snapshots](struct.SnapshotDeleteCall.html) (none) -/// * [get snapshots](struct.SnapshotGetCall.html) (response) +/// * [list managed instances instance group managers](struct.InstanceGroupManagerListManagedInstanceCall.html) (none) +/// * [resize instance group managers](struct.InstanceGroupManagerResizeCall.html) (none) +/// * [aggregated list instance group managers](struct.InstanceGroupManagerAggregatedListCall.html) (none) +/// * [delete instances instance group managers](struct.InstanceGroupManagerDeleteInstanceCall.html) (none) +/// * [delete instance group managers](struct.InstanceGroupManagerDeleteCall.html) (none) +/// * [abandon instances instance group managers](struct.InstanceGroupManagerAbandonInstanceCall.html) (none) +/// * [get instance group managers](struct.InstanceGroupManagerGetCall.html) (response) +/// * [set instance template instance group managers](struct.InstanceGroupManagerSetInstanceTemplateCall.html) (none) +/// * [list instance group managers](struct.InstanceGroupManagerListCall.html) (none) +/// * [insert instance group managers](struct.InstanceGroupManagerInsertCall.html) (request) +/// * [set target pools instance group managers](struct.InstanceGroupManagerSetTargetPoolCall.html) (none) +/// * [recreate instances instance group managers](struct.InstanceGroupManagerRecreateInstanceCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Snapshot { - /// The status of the persistent disk snapshot (output only). - pub status: Option, - /// Type of the resource. - pub kind: Option, - /// A size of the the storage used by the snapshot. As snapshots share storage this number is expected to change with snapshot creation/deletion. - #[serde(rename="storageBytes")] - pub storage_bytes: Option, - /// An optional textual description of the resource; provided by the client when the resource is created. +pub struct InstanceGroupManager { + /// [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for those actions. + #[serde(rename="currentActions")] + pub current_actions: Option, + /// An optional text description for the managed instance group. pub description: Option, - /// The source disk used to create this snapshot. - #[serde(rename="sourceDisk")] - pub source_disk: Option, - /// Creation timestamp in RFC3339 text format (output only). - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// The 'id' value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name. - #[serde(rename="sourceDiskId")] - pub source_disk_id: Option, - /// Size of the persistent disk snapshot, specified in GB (output only). - #[serde(rename="diskSizeGb")] - pub disk_size_gb: Option, - /// Public visible licenses. - pub licenses: Option>, - /// An indicator whether storageBytes is in a stable state, or it is being adjusted as a result of shared storage reallocation. - #[serde(rename="storageBytesStatus")] - pub storage_bytes_status: Option, - /// Unique identifier for the resource; defined by the server (output only). - pub id: Option, - /// Server defined URL for the resource (output only). - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. - pub name: Option, -} - -impl RequestValue for Snapshot {} -impl Resource for Snapshot {} -impl ResponseResult for Snapshot {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskTypesScopedList { - /// [Output Only] Informational warning which replaces the list of disk types when the list is empty. - pub warning: Option, - /// [Output Only] List of disk types contained in this scope. - #[serde(rename="diskTypes")] - pub disk_types: Option>, -} - -impl Part for DiskTypesScopedList {} - - -/// A BackendService resource. This resource defines a group of backend VMs together with their serving capacity. -/// -/// If you add field foo, you probably need to also add: com.google.cloud.cluster.manager.api.BackendServiceResource: foo com.google.cloud.cluster.manager.networking.entities: BackendService, BackendServiceEntity: getFoo, setFoo: -/// -/// Converters/mappers will need to be updated: com.google.cloud.cluster.manager.networking.services.backendservice.BackendServiceResourceConverter: toResource, updateEntity: copy foo com.google.cloud.cluster.mixer.protomappers.BackendServiceMappers.ResourceMapper: ResourceMapper: add a new map call -/// -/// Tests to update: com.google.cloud.cluster.manager.networking.services.backendservice.BackendServiceResourceConverterTest com.google.cloud.cluster.mixer.protomappers.BackendServiceMappersTest.testResourceMapping -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get backend services](struct.BackendServiceGetCall.html) (response) -/// * [insert backend services](struct.BackendServiceInsertCall.html) (request) -/// * [list backend services](struct.BackendServiceListCall.html) (none) -/// * [update backend services](struct.BackendServiceUpdateCall.html) (request) -/// * [get health backend services](struct.BackendServiceGetHealthCall.html) (none) -/// * [delete backend services](struct.BackendServiceDeleteCall.html) (none) -/// * [patch backend services](struct.BackendServicePatchCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BackendService { - /// Type of the resource. - pub kind: Option, - /// no description provided - pub protocol: Option, - /// An optional textual description of the resource; provided by the client when the resource is created. - pub description: Option, - /// How many seconds to wait for the backend before considering it a failed request. Default is 30 seconds. - #[serde(rename="timeoutSec")] - pub timeout_sec: Option, - /// Unique identifier for the resource; defined by the server (output only). - pub id: Option, - /// The list of backends that serve this BackendService. - pub backends: Option>, - /// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService. + /// The URL of the zone where the managed instance group is located. + pub zone: Option, + /// The autohealing policy for this managed instance group. You can specify only one value. + #[serde(rename="autoHealingPolicies")] + pub auto_healing_policies: Option>, + /// [Output Only] The fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when updating the target pool entries. pub fingerprint: Option, - /// Name of backend port. The same name should appear in the resource views referenced by this service. Required. - #[serde(rename="portName")] - pub port_name: Option, - /// The list of URLs to the HttpHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required. - #[serde(rename="healthChecks")] - pub health_checks: Option>, - /// Creation timestamp in RFC3339 text format (output only). + /// [Output Only] The URL of the InstanceGroup resource. + #[serde(rename="instanceGroup")] + pub instance_group: Option, + /// The target number of running instances for this managed instance group. Deleting or abandoning instances reduces this number. Resizing the group changes this number. + #[serde(rename="targetSize")] + pub target_size: Option, + /// [Output Only] A unique identifier for this managed instance group. The server defines this identifier. + pub id: Option, + /// The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035. + #[serde(rename="baseInstanceName")] + pub base_instance_name: Option, + /// The URL of all TargetPool resources to which new instances in the instanceGroup field are added. Updating the target pool values does not affect existing instances. + #[serde(rename="targetPools")] + pub target_pools: Option>, + /// The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. + #[serde(rename="instanceTemplate")] + pub instance_template: Option, + /// [Output Only] The creation timestamp for this managed instance group in RFC3339 text format. #[serde(rename="creationTimestamp")] pub creation_timestamp: Option, - /// Deprecated in favor of port_name. The TCP port to connect on the backend. The default value is 80. - pub port: Option, - /// Server defined URL for the resource (output only). + /// [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups. + pub kind: Option, + /// [Output Only] Server defined URL for this managed instance group. #[serde(rename="selfLink")] pub self_link: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + /// The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035. pub name: Option, } -impl RequestValue for BackendService {} -impl Resource for BackendService {} -impl ResponseResult for BackendService {} +impl RequestValue for InstanceGroupManager {} +impl Resource for InstanceGroupManager {} +impl ResponseResult for InstanceGroupManager {} /// There is no detailed description. @@ -1368,6 +918,25 @@ pub struct ResourceGroupReference { impl RequestValue for ResourceGroupReference {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list managed instances instance group managers](struct.InstanceGroupManagerListManagedInstanceCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagersListManagedInstancesResponse { + /// List of managed instances. If empty - all instances are listed. + #[serde(rename="managedInstances")] + pub managed_instances: Option>, +} + +impl ResponseResult for InstanceGroupManagersListManagedInstancesResponse {} + + /// Contains a list of Machine Type resources. /// /// # Activities @@ -1396,38 +965,6 @@ pub struct MachineTypeList { impl ResponseResult for MachineTypeList {} -/// [Output Only] Metadata for this warning in key: value format. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DisksScopedListWarningData { - /// [Output Only] A key for the warning data. - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for DisksScopedListWarningData {} -impl Part for DisksScopedListWarningData {} - - -/// [Output Only] Metadata for this warning in key: value format. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationWarningsData { - /// [Output Only] A key for the warning data. - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for OperationWarningsData {} -impl Part for OperationWarningsData {} - - /// Contains a list of ForwardingRule resources. /// /// # Activities @@ -1440,16 +977,16 @@ impl Part for OperationWarningsData {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ForwardingRuleList { - /// A token used to continue a truncated list request (output only). + /// [Output Only] A token used to continue a truncated list request. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// A list of ForwardingRule resources. pub items: Option>, /// Type of resource. pub kind: Option, - /// Unique identifier for the resource; defined by the server (output only). + /// [Output Only] Unique identifier for the resource. Set by the server. pub id: Option, - /// Server defined URL for this resource (output only). + /// [Output Only] Server defined URL for this resource. #[serde(rename="selfLink")] pub self_link: Option, } @@ -1457,24 +994,6 @@ pub struct ForwardingRuleList { impl ResponseResult for ForwardingRuleList {} -/// Informational warning which replaces the list of forwarding rules when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ForwardingRulesScopedListWarning { - /// [Output Only] Optional human-readable details for this warning. - pub message: Option, - /// [Output Only] The warning type identifier for this warning. - pub code: Option, - /// [Output Only] Metadata for this warning in key: value format. - pub data: Option>, -} - -impl NestedType for ForwardingRulesScopedListWarning {} -impl Part for ForwardingRulesScopedListWarning {} - - /// Contains a list of Firewall resources. /// /// # Activities @@ -1522,6 +1041,34 @@ pub struct UrlMapTest { impl Part for UrlMapTest {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list autoscalers](struct.AutoscalerAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalerAggregatedList { + /// A token used to continue a truncated list request (output only). + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A map of scoped autoscaler lists. + pub items: Option>, + /// Type of resource. + pub kind: Option, + /// Unique identifier for the resource; defined by the server (output only). + pub id: Option, + /// Server defined URL for this resource (output only). + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for AutoscalerAggregatedList {} + + /// [Output Only] If warning messages are generated during processing of the operation, this field will be populated. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1540,253 +1087,6 @@ impl NestedType for OperationWarnings {} impl Part for OperationWarnings {} -/// A Firewall resource. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [patch firewalls](struct.FirewallPatchCall.html) (request) -/// * [list firewalls](struct.FirewallListCall.html) (none) -/// * [get firewalls](struct.FirewallGetCall.html) (response) -/// * [update firewalls](struct.FirewallUpdateCall.html) (request) -/// * [delete firewalls](struct.FirewallDeleteCall.html) (none) -/// * [insert firewalls](struct.FirewallInsertCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Firewall { - /// [Output Ony] Type of the resource. Always compute#firewall for firewall rules. - pub kind: Option, - /// An optional textual description of the resource; provided by the client when the resource is created. - pub description: Option, - /// A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags may be set. - /// - /// If both properties are set, an inbound connection is allowed if the range or the tag of the source matches the sourceRanges OR matches the sourceTags property; the connection does not need to match both properties. - #[serde(rename="sourceTags")] - pub source_tags: Option>, - /// The IP address blocks that this rule applies to, expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. - /// - /// If both properties are set, an inbound connection is allowed if the range or the tag of the source matches the sourceRanges OR matches the sourceTags property; the connection does not need to match both properties. - #[serde(rename="sourceRanges")] - pub source_ranges: Option>, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// A list of instance tags indicating sets of instances located on network which may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network. - #[serde(rename="targetTags")] - pub target_tags: Option>, - /// The list of rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. - pub allowed: Option>, - /// [Output Only] Creation timestamp in RFC3339text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// URL of the network resource for this firewall rule. This field is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used: - /// global/networks/default - /// If you choose to specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: - /// - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network - /// - projects/myproject/global/networks/my-network - /// - global/networks/default - pub network: Option, -} - -impl RequestValue for Firewall {} -impl Resource for Firewall {} -impl ResponseResult for Firewall {} - - -/// A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HostRule { - /// The list of host patterns to match. They must be valid hostnames except that they may start with *. or *-. The * acts like a glob and will match any string of atoms (separated by .s and -s) to the left. - pub hosts: Option>, - /// no description provided - pub description: Option, - /// The name of the PathMatcher to match the path portion of the URL, if the this HostRule matches the URL's host portion. - #[serde(rename="pathMatcher")] - pub path_matcher: Option, -} - -impl Part for HostRule {} - - -/// Contains a list of operation resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list region operations](struct.RegionOperationListCall.html) (response) -/// * [list zone operations](struct.ZoneOperationListCall.html) (response) -/// * [list global operations](struct.GlobalOperationListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationList { - /// [Output Only] A token used to continue a truncate. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] The operation resources. - pub items: Option>, - /// [Output Only] Type of resource. Always compute#operations for Operations resource. - pub kind: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for OperationList {} - - -/// A TargetInstance resource. This resource defines an endpoint VM that terminates traffic of certain protocols. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [delete target instances](struct.TargetInstanceDeleteCall.html) (none) -/// * [aggregated list target instances](struct.TargetInstanceAggregatedListCall.html) (none) -/// * [get target instances](struct.TargetInstanceGetCall.html) (response) -/// * [list target instances](struct.TargetInstanceListCall.html) (none) -/// * [insert target instances](struct.TargetInstanceInsertCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstance { - /// NAT option controlling how IPs are NAT'ed to the VM. Currently only NO_NAT (default value) is supported. - #[serde(rename="natPolicy")] - pub nat_policy: Option, - /// An optional textual description of the resource; provided by the client when the resource is created. - pub description: Option, - /// URL of the zone where the target instance resides (output only). - pub zone: Option, - /// Type of the resource. - pub kind: Option, - /// The URL to the instance that terminates the relevant traffic. - pub instance: Option, - /// Creation timestamp in RFC3339 text format (output only). - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// Unique identifier for the resource; defined by the server (output only). - pub id: Option, - /// Server defined URL for the resource (output only). - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. - pub name: Option, -} - -impl RequestValue for TargetInstance {} -impl Resource for TargetInstance {} -impl ResponseResult for TargetInstance {} - - -/// An HttpHealthCheck resource. This resource defines a template for how individual VMs should be checked for health, via HTTP. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [insert http health checks](struct.HttpHealthCheckInsertCall.html) (request) -/// * [update http health checks](struct.HttpHealthCheckUpdateCall.html) (request) -/// * [get http health checks](struct.HttpHealthCheckGetCall.html) (response) -/// * [patch http health checks](struct.HttpHealthCheckPatchCall.html) (request) -/// * [list http health checks](struct.HttpHealthCheckListCall.html) (none) -/// * [delete http health checks](struct.HttpHealthCheckDeleteCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HttpHealthCheck { - /// Type of the resource. - pub kind: Option, - /// An optional textual description of the resource; provided by the client when the resource is created. - pub description: Option, - /// How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec. - #[serde(rename="timeoutSec")] - pub timeout_sec: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. - pub name: Option, - /// How often (in seconds) to send a health check. The default value is 5 seconds. - #[serde(rename="checkIntervalSec")] - pub check_interval_sec: Option, - /// A so-far healthy VM will be marked unhealthy after this many consecutive failures. The default value is 2. - #[serde(rename="unhealthyThreshold")] - pub unhealthy_threshold: Option, - /// A so-far unhealthy VM will be marked healthy after this many consecutive successes. The default value is 2. - #[serde(rename="healthyThreshold")] - pub healthy_threshold: Option, - /// The value of the host header in the HTTP health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used. - pub host: Option, - /// Unique identifier for the resource; defined by the server (output only). - pub id: Option, - /// Creation timestamp in RFC3339 text format (output only). - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// The TCP port number for the HTTP health check request. The default value is 80. - pub port: Option, - /// Server defined URL for the resource (output only). - #[serde(rename="selfLink")] - pub self_link: Option, - /// The request path of the HTTP health check request. The default value is "/". - #[serde(rename="requestPath")] - pub request_path: Option, -} - -impl RequestValue for HttpHealthCheck {} -impl Resource for HttpHealthCheck {} -impl ResponseResult for HttpHealthCheck {} - - -/// A network resource. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list networks](struct.NetworkListCall.html) (none) -/// * [delete networks](struct.NetworkDeleteCall.html) (none) -/// * [insert networks](struct.NetworkInsertCall.html) (request) -/// * [get networks](struct.NetworkGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Network { - /// [Output Only] Type of the resource. Always compute#network for networks. - pub kind: Option, - /// An optional textual description of the resource; provided by the client when the resource is created. - pub description: Option, - /// The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created. - #[serde(rename="IPv4Range")] - pub i_pv4_range: Option, - /// A gateway address for default routing to other networks. This value is read only and is selected by the Google Compute Engine, typically as the first usable address in the IPv4Range. - #[serde(rename="gatewayIPv4")] - pub gateway_i_pv4: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, -} - -impl RequestValue for Network {} -impl Resource for Network {} -impl ResponseResult for Network {} - - /// There is no detailed description. /// /// # Activities @@ -1794,25 +1094,25 @@ impl ResponseResult for Network {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [aggregated list disk types](struct.DiskTypeAggregatedListCall.html) (response) +/// * [list instances instance groups](struct.InstanceGroupListInstanceCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskTypeAggregatedList { - /// [Output Only] A token used to continue a truncated list request. +pub struct InstanceGroupsListInstances { + /// [Output Only] A token that is used to continue a truncated list request. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// [Output Only] A map of scoped disk type lists. - pub items: Option>, - /// [Output Only] Type of resource. Always compute#diskTypeAggregatedList. + /// A list of InstanceWithNamedPorts resources, which contains all named ports for the given instance. + pub items: Option>, + /// [Output Only] The resource type, which is always compute#instanceGroupsListInstances for lists of instance groups. pub kind: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. + /// [Output Only] A unique identifier for this list of instance groups. The server defines this identifier. pub id: Option, - /// [Output Only] Server defined URL for this resource. + /// [Output Only] The URL for this list of instance groups. The server defines this URL. #[serde(rename="selfLink")] pub self_link: Option, } -impl ResponseResult for DiskTypeAggregatedList {} +impl ResponseResult for InstanceGroupsListInstances {} /// An Instance Template resource. @@ -1873,52 +1173,6 @@ pub struct HealthStatus { impl Part for HealthStatus {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list machine types](struct.MachineTypeAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineTypeAggregatedList { - /// [Output Only] A token used to continue a truncated list request. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] A map of scoped machine type lists. - pub items: Option>, - /// [Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types. - pub kind: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for MachineTypeAggregatedList {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [validate url maps](struct.UrlMapValidateCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlMapsValidateResponse { - /// no description provided - pub result: Option, -} - -impl ResponseResult for UrlMapsValidateResponse {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1946,16 +1200,16 @@ impl Part for ForwardingRulesScopedList {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RouteList { - /// A token used to continue a truncated list request (output only). + /// [Output Only] A token used to continue a truncated list request. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// A list of Route resources. pub items: Option>, /// Type of resource. pub kind: Option, - /// Unique identifier for the resource; defined by the server (output only). + /// [Output Only] Unique identifier for the resource. Defined by the server. pub id: Option, - /// Server defined URL for this resource (output only). + /// [Output Only] Server defined URL for this resource. #[serde(rename="selfLink")] pub self_link: Option, } @@ -2065,7 +1319,37 @@ impl NestedType for VpnTunnelsScopedListWarningData {} impl Part for VpnTunnelsScopedListWarningData {} -/// Contains a list of TargetHttpProxy resources. +/// Contains a list of Operation resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list region operations](struct.RegionOperationListCall.html) (response) +/// * [list zone operations](struct.ZoneOperationListCall.html) (response) +/// * [list global operations](struct.GlobalOperationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationList { + /// [Output Only] A token used to continue a truncate. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] The Operation resources. + pub items: Option>, + /// [Output Only] Type of resource. Always compute#operations for Operations resource. + pub kind: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for OperationList {} + + +/// A list of TargetHttpProxy resources. /// /// # Activities /// @@ -2076,16 +1360,16 @@ impl Part for VpnTunnelsScopedListWarningData {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TargetHttpProxyList { - /// A token used to continue a truncated list request (output only). + /// [Output Only] A token used to continue a truncated list request. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// A list of TargetHttpProxy resources. pub items: Option>, - /// Type of resource. + /// Type of resource. Always compute#targetHttpProxyList for lists of Target HTTP proxies. pub kind: Option, - /// Unique identifier for the resource; defined by the server (output only). + /// [Output Only] Unique identifier for the resource; defined by the server. pub id: Option, - /// Server defined URL for this resource (output only). + /// [Output Only] Server-defined URL for this resource. #[serde(rename="selfLink")] pub self_link: Option, } @@ -2100,43 +1384,74 @@ impl ResponseResult for TargetHttpProxyList {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [delete vpn tunnels](struct.VpnTunnelDeleteCall.html) (none) -/// * [aggregated list vpn tunnels](struct.VpnTunnelAggregatedListCall.html) (none) -/// * [get vpn tunnels](struct.VpnTunnelGetCall.html) (response) -/// * [insert vpn tunnels](struct.VpnTunnelInsertCall.html) (request) -/// * [list vpn tunnels](struct.VpnTunnelListCall.html) (none) +/// * [list instances instance groups](struct.InstanceGroupListInstanceCall.html) (none) +/// * [insert instance groups](struct.InstanceGroupInsertCall.html) (request) +/// * [delete instance groups](struct.InstanceGroupDeleteCall.html) (none) +/// * [get instance groups](struct.InstanceGroupGetCall.html) (response) +/// * [add instances instance groups](struct.InstanceGroupAddInstanceCall.html) (none) +/// * [set named ports instance groups](struct.InstanceGroupSetNamedPortCall.html) (none) +/// * [list instance groups](struct.InstanceGroupListCall.html) (none) +/// * [aggregated list instance groups](struct.InstanceGroupAggregatedListCall.html) (none) +/// * [remove instances instance groups](struct.InstanceGroupRemoveInstanceCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VpnTunnel { - /// [Output Only] Detailed status message for the VPN tunnel. - #[serde(rename="detailedStatus")] - pub detailed_status: Option, - /// IKE protocol version to use when establishing the VPN tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2. Default version is 2. - #[serde(rename="ikeVersion")] - pub ike_version: Option, - /// [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. +pub struct InstanceGroup { + /// [Output Only] The resource type, which is always compute#instanceGroup for instance groups. + pub kind: Option, + /// The URL of the network to which all instances in the instance group belong. + pub network: Option, + /// The URL of the zone where the instance group is located. + pub zone: Option, + /// An optional text description for the instance group. + pub description: Option, + /// The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. + pub name: Option, + /// [Output Only] The fingerprint of the named ports information. The system uses this fingerprint to detect conflicts when multiple users change the named ports information concurrently. + pub fingerprint: Option, + /// Assigns a name to a port number. For example: {name: ?http?, port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: ?http?, port: 80},{name: "http", port: 8080}] Named ports apply to all instances in this instance group. + #[serde(rename="namedPorts")] + pub named_ports: Option>, + /// [Output Only] The creation timestamp for this instance group in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] A unique identifier for this instance group. The server defines this identifier. + pub id: Option, + /// [Output Only] The URL for this instance group. The server defines this URL. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] The total number of instances in the instance group. + pub size: Option, +} + +impl RequestValue for InstanceGroup {} +impl Resource for InstanceGroup {} +impl ResponseResult for InstanceGroup {} + + +/// A network resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list networks](struct.NetworkListCall.html) (none) +/// * [delete networks](struct.NetworkDeleteCall.html) (none) +/// * [insert networks](struct.NetworkInsertCall.html) (request) +/// * [get networks](struct.NetworkGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Network { + /// [Output Only] Type of the resource. Always compute#network for networks. pub kind: Option, /// An optional textual description of the resource. Provided by the client when the resource is created. pub description: Option, - /// IP address of the peer VPN gateway. - #[serde(rename="peerIp")] - pub peer_ip: Option, - /// [Output Only] URL of the region where the VPN tunnel resides. - pub region: Option, - /// IKE networks to use when establishing the VPN tunnel with peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges should be disjoint. - #[serde(rename="ikeNetworks")] - pub ike_networks: Option>, - /// [Output Only] The status of the VPN tunnel. - pub status: Option, - /// Hash of the shared secret. - #[serde(rename="sharedSecretHash")] - pub shared_secret_hash: Option, - /// URL of the VPN gateway to which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. - #[serde(rename="targetVpnGateway")] - pub target_vpn_gateway: Option, - /// Shared secret used to set the secure session between the GCE VPN gateway and the peer VPN gateway. - #[serde(rename="sharedSecret")] - pub shared_secret: Option, + /// The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created. + #[serde(rename="IPv4Range")] + pub i_pv4_range: Option, + /// A gateway address for default routing to other networks. This value is read only and is selected by the Google Compute Engine, typically as the first usable address in the IPv4Range. + #[serde(rename="gatewayIPv4")] + pub gateway_i_pv4: Option, /// [Output Only] Creation timestamp in RFC3339 text format. #[serde(rename="creationTimestamp")] pub creation_timestamp: Option, @@ -2145,85 +1460,13 @@ pub struct VpnTunnel { /// [Output Only] Server defined URL for the resource. #[serde(rename="selfLink")] pub self_link: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long and comply with RFC1035. + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. pub name: Option, } -impl RequestValue for VpnTunnel {} -impl Resource for VpnTunnel {} -impl ResponseResult for VpnTunnel {} - - -/// Deprecation status for a public resource. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [deprecate images](struct.ImageDeprecateCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DeprecationStatus { - /// An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to DELETED. - pub deleted: Option, - /// An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to DEPRECATED. - pub deprecated: Option, - /// The deprecation state of this resource. This can be DEPRECATED, OBSOLETE, or DELETED. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error. - pub state: Option, - /// An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to OBSOLETE. - pub obsolete: Option, - /// The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource. - pub replacement: Option, -} - -impl RequestValue for DeprecationStatus {} - - -/// [Output Only] Informational warning which replaces the list of disks when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DisksScopedListWarning { - /// [Output Only] Optional human-readable details for this warning. - pub message: Option, - /// [Output Only] The warning type identifier for this warning. - pub code: Option, - /// [Output Only] Metadata for this warning in key: value format. - pub data: Option>, -} - -impl NestedType for DisksScopedListWarning {} -impl Part for DisksScopedListWarning {} - - -/// Contains a list of TargetVpnGateway resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list target vpn gateways](struct.TargetVpnGatewayListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetVpnGatewayList { - /// [Output Only] A token used to continue a truncated list request. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] A list of TargetVpnGateway resources. - pub items: Option>, - /// [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. - pub kind: Option, - /// [Output Only] Unique identifier for the resource. Defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for TargetVpnGatewayList {} +impl RequestValue for Network {} +impl Resource for Network {} +impl ResponseResult for Network {} /// A Zone resource. @@ -2267,58 +1510,6 @@ impl Resource for Zone {} impl ResponseResult for Zone {} -/// A ForwardingRule resource. A ForwardingRule resource specifies which pool of target VMs to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list forwarding rules](struct.ForwardingRuleAggregatedListCall.html) (none) -/// * [get global forwarding rules](struct.GlobalForwardingRuleGetCall.html) (response) -/// * [insert global forwarding rules](struct.GlobalForwardingRuleInsertCall.html) (request) -/// * [insert forwarding rules](struct.ForwardingRuleInsertCall.html) (request) -/// * [delete forwarding rules](struct.ForwardingRuleDeleteCall.html) (none) -/// * [set target forwarding rules](struct.ForwardingRuleSetTargetCall.html) (none) -/// * [get forwarding rules](struct.ForwardingRuleGetCall.html) (response) -/// * [list forwarding rules](struct.ForwardingRuleListCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ForwardingRule { - /// Type of the resource. - pub kind: Option, - /// An optional textual description of the resource; provided by the client when the resource is created. - pub description: Option, - /// Applicable only when 'IPProtocol' is 'TCP', 'UDP' or 'SCTP', only packets addressed to ports in the specified range will be forwarded to 'target'. If 'portRange' is left empty (default value), all ports are forwarded. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges. - #[serde(rename="portRange")] - pub port_range: Option, - /// URL of the region where the regional forwarding rule resides (output only). This field is not applicable to global forwarding rules. - pub region: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. - pub name: Option, - /// Creation timestamp in RFC3339 text format (output only). - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// The IP protocol to which this rule applies, valid options are 'TCP', 'UDP', 'ESP', 'AH' or 'SCTP'. - #[serde(rename="IPProtocol")] - pub ip_protocol: Option, - /// Value of the reserved IP address that this forwarding rule is serving on behalf of. For global forwarding rules, the address must be a global IP; for regional forwarding rules, the address must live in the same region as the forwarding rule. If left empty (default value), an ephemeral IP from the same scope (global or regional) will be assigned. - #[serde(rename="IPAddress")] - pub ip_address: Option, - /// Unique identifier for the resource; defined by the server (output only). - pub id: Option, - /// Server defined URL for the resource (output only). - #[serde(rename="selfLink")] - pub self_link: Option, - /// The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global TargetHttpProxy resource. - pub target: Option, -} - -impl RequestValue for ForwardingRule {} -impl Resource for ForwardingRule {} -impl ResponseResult for ForwardingRule {} - - /// An access configuration attached to an instance's network interface. /// /// # Activities @@ -2345,66 +1536,60 @@ pub struct AccessConfig { impl RequestValue for AccessConfig {} -/// There is no detailed description. +/// An HttpHealthCheck resource. This resource defines a template for how individual VMs should be checked for health, via HTTP. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [set url map target http proxies](struct.TargetHttpProxySetUrlMapCall.html) (request) +/// * [insert http health checks](struct.HttpHealthCheckInsertCall.html) (request) +/// * [update http health checks](struct.HttpHealthCheckUpdateCall.html) (request) +/// * [get http health checks](struct.HttpHealthCheckGetCall.html) (response) +/// * [patch http health checks](struct.HttpHealthCheckPatchCall.html) (request) +/// * [list http health checks](struct.HttpHealthCheckListCall.html) (none) +/// * [delete http health checks](struct.HttpHealthCheckDeleteCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlMapReference { - /// no description provided - #[serde(rename="urlMap")] - pub url_map: Option, -} - -impl RequestValue for UrlMapReference {} - - -/// [Output Only] List of extended scratch disks assigned to the instance. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineTypeScratchDisks { - /// Size of the scratch disk, defined in GB. - #[serde(rename="diskGb")] - pub disk_gb: Option, -} - -impl NestedType for MachineTypeScratchDisks {} -impl Part for MachineTypeScratchDisks {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list target instances](struct.TargetInstanceAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstanceAggregatedList { - /// A token used to continue a truncated list request (output only). - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// A map of scoped target instance lists. - pub items: Option>, - /// Type of resource. +pub struct HttpHealthCheck { + /// Type of the resource. pub kind: Option, + /// An optional textual description of the resource; provided by the client when the resource is created. + pub description: Option, + /// How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec. + #[serde(rename="timeoutSec")] + pub timeout_sec: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + pub name: Option, + /// How often (in seconds) to send a health check. The default value is 5 seconds. + #[serde(rename="checkIntervalSec")] + pub check_interval_sec: Option, + /// A so-far healthy VM will be marked unhealthy after this many consecutive failures. The default value is 2. + #[serde(rename="unhealthyThreshold")] + pub unhealthy_threshold: Option, + /// A so-far unhealthy VM will be marked healthy after this many consecutive successes. The default value is 2. + #[serde(rename="healthyThreshold")] + pub healthy_threshold: Option, + /// The value of the host header in the HTTP health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used. + pub host: Option, /// Unique identifier for the resource; defined by the server (output only). pub id: Option, - /// Server defined URL for this resource (output only). + /// Creation timestamp in RFC3339 text format (output only). + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// The TCP port number for the HTTP health check request. The default value is 80. + pub port: Option, + /// Server defined URL for the resource (output only). #[serde(rename="selfLink")] pub self_link: Option, + /// The request path of the HTTP health check request. The default value is "/". + #[serde(rename="requestPath")] + pub request_path: Option, } -impl ResponseResult for TargetInstanceAggregatedList {} +impl RequestValue for HttpHealthCheck {} +impl Resource for HttpHealthCheck {} +impl ResponseResult for HttpHealthCheck {} /// The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. @@ -2429,36 +1614,46 @@ pub struct UsageExportLocation { impl RequestValue for UsageExportLocation {} -/// [Output Only] Informational warning which replaces the list of addresses when the list is empty. +/// Contains a list of persistent autoscaler resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list autoscalers](struct.AutoscalerListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalerList { + /// A token used to continue a truncated list request (output only). + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of Autoscaler resources. + pub items: Option>, + /// Type of resource. + pub kind: Option, + /// Unique identifier for the resource; defined by the server (output only). + pub id: Option, + /// Server defined URL for this resource (output only). + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for AutoscalerList {} + + +/// CPU utilization policy. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AddressesScopedListWarning { - /// [Output Only] Optional human-readable details for this warning. - pub message: Option, - /// [Output Only] The warning type identifier for this warning. - pub code: Option, - /// [Output Only] Metadata for this warning in key: value format. - pub data: Option>, +pub struct AutoscalingPolicyCpuUtilization { + /// The target utilization that the Autoscaler should maintain. It is represented as a fraction of used cores. For example: 6 cores used in 8-core VM are represented here as 0.75. Must be a float value between (0, 1]. If not defined, the default is 0.8. + #[serde(rename="utilizationTarget")] + pub utilization_target: Option, } -impl NestedType for AddressesScopedListWarning {} -impl Part for AddressesScopedListWarning {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HealthCheckReference { - /// no description provided - #[serde(rename="healthCheck")] - pub health_check: Option, -} - -impl Part for HealthCheckReference {} +impl Part for AutoscalingPolicyCpuUtilization {} /// There is no detailed description. @@ -2468,18 +1663,15 @@ impl Part for HealthCheckReference {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [get health target pools](struct.TargetPoolGetHealthCall.html) (response) +/// * [add instances instance groups](struct.InstanceGroupAddInstanceCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolInstanceHealth { - /// Type of resource. - pub kind: Option, - /// no description provided - #[serde(rename="healthStatus")] - pub health_status: Option>, +pub struct InstanceGroupsAddInstancesRequest { + /// The instances to add to the instance group. + pub instances: Option>, } -impl ResponseResult for TargetPoolInstanceHealth {} +impl RequestValue for InstanceGroupsAddInstancesRequest {} /// There is no detailed description. @@ -2505,7 +1697,7 @@ pub struct TargetVpnGateway { pub description: Option, /// [Output Only] URL of the region where the target VPN gateway resides. pub region: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long and comply with RFC1035. + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. pub name: Option, /// [Output Only] A list of URLs to the ForwardingRule resources. ForwardingRules are created using compute.forwardingRules.insert and associated to a VPN gateway. #[serde(rename="forwardingRules")] @@ -2557,24 +1749,6 @@ pub struct InstanceAggregatedList { impl ResponseResult for InstanceAggregatedList {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [add instance target pools](struct.TargetPoolAddInstanceCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolsAddInstanceRequest { - /// URLs of the instances to be added to targetPool. - pub instances: Option>, -} - -impl RequestValue for TargetPoolsAddInstanceRequest {} - - /// [Output Only] Informational warning which replaces the list of operations when the list is empty. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2593,6 +1767,22 @@ impl NestedType for OperationsScopedListWarning {} impl Part for OperationsScopedListWarning {} +/// [Output Only] Metadata for this warning in key: value format. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalersScopedListWarningData { + /// [Output Only] A key for the warning data. + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for AutoscalersScopedListWarningData {} +impl Part for AutoscalersScopedListWarningData {} + + /// There is no detailed description. /// /// # Activities @@ -2604,7 +1794,7 @@ impl Part for OperationsScopedListWarning {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BackendServiceGroupHealth { - /// Type of resource. + /// [Output Only] Type of resource. Always compute#backendServiceGroupHealth for the health of backend services. pub kind: Option, /// no description provided #[serde(rename="healthStatus")] @@ -2614,24 +1804,6 @@ pub struct BackendServiceGroupHealth { impl ResponseResult for BackendServiceGroupHealth {} -/// [Output Only] Informational warning which replaces the list of addresses when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetVpnGatewaysScopedListWarning { - /// [Output Only] Optional human-readable details for this warning. - pub message: Option, - /// [Output Only] The warning type identifier for this warning. - pub code: Option, - /// [Output Only] Metadata for this warning in key: value format. - pub data: Option>, -} - -impl NestedType for TargetVpnGatewaysScopedListWarning {} -impl Part for TargetVpnGatewaysScopedListWarning {} - - /// There is no detailed description. /// /// # Activities @@ -2688,44 +1860,32 @@ pub struct DiskMoveRequest { impl RequestValue for DiskMoveRequest {} -/// [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. +/// There is no detailed description. /// -/// This property is mutually exclusive with the source property; you can only define one or the other, but not both. +/// # Activities /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list instance group managers](struct.InstanceGroupManagerAggregatedListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AttachedDiskInitializeParams { - /// Specifies the size of the disk in base-2 GB. - #[serde(rename="diskSizeGb")] - pub disk_size_gb: Option, - /// Specifies the disk name. If not specified, the default is to use the name of the instance. - #[serde(rename="diskName")] - pub disk_name: Option, - /// A source image used to create the disk. You can provide a private (custom) image, and Compute Engine will use the corresponding image from your project. For example: - /// - /// global/images/my-private-image - /// - /// Or you can provide an image from a publicly-available project. For example, to use a Debian image from the debian-cloud project, make sure to include the project in the URL: - /// - /// projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD - /// - /// where vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases. - #[serde(rename="sourceImage")] - pub source_image: Option, - /// Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example: - /// - /// https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard - /// - /// Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values: - /// - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType - /// - projects/project/zones/zone/diskTypes/diskType - /// - zones/zone/diskTypes/diskType - #[serde(rename="diskType")] - pub disk_type: Option, +pub struct InstanceGroupManagerAggregatedList { + /// [Output Only] A token that is used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A map of filtered managed instance group lists. + pub items: Option>, + /// [Output Only] Type of the resource. Always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups. + pub kind: Option, + /// [Output Only] A unique identifier for this aggregated list of managed instance groups. The server defines this identifier. + pub id: Option, + /// [Output Only] The URL for this aggregated list of managed instance groups. The server defines this URL. + #[serde(rename="selfLink")] + pub self_link: Option, } -impl Part for AttachedDiskInitializeParams {} +impl ResponseResult for InstanceGroupManagerAggregatedList {} /// [Output Only] Any scheduled maintenance windows for this zone. When the zone is in a maintenance window, all resources which reside in the zone will be unavailable. For more information, see Maintenance Windows @@ -2778,157 +1938,43 @@ pub struct InstanceList { impl ResponseResult for InstanceList {} -/// A TargetPool resource. This resource defines a pool of VMs, associated HttpHealthCheck resources, and the fallback TargetPool. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get health target pools](struct.TargetPoolGetHealthCall.html) (none) -/// * [add instance target pools](struct.TargetPoolAddInstanceCall.html) (none) -/// * [remove instance target pools](struct.TargetPoolRemoveInstanceCall.html) (none) -/// * [remove health check target pools](struct.TargetPoolRemoveHealthCheckCall.html) (none) -/// * [delete target pools](struct.TargetPoolDeleteCall.html) (none) -/// * [insert target pools](struct.TargetPoolInsertCall.html) (request) -/// * [aggregated list target pools](struct.TargetPoolAggregatedListCall.html) (none) -/// * [list target pools](struct.TargetPoolListCall.html) (none) -/// * [add health check target pools](struct.TargetPoolAddHealthCheckCall.html) (none) -/// * [get target pools](struct.TargetPoolGetCall.html) (response) -/// * [set backup target pools](struct.TargetPoolSetBackupCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPool { - /// This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1]. - /// - /// If set, 'backupPool' must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy VMs in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. - /// - /// In case where 'failoverRatio' is not set or all the VMs in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy. - #[serde(rename="failoverRatio")] - pub failover_ratio: Option, - /// An optional textual description of the resource; provided by the client when the resource is created. - pub description: Option, - /// URL of the region where the target pool resides (output only). - pub region: Option, - /// Type of the resource. - pub kind: Option, - /// Sesssion affinity option, must be one of the following values: 'NONE': Connections from the same client IP may go to any VM in the pool; 'CLIENT_IP': Connections from the same client IP will go to the same VM in the pool while that VM remains healthy. 'CLIENT_IP_PROTO': Connections from the same client IP with the same IP protocol will go to the same VM in the pool while that VM remains healthy. - #[serde(rename="sessionAffinity")] - pub session_affinity: Option, - /// A list of resource URLs to the member VMs serving this pool. They must live in zones contained in the same region as this pool. - pub instances: Option>, - /// This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its 'failoverRatio' field is properly set to a value between [0, 1]. - /// - /// 'backupPool' and 'failoverRatio' together define the fallback behavior of the primary target pool: if the ratio of the healthy VMs in the primary pool is at or below 'failoverRatio', traffic arriving at the load-balanced IP will be directed to the backup pool. - /// - /// In case where 'failoverRatio' and 'backupPool' are not set, or all the VMs in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy. - #[serde(rename="backupPool")] - pub backup_pool: Option, - /// A list of URLs to the HttpHealthCheck resource. A member VM in this pool is considered healthy if and only if all specified health checks pass. An empty list means all member VMs will be considered healthy at all times. - #[serde(rename="healthChecks")] - pub health_checks: Option>, - /// Creation timestamp in RFC3339 text format (output only). - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// Unique identifier for the resource; defined by the server (output only). - pub id: Option, - /// Server defined URL for the resource (output only). - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. - pub name: Option, -} - -impl RequestValue for TargetPool {} -impl Resource for TargetPool {} -impl ResponseResult for TargetPool {} - - -/// [Output Only] Metadata for this warning in key: value format. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolsScopedListWarningData { - /// [Output Only] A key for the warning data. - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for TargetPoolsScopedListWarningData {} -impl Part for TargetPoolsScopedListWarningData {} - - /// There is no detailed description. /// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstancesScopedList { - /// [Output Only] List of instances contained in this scope. - pub instances: Option>, - /// [Output Only] Informational warning which replaces the list of instances when the list is empty. - pub warning: Option, -} - -impl Part for InstancesScopedList {} - - -/// A reserved address resource. -/// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [insert global addresses](struct.GlobalAddresseInsertCall.html) (request) -/// * [insert addresses](struct.AddresseInsertCall.html) (request) -/// * [get addresses](struct.AddresseGetCall.html) (response) -/// * [get global addresses](struct.GlobalAddresseGetCall.html) (response) +/// * [set target pools instance group managers](struct.InstanceGroupManagerSetTargetPoolCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Address { - /// [Output Only] The status of the address, which can be either IN_USE or RESERVED. An address that is RESERVED is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available. - pub status: Option, - /// [Output Only] Type of the resource. Always compute#address for addresses. - pub kind: Option, - /// An optional textual description of the resource; provided by the client when the resource is created. - pub description: Option, - /// [Output Only] URL of the region where the regional address resides. This field is not applicable to global addresses. - pub region: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// The static external IP address represented by this resource. - pub address: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output Only] The URLs of the resources that are using this address. - pub users: Option>, +pub struct InstanceGroupManagersSetTargetPoolsRequest { + /// The fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when updating the target pool entries. + pub fingerprint: Option, + /// The list of target pool URLs that instances in this managed instance group belong to. When the managed instance group creates new instances, the group automatically adds those instances to the target pools that are specified in this parameter. Changing the value of this parameter does not change the target pools of existing instances in this managed instance group. + #[serde(rename="targetPools")] + pub target_pools: Option>, } -impl RequestValue for Address {} -impl ResponseResult for Address {} +impl RequestValue for InstanceGroupManagersSetTargetPoolsRequest {} -/// [Output Only] If errors are generated during processing of the operation, this field will be populated. +/// Informational warning which replaces the list of autoscalers when the list is empty. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationError { - /// [Output Only] The array of errors encountered while processing this operation. - pub errors: Option>, +pub struct AutoscalersScopedListWarning { + /// [Output Only] Optional human-readable details for this warning. + pub message: Option, + /// [Output Only] The warning type identifier for this warning. + pub code: Option, + /// [Output Only] Metadata for this warning in key: value format. + pub data: Option>, } -impl NestedType for OperationError {} -impl Part for OperationError {} +impl NestedType for AutoscalersScopedListWarning {} +impl Part for AutoscalersScopedListWarning {} /// The list of rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. @@ -2987,7 +2033,7 @@ pub struct NetworkList { pub items: Option>, /// [Output Only] Type of resource. Always compute#networkList for lists of networks. pub kind: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. + /// [Output Only] Unique identifier for the resource. Defined by the server. pub id: Option, /// [Output Only] Server defined URL for this resource . #[serde(rename="selfLink")] @@ -3025,24 +2071,6 @@ pub struct ZoneList { impl ResponseResult for ZoneList {} -/// [Output Only] An informational warning that appears when the machine types list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineTypesScopedListWarning { - /// [Output Only] Optional human-readable details for this warning. - pub message: Option, - /// [Output Only] The warning type identifier for this warning. - pub code: Option, - /// [Output Only] Metadata for this warning in key: value format. - pub data: Option>, -} - -impl NestedType for MachineTypesScopedListWarning {} -impl Part for MachineTypesScopedListWarning {} - - /// There is no detailed description. /// /// # Activities @@ -3145,33 +2173,6 @@ pub struct HttpHealthCheckList { impl ResponseResult for HttpHealthCheckList {} -/// A license resource. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get licenses](struct.LicenseGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct License { - /// If true, the customer will be charged license fee for running software that contains this license on an instance. - #[serde(rename="chargesUseFee")] - pub charges_use_fee: Option, - /// [Output Only] Type of resource. Always compute#license for licenses. - pub kind: Option, - /// Name of the resource. The name must be 1-63 characters long, and comply with RCF1035. - pub name: Option, - /// [Output Only] Server defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl Resource for License {} -impl ResponseResult for License {} - - /// An instance-attached disk resource. /// /// # Activities @@ -3218,162 +2219,28 @@ pub struct AttachedDisk { impl RequestValue for AttachedDisk {} -/// A quotas entry. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Quota { - /// [Output Only] Current usage of this metric. - pub usage: Option, - /// [Output Only] Name of the quota metric. - pub metric: Option, - /// [Output Only] Quota limit for this metric. - pub limit: Option, -} - -impl Part for Quota {} - - -/// The route resource. A Route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with VMs by tag and the set of Routes for a particular VM is called its routing table. For each packet leaving a VM, the system searches that VM's routing table for a single best matching Route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the Route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching Routes. The packet is then forwarded as specified by the next_hop field of the winning Route -- either to another VM destination, a VM gateway or a GCE operated gateway. Packets that do not match any Route in the sending VM's routing table will be dropped. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list routes](struct.RouteListCall.html) (none) -/// * [insert routes](struct.RouteInsertCall.html) (request) -/// * [delete routes](struct.RouteDeleteCall.html) (none) -/// * [get routes](struct.RouteGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Route { - /// The URL to a gateway that should handle matching packets. - #[serde(rename="nextHopGateway")] - pub next_hop_gateway: Option, - /// An optional textual description of the resource; provided by the client when the resource is created. - pub description: Option, - /// A list of instance tags to which this route applies. - pub tags: Option>, - /// The URL of the local network if it should handle matching packets. - #[serde(rename="nextHopNetwork")] - pub next_hop_network: Option, - /// Which packets does this route apply to? - #[serde(rename="destRange")] - pub dest_range: Option, - /// Creation timestamp in RFC3339 text format (output only). - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// Unique identifier for the resource; defined by the server (output only). +pub struct ManagedInstance { + /// The current action that the managed instance group has scheduled for the instance. + #[serde(rename="currentAction")] + pub current_action: Option, + /// The URL of the instance (set even though instance does not exist yet). + pub instance: Option, + /// Information about the last attempt to create or delete the instance. + #[serde(rename="lastAttempt")] + pub last_attempt: Option, + /// The unique identifier for this resource (empty when instance does not exist). pub id: Option, - /// The network IP address of an instance that should handle matching packets. - #[serde(rename="nextHopIp")] - pub next_hop_ip: Option, - /// URL of the network to which this route is applied; provided by the client when the route is created. - pub network: Option, - /// Type of the resource. - pub kind: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. - pub name: Option, - /// The URL to an instance that should handle matching packets. - #[serde(rename="nextHopInstance")] - pub next_hop_instance: Option, - /// If potential misconfigurations are detected for this route, this field will be populated with warning messages. - pub warnings: Option>, - /// Breaks ties between Routes of equal specificity. Routes with smaller values win when tied with routes with larger values. Default value is 1000. A valid range is between 0 and 65535. - pub priority: Option, - /// The URL to a VpnTunnel that should handle matching packets. - #[serde(rename="nextHopVpnTunnel")] - pub next_hop_vpn_tunnel: Option, - /// Server defined URL for the resource (output only). - #[serde(rename="selfLink")] - pub self_link: Option, + /// The status of the instance (empty when instance does not exist). + #[serde(rename="instanceStatus")] + pub instance_status: Option, } -impl RequestValue for Route {} -impl Resource for Route {} -impl ResponseResult for Route {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetVpnGatewaysScopedList { - /// [Output Only] List of target vpn gateways contained in this scope. - #[serde(rename="targetVpnGateways")] - pub target_vpn_gateways: Option>, - /// [Output Only] Informational warning which replaces the list of addresses when the list is empty. - pub warning: Option, -} - -impl Part for TargetVpnGatewaysScopedList {} - - -/// [Output Only] Metadata for this warning in key: value format. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskTypesScopedListWarningData { - /// [Output Only] A key for the warning data. - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for DiskTypesScopedListWarningData {} -impl Part for DiskTypesScopedListWarningData {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set target forwarding rules](struct.ForwardingRuleSetTargetCall.html) (request) -/// * [set backup target pools](struct.TargetPoolSetBackupCall.html) (request) -/// * [set target global forwarding rules](struct.GlobalForwardingRuleSetTargetCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetReference { - /// no description provided - pub target: Option, -} - -impl RequestValue for TargetReference {} - - -/// A network interface resource attached to an instance. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkInterface { - /// An array of configurations for this interface. Currently, >, - /// [Output Only] An optional IPV4 internal network address assigned to the instance for this network interface. - #[serde(rename="networkIP")] - pub network_ip: Option, - /// [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc. - pub name: Option, - /// URL of the network resource for this instance. This is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used: - /// - /// global/networks/default - /// - /// If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: - /// - https://www.googleapis.com/compute/v1/projects/project/global/networks/network - /// - projects/project/global/networks/network - /// - global/networks/default - pub network: Option, -} - -impl Part for NetworkInterface {} +impl Part for ManagedInstance {} /// There is no detailed description. @@ -3387,16 +2254,16 @@ impl Part for NetworkInterface {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ForwardingRuleAggregatedList { - /// A token used to continue a truncated list request (output only). + /// [Output Only] A token used to continue a truncated list request. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// A map of scoped forwarding rule lists. pub items: Option>, /// Type of resource. pub kind: Option, - /// Unique identifier for the resource; defined by the server (output only). + /// [Output Only] Unique identifier for the resource; defined by the server. pub id: Option, - /// Server defined URL for this resource (output only). + /// [Output Only] Server defined URL for this resource. #[serde(rename="selfLink")] pub self_link: Option, } @@ -3425,34 +2292,6 @@ pub struct TestFailure { impl Part for TestFailure {} -/// Contains a list of VpnTunnel resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list vpn tunnels](struct.VpnTunnelListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VpnTunnelList { - /// [Output Only] A token used to continue a truncated list request. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] A list of VpnTunnel resources. - pub items: Option>, - /// [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. - pub kind: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for VpnTunnelList {} - - /// There is no detailed description. /// /// # Activities @@ -3481,171 +2320,105 @@ pub struct TargetPoolAggregatedList { impl ResponseResult for TargetPoolAggregatedList {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstancesScopedList { - /// List of target instances contained in this scope. - #[serde(rename="targetInstances")] - pub target_instances: Option>, - /// Informational warning which replaces the list of addresses when the list is empty. - pub warning: Option, -} - -impl Part for TargetInstancesScopedList {} - - -/// A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. +/// An Operation resource, used to manage asynchronous API requests. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [update url maps](struct.UrlMapUpdateCall.html) (request) -/// * [insert url maps](struct.UrlMapInsertCall.html) (request) -/// * [list url maps](struct.UrlMapListCall.html) (none) -/// * [validate url maps](struct.UrlMapValidateCall.html) (none) -/// * [delete url maps](struct.UrlMapDeleteCall.html) (none) -/// * [get url maps](struct.UrlMapGetCall.html) (response) -/// * [patch url maps](struct.UrlMapPatchCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlMap { - /// Type of the resource. - pub kind: Option, - /// An optional textual description of the resource; provided by the client when the resource is created. - pub description: Option, - /// The URL of the BackendService resource if none of the hostRules match. - #[serde(rename="defaultService")] - pub default_service: Option, - /// The list of expected URL mappings. Request to update this UrlMap will succeed only all of the test cases pass. - pub tests: Option>, - /// The list of HostRules to use against the URL. - #[serde(rename="hostRules")] - pub host_rules: Option>, - /// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a UrlMap. An up-to-date fingerprint must be provided in order to update the UrlMap. - pub fingerprint: Option, - /// The list of named PathMatchers to use against the URL. - #[serde(rename="pathMatchers")] - pub path_matchers: Option>, - /// Creation timestamp in RFC3339 text format (output only). - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// Unique identifier for the resource; defined by the server (output only). - pub id: Option, - /// Server defined URL for the resource (output only). - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. - pub name: Option, -} - -impl RequestValue for UrlMap {} -impl Resource for UrlMap {} -impl ResponseResult for UrlMap {} - - -/// [Output Only] Metadata for this warning in key: value format. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouteWarningsData { - /// [Output Only] A key for the warning data. - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for RouteWarningsData {} -impl Part for RouteWarningsData {} - - -/// An operation resource, used to manage asynchronous API requests. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [delete target instances](struct.TargetInstanceDeleteCall.html) (response) -/// * [stop instances](struct.InstanceStopCall.html) (response) -/// * [add instance target pools](struct.TargetPoolAddInstanceCall.html) (response) -/// * [add health check target pools](struct.TargetPoolAddHealthCheckCall.html) (response) -/// * [remove health check target pools](struct.TargetPoolRemoveHealthCheckCall.html) (response) -/// * [update backend services](struct.BackendServiceUpdateCall.html) (response) -/// * [delete target pools](struct.TargetPoolDeleteCall.html) (response) -/// * [update firewalls](struct.FirewallUpdateCall.html) (response) -/// * [insert networks](struct.NetworkInsertCall.html) (response) -/// * [insert addresses](struct.AddresseInsertCall.html) (response) -/// * [patch backend services](struct.BackendServicePatchCall.html) (response) -/// * [set tags instances](struct.InstanceSetTagCall.html) (response) -/// * [set disk auto delete instances](struct.InstanceSetDiskAutoDeleteCall.html) (response) -/// * [insert target http proxies](struct.TargetHttpProxyInsertCall.html) (response) -/// * [set usage export bucket projects](struct.ProjectSetUsageExportBucketCall.html) (response) -/// * [update url maps](struct.UrlMapUpdateCall.html) (response) -/// * [insert instance templates](struct.InstanceTemplateInsertCall.html) (response) +/// * [resize instance group managers](struct.InstanceGroupManagerResizeCall.html) (response) +/// * [patch autoscalers](struct.AutoscalerPatchCall.html) (response) /// * [patch firewalls](struct.FirewallPatchCall.html) (response) /// * [delete vpn tunnels](struct.VpnTunnelDeleteCall.html) (response) -/// * [delete firewalls](struct.FirewallDeleteCall.html) (response) -/// * [detach disk instances](struct.InstanceDetachDiskCall.html) (response) -/// * [delete access config instances](struct.InstanceDeleteAccessConfigCall.html) (response) -/// * [delete backend services](struct.BackendServiceDeleteCall.html) (response) /// * [insert instances](struct.InstanceInsertCall.html) (response) +/// * [delete global forwarding rules](struct.GlobalForwardingRuleDeleteCall.html) (response) +/// * [insert vpn tunnels](struct.VpnTunnelInsertCall.html) (response) +/// * [delete disks](struct.DiskDeleteCall.html) (response) +/// * [add instances instance groups](struct.InstanceGroupAddInstanceCall.html) (response) +/// * [delete target http proxies](struct.TargetHttpProxyDeleteCall.html) (response) +/// * [set scheduling instances](struct.InstanceSetSchedulingCall.html) (response) +/// * [delete instances](struct.InstanceDeleteCall.html) (response) +/// * [add health check target pools](struct.TargetPoolAddHealthCheckCall.html) (response) +/// * [insert instance group managers](struct.InstanceGroupManagerInsertCall.html) (response) +/// * [insert global addresses](struct.GlobalAddresseInsertCall.html) (response) /// * [set target global forwarding rules](struct.GlobalForwardingRuleSetTargetCall.html) (response) +/// * [insert autoscalers](struct.AutoscalerInsertCall.html) (response) +/// * [insert instance groups](struct.InstanceGroupInsertCall.html) (response) +/// * [delete instances instance group managers](struct.InstanceGroupManagerDeleteInstanceCall.html) (response) +/// * [set instance template instance group managers](struct.InstanceGroupManagerSetInstanceTemplateCall.html) (response) +/// * [insert target pools](struct.TargetPoolInsertCall.html) (response) +/// * [set disk auto delete instances](struct.InstanceSetDiskAutoDeleteCall.html) (response) +/// * [set target pools instance group managers](struct.InstanceGroupManagerSetTargetPoolCall.html) (response) +/// * [insert disks](struct.DiskInsertCall.html) (response) +/// * [remove health check target pools](struct.TargetPoolRemoveHealthCheckCall.html) (response) +/// * [delete backend services](struct.BackendServiceDeleteCall.html) (response) /// * [insert url maps](struct.UrlMapInsertCall.html) (response) /// * [add access config instances](struct.InstanceAddAccessConfigCall.html) (response) -/// * [delete target vpn gateways](struct.TargetVpnGatewayDeleteCall.html) (response) -/// * [get region operations](struct.RegionOperationGetCall.html) (response) -/// * [insert backend services](struct.BackendServiceInsertCall.html) (response) -/// * [get global operations](struct.GlobalOperationGetCall.html) (response) -/// * [insert disks](struct.DiskInsertCall.html) (response) -/// * [delete instance templates](struct.InstanceTemplateDeleteCall.html) (response) -/// * [delete global forwarding rules](struct.GlobalForwardingRuleDeleteCall.html) (response) +/// * [insert addresses](struct.AddresseInsertCall.html) (response) /// * [insert global forwarding rules](struct.GlobalForwardingRuleInsertCall.html) (response) -/// * [delete disks](struct.DiskDeleteCall.html) (response) -/// * [delete global addresses](struct.GlobalAddresseDeleteCall.html) (response) -/// * [set common instance metadata projects](struct.ProjectSetCommonInstanceMetadataCall.html) (response) -/// * [insert target pools](struct.TargetPoolInsertCall.html) (response) -/// * [delete target http proxies](struct.TargetHttpProxyDeleteCall.html) (response) -/// * [delete networks](struct.NetworkDeleteCall.html) (response) -/// * [insert target vpn gateways](struct.TargetVpnGatewayInsertCall.html) (response) -/// * [delete url maps](struct.UrlMapDeleteCall.html) (response) -/// * [set scheduling instances](struct.InstanceSetSchedulingCall.html) (response) -/// * [attach disk instances](struct.InstanceAttachDiskCall.html) (response) +/// * [get global operations](struct.GlobalOperationGetCall.html) (response) /// * [delete addresses](struct.AddresseDeleteCall.html) (response) -/// * [reset instances](struct.InstanceResetCall.html) (response) -/// * [set url map target http proxies](struct.TargetHttpProxySetUrlMapCall.html) (response) +/// * [insert target vpn gateways](struct.TargetVpnGatewayInsertCall.html) (response) /// * [create snapshot disks](struct.DiskCreateSnapshotCall.html) (response) -/// * [insert routes](struct.RouteInsertCall.html) (response) -/// * [insert global addresses](struct.GlobalAddresseInsertCall.html) (response) -/// * [deprecate images](struct.ImageDeprecateCall.html) (response) -/// * [patch http health checks](struct.HttpHealthCheckPatchCall.html) (response) -/// * [delete http health checks](struct.HttpHealthCheckDeleteCall.html) (response) +/// * [remove instances instance groups](struct.InstanceGroupRemoveInstanceCall.html) (response) /// * [set metadata instances](struct.InstanceSetMetadataCall.html) (response) -/// * [insert http health checks](struct.HttpHealthCheckInsertCall.html) (response) -/// * [delete images](struct.ImageDeleteCall.html) (response) -/// * [delete snapshots](struct.SnapshotDeleteCall.html) (response) /// * [insert forwarding rules](struct.ForwardingRuleInsertCall.html) (response) -/// * [insert images](struct.ImageInsertCall.html) (response) /// * [start instances](struct.InstanceStartCall.html) (response) -/// * [set backup target pools](struct.TargetPoolSetBackupCall.html) (response) +/// * [delete instance group managers](struct.InstanceGroupManagerDeleteCall.html) (response) /// * [insert target instances](struct.TargetInstanceInsertCall.html) (response) -/// * [delete forwarding rules](struct.ForwardingRuleDeleteCall.html) (response) -/// * [move instance projects](struct.ProjectMoveInstanceCall.html) (response) /// * [set target forwarding rules](struct.ForwardingRuleSetTargetCall.html) (response) /// * [move disk projects](struct.ProjectMoveDiskCall.html) (response) -/// * [insert vpn tunnels](struct.VpnTunnelInsertCall.html) (response) /// * [insert firewalls](struct.FirewallInsertCall.html) (response) +/// * [set backup target pools](struct.TargetPoolSetBackupCall.html) (response) +/// * [insert routes](struct.RouteInsertCall.html) (response) +/// * [delete instance groups](struct.InstanceGroupDeleteCall.html) (response) +/// * [delete access config instances](struct.InstanceDeleteAccessConfigCall.html) (response) +/// * [insert networks](struct.NetworkInsertCall.html) (response) +/// * [abandon instances instance group managers](struct.InstanceGroupManagerAbandonInstanceCall.html) (response) +/// * [set tags instances](struct.InstanceSetTagCall.html) (response) +/// * [delete snapshots](struct.SnapshotDeleteCall.html) (response) +/// * [detach disk instances](struct.InstanceDetachDiskCall.html) (response) +/// * [update backend services](struct.BackendServiceUpdateCall.html) (response) +/// * [recreate instances instance group managers](struct.InstanceGroupManagerRecreateInstanceCall.html) (response) +/// * [delete images](struct.ImageDeleteCall.html) (response) +/// * [set common instance metadata projects](struct.ProjectSetCommonInstanceMetadataCall.html) (response) +/// * [get region operations](struct.RegionOperationGetCall.html) (response) +/// * [patch backend services](struct.BackendServicePatchCall.html) (response) +/// * [set url map target http proxies](struct.TargetHttpProxySetUrlMapCall.html) (response) +/// * [deprecate images](struct.ImageDeprecateCall.html) (response) +/// * [patch http health checks](struct.HttpHealthCheckPatchCall.html) (response) +/// * [insert images](struct.ImageInsertCall.html) (response) +/// * [set named ports instance groups](struct.InstanceGroupSetNamedPortCall.html) (response) +/// * [move instance projects](struct.ProjectMoveInstanceCall.html) (response) +/// * [delete autoscalers](struct.AutoscalerDeleteCall.html) (response) +/// * [patch url maps](struct.UrlMapPatchCall.html) (response) +/// * [stop instances](struct.InstanceStopCall.html) (response) +/// * [add instance target pools](struct.TargetPoolAddInstanceCall.html) (response) /// * [remove instance target pools](struct.TargetPoolRemoveInstanceCall.html) (response) -/// * [delete instances](struct.InstanceDeleteCall.html) (response) +/// * [delete target pools](struct.TargetPoolDeleteCall.html) (response) +/// * [update firewalls](struct.FirewallUpdateCall.html) (response) +/// * [delete instance templates](struct.InstanceTemplateDeleteCall.html) (response) +/// * [set usage export bucket projects](struct.ProjectSetUsageExportBucketCall.html) (response) +/// * [insert target http proxies](struct.TargetHttpProxyInsertCall.html) (response) +/// * [delete networks](struct.NetworkDeleteCall.html) (response) +/// * [insert instance templates](struct.InstanceTemplateInsertCall.html) (response) +/// * [delete target instances](struct.TargetInstanceDeleteCall.html) (response) +/// * [delete target vpn gateways](struct.TargetVpnGatewayDeleteCall.html) (response) +/// * [delete global addresses](struct.GlobalAddresseDeleteCall.html) (response) +/// * [update url maps](struct.UrlMapUpdateCall.html) (response) +/// * [delete url maps](struct.UrlMapDeleteCall.html) (response) +/// * [reset instances](struct.InstanceResetCall.html) (response) +/// * [insert backend services](struct.BackendServiceInsertCall.html) (response) +/// * [delete http health checks](struct.HttpHealthCheckDeleteCall.html) (response) +/// * [insert http health checks](struct.HttpHealthCheckInsertCall.html) (response) +/// * [attach disk instances](struct.InstanceAttachDiskCall.html) (response) +/// * [update autoscalers](struct.AutoscalerUpdateCall.html) (response) +/// * [delete forwarding rules](struct.ForwardingRuleDeleteCall.html) (response) +/// * [delete firewalls](struct.FirewallDeleteCall.html) (response) /// * [get zone operations](struct.ZoneOperationGetCall.html) (response) /// * [update http health checks](struct.HttpHealthCheckUpdateCall.html) (response) /// * [delete routes](struct.RouteDeleteCall.html) (response) -/// * [patch url maps](struct.UrlMapPatchCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Operation { @@ -3667,7 +2440,7 @@ pub struct Operation { /// [Output Only] The time that this operation was started by the server. This is in RFC3339 text format. #[serde(rename="startTime")] pub start_time: Option, - /// [Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project. + /// [Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project. #[serde(rename="clientOperationId")] pub client_operation_id: Option, /// [Output Only] Creation timestamp in RFC3339 text format. @@ -3717,128 +2490,15 @@ impl ResponseResult for Operation {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [remove instance target pools](struct.TargetPoolRemoveInstanceCall.html) (request) +/// * [delete instances instance group managers](struct.InstanceGroupManagerDeleteInstanceCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolsRemoveInstanceRequest { - /// URLs of the instances to be removed from targetPool. - pub instances: Option>, +pub struct InstanceGroupManagersDeleteInstancesRequest { + /// The names of one or more instances to delete. + pub instances: Option>, } -impl RequestValue for TargetPoolsRemoveInstanceRequest {} - - -/// Contains a list of TargetPool resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list target pools](struct.TargetPoolListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolList { - /// A token used to continue a truncated list request (output only). - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// A list of TargetPool resources. - pub items: Option>, - /// Type of resource. - pub kind: Option, - /// Unique identifier for the resource; defined by the server (output only). - pub id: Option, - /// Server defined URL for this resource (output only). - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for TargetPoolList {} - - -/// -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceProperties { - /// A boolean that specifies if instances created from this template can send packets with source IP addresses other than their own or receive packets with destination IP addresses other than their own. If you use these instances as an IP gateway or as the next-hop in a Route resource, specify true. Otherwise, specify false. - #[serde(rename="canIpForward")] - pub can_ip_forward: Option, - /// An optional text description for the instances that are created from this instance template. - pub description: Option, - /// A list of tags to apply to the instances that are created from this template. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. - pub tags: Option, - /// An array of disks that are associated with the instances that are created from this template. - pub disks: Option>, - /// A list of scheduling options for the instances that are created from this template. - pub scheduling: Option, - /// The machine type to use for instances that are created from this template. - #[serde(rename="machineType")] - pub machine_type: Option, - /// A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this template. Use metadata queries to obtain the access tokens for these instances. - #[serde(rename="serviceAccounts")] - pub service_accounts: Option>, - /// An array of network access configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only supported access configuration. If you do not specify any access configurations, the instances that are created from this template will have no external internet access. - #[serde(rename="networkInterfaces")] - pub network_interfaces: Option>, - /// The metadata key/value pairs to assign to instances that are created from this template. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information. - pub metadata: Option, -} - -impl Part for InstanceProperties {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [remove health check target pools](struct.TargetPoolRemoveHealthCheckCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolsRemoveHealthCheckRequest { - /// Health check URLs to be removed from targetPool. - #[serde(rename="healthChecks")] - pub health_checks: Option>, -} - -impl RequestValue for TargetPoolsRemoveHealthCheckRequest {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DisksScopedList { - /// [Output Only] List of disks contained in this scope. - pub disks: Option>, - /// [Output Only] Informational warning which replaces the list of disks when the list is empty. - pub warning: Option, -} - -impl Part for DisksScopedList {} - - -/// Informational warning which replaces the list of addresses when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VpnTunnelsScopedListWarning { - /// [Output Only] Optional human-readable details for this warning. - pub message: Option, - /// [Output Only] The warning type identifier for this warning. - pub code: Option, - /// [Output Only] Metadata for this warning in key: value format. - pub data: Option>, -} - -impl NestedType for VpnTunnelsScopedListWarning {} -impl Part for VpnTunnelsScopedListWarning {} +impl RequestValue for InstanceGroupManagersDeleteInstancesRequest {} /// An Image resource. @@ -3952,6 +2612,35 @@ impl NestedType for ImageRawDisk {} impl Part for ImageRawDisk {} +/// Cloud Autoscaler policy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalingPolicy { + /// Configuration parameters of autoscaling based on custom metric. + #[serde(rename="customMetricUtilizations")] + pub custom_metric_utilizations: Option>, + /// The maximum number of replicas that the Autoscaler can scale up to. This field is required for config to be effective. Maximum number of replicas should be not lower than minimal number of replicas. Absolute limit for this value is defined in Autoscaler backend. + #[serde(rename="maxNumReplicas")] + pub max_num_replicas: Option, + /// TODO(jbartosik): Add support for scaling based on muliple utilization metrics (take max recommendation). Exactly one utilization policy should be provided. Configuration parameters of CPU based autoscaling policy. + #[serde(rename="cpuUtilization")] + pub cpu_utilization: Option, + /// The minimum number of replicas that the Autoscaler can scale down to. Can't be less than 0. If not provided Autoscaler will choose default value depending on maximal number of replicas. + #[serde(rename="minNumReplicas")] + pub min_num_replicas: Option, + /// The number of seconds that the Autoscaler should wait between two succeeding changes to the number of virtual machines. You should define an interval that is at least as long as the initialization time of a virtual machine and the time it may take for replica pool to create the virtual machine. The default is 60 seconds. + #[serde(rename="coolDownPeriodSec")] + pub cool_down_period_sec: Option, + /// Configuration parameters of autoscaling based on load balancer. + #[serde(rename="loadBalancingUtilization")] + pub load_balancing_utilization: Option, +} + +impl Part for AutoscalingPolicy {} + + /// [Output Only] Metadata for this warning in key: value format. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3979,11 +2668,575 @@ impl Part for OperationsScopedListWarningData {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BackendServiceList { - /// A token used to continue a truncated list request (output only). + /// [Output Only] A token used to continue a truncated list request. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// A list of BackendService resources. pub items: Option>, + /// [Output Only] Type of resource. Always compute#backendServiceList for lists of backend services. + pub kind: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for BackendServiceList {} + + +/// Load balancing utilization policy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalingPolicyLoadBalancingUtilization { + /// Fraction of backend capacity utilization (set in HTTP load balancing configuration) that Autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. For example if your maxRatePerInstance capacity (in HTTP Load Balancing configuration) is set at 10 and you would like to keep number of instances such that each instance receives 7 QPS on average, set this to 0.7. + #[serde(rename="utilizationTarget")] + pub utilization_target: Option, +} + +impl Part for AutoscalingPolicyLoadBalancingUtilization {} + + +/// Contains a list of region resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list regions](struct.RegionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionList { + /// [Output Only] A token used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] A list of Region resources. + pub items: Option>, + /// [Output Only] Type of resource. Always compute#regionList for lists of regions. + pub kind: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for RegionList {} + + +/// Message containing information of one individual backend. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Backend { + /// A multiplier applied to the group's maximum servicing capacity (either UTILIZATION or RATE). Default value is 1, which means the group will serve up to 100% of its configured CPU or RPS (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available CPU or RPS. Valid range is [0.0,1.0]. + #[serde(rename="capacityScaler")] + pub capacity_scaler: Option, + /// The max RPS of the group. Can be used with either balancing mode, but required if RATE mode. For RATE mode, either maxRate or maxRatePerInstance must be set. + #[serde(rename="maxRate")] + pub max_rate: Option, + /// The fully-qualified URL of a zonal Instance Group resource. This instance group defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource. + /// + /// Note that you must specify an Instance Group resource using the fully-qualified URL, rather than a partial URL. + pub group: Option, + /// An optional textual description of the resource. Provided by the client when the resource is created. + pub description: Option, + /// Used when balancingMode is UTILIZATION. This ratio defines the CPU utilization target for the group. The default is 0.8. Valid range is [0.0, 1.0]. + #[serde(rename="maxUtilization")] + pub max_utilization: Option, + /// The max RPS that a single backed instance can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerInstance must be set. + #[serde(rename="maxRatePerInstance")] + pub max_rate_per_instance: Option, + /// Specifies the balancing mode for this backend. The default is UTILIZATION but available values are UTILIZATION and RATE. + #[serde(rename="balancingMode")] + pub balancing_mode: Option, +} + +impl Part for Backend {} + + +/// An instance's serial console output. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get serial port output instances](struct.InstanceGetSerialPortOutputCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SerialPortOutput { + /// [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output. + pub kind: Option, + /// [Output Only] The contents of the console output. + pub contents: Option, + /// [Output Only] Server defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for SerialPortOutput {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationsScopedList { + /// [Output Only] List of operations contained in this scope. + pub operations: Option>, + /// [Output Only] Informational warning which replaces the list of operations when the list is empty. + pub warning: Option, +} + +impl Part for OperationsScopedList {} + + +/// [Output Only] Informational warning which replaces the list of instances when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstancesScopedListWarning { + /// [Output Only] Optional human-readable details for this warning. + pub message: Option, + /// [Output Only] The warning type identifier for this warning. + pub code: Option, + /// [Output Only] Metadata for this warning in key: value format. + pub data: Option>, +} + +impl NestedType for InstancesScopedListWarning {} +impl Part for InstancesScopedListWarning {} + + +/// An Instance resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get serial port output instances](struct.InstanceGetSerialPortOutputCall.html) (none) +/// * [attach disk instances](struct.InstanceAttachDiskCall.html) (none) +/// * [insert instances](struct.InstanceInsertCall.html) (request) +/// * [stop instances](struct.InstanceStopCall.html) (none) +/// * [set metadata instances](struct.InstanceSetMetadataCall.html) (none) +/// * [start instances](struct.InstanceStartCall.html) (none) +/// * [detach disk instances](struct.InstanceDetachDiskCall.html) (none) +/// * [delete access config instances](struct.InstanceDeleteAccessConfigCall.html) (none) +/// * [get instances](struct.InstanceGetCall.html) (response) +/// * [set tags instances](struct.InstanceSetTagCall.html) (none) +/// * [set scheduling instances](struct.InstanceSetSchedulingCall.html) (none) +/// * [list instances](struct.InstanceListCall.html) (none) +/// * [delete instances](struct.InstanceDeleteCall.html) (none) +/// * [reset instances](struct.InstanceResetCall.html) (none) +/// * [aggregated list instances](struct.InstanceAggregatedListCall.html) (none) +/// * [add access config instances](struct.InstanceAddAccessConfigCall.html) (none) +/// * [set disk auto delete instances](struct.InstanceSetDiskAutoDeleteCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Instance { + /// [Output Only] The CPU platform used by this instance. + #[serde(rename="cpuPlatform")] + pub cpu_platform: Option, + /// [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, and TERMINATED. + pub status: Option, + /// Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding. + #[serde(rename="canIpForward")] + pub can_ip_forward: Option, + /// An optional textual description of the resource; provided by the client when the resource is created. + pub description: Option, + /// A list of tags to appy to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035. + pub tags: Option, + /// Scheduling options for this instance. + pub scheduling: Option, + /// Full or partial URL of the machine type resource to use for this instance. This is provided by the client when the instance is created. For example, the following is a valid partial url: + /// + /// zones/zone/machineTypes/machine-type + #[serde(rename="machineType")] + pub machine_type: Option, + /// A list of service accounts, with their specified scopes, authorized for this instance. Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Authenticating from Google Compute Engine for more information. + #[serde(rename="serviceAccounts")] + pub service_accounts: Option>, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// An array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. + #[serde(rename="networkInterfaces")] + pub network_interfaces: Option>, + /// [Output Only] Type of the resource. Always compute#instance for instances. + pub kind: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// [Output Only] URL of the zone where the instance resides. + pub zone: Option, + /// Array of disks associated with this instance. Persistent disks must be created before you can assign them. + pub disks: Option>, + /// [Output Only] Server defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] An optional, human-readable explanation of the status. + #[serde(rename="statusMessage")] + pub status_message: Option, + /// The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys. + pub metadata: Option, +} + +impl RequestValue for Instance {} +impl Resource for Instance {} +impl ResponseResult for Instance {} + + +/// [Output Only] List of extended scratch disks assigned to the instance. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MachineTypeScratchDisks { + /// Size of the scratch disk, defined in GB. + #[serde(rename="diskGb")] + pub disk_gb: Option, +} + +impl NestedType for MachineTypeScratchDisks {} +impl Part for MachineTypeScratchDisks {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [add instance target pools](struct.TargetPoolAddInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolsAddInstanceRequest { + /// URLs of the instances to be added to targetPool. + pub instances: Option>, +} + +impl RequestValue for TargetPoolsAddInstanceRequest {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddressesScopedList { + /// [Output Only] Informational warning which replaces the list of addresses when the list is empty. + pub warning: Option, + /// [Output Only] List of addresses contained in this scope. + pub addresses: Option>, +} + +impl Part for AddressesScopedList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagerAutoHealingPolicy { + /// The URL for the HealthCheck that signals autohealing. + #[serde(rename="healthCheck")] + pub health_check: Option, + /// The action to perform when an instance becomes unhealthy. Possible values are RECREATE or RESTART. RECREATE replaces an unhealthy instance with a new instance that is based on the instance template for this managed instance group. RESTART performs a soft restart on an instance. If the instance cannot restart softly, the instance performs a hard restart. + #[serde(rename="actionType")] + pub action_type: Option, +} + +impl Part for InstanceGroupManagerAutoHealingPolicy {} + + +/// [Output Only] Informational warning which replaces the list of disk types when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskTypesScopedListWarning { + /// [Output Only] Optional human-readable details for this warning. + pub message: Option, + /// [Output Only] The warning type identifier for this warning. + pub code: Option, + /// [Output Only] Metadata for this warning in key: value format. + pub data: Option>, +} + +impl NestedType for DiskTypesScopedListWarning {} +impl Part for DiskTypesScopedListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list instance groups](struct.InstanceGroupAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupAggregatedList { + /// [Output Only] A token that is used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A map of scoped instance group lists. + pub items: Option>, + /// [Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups. + pub kind: Option, + /// [Output Only] A unique identifier for this aggregated list of instance groups. The server defines this identifier. + pub id: Option, + /// [Output Only] A unique identifier for this aggregated list of instance groups. The server defines this identifier. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for InstanceGroupAggregatedList {} + + +/// A set of instance tags. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set tags instances](struct.InstanceSetTagCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Tags { + /// An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. + pub items: Option>, + /// Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata. + /// + /// To see the latest fingerprint, make get() request to the instance. + pub fingerprint: Option, +} + +impl RequestValue for Tags {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [validate url maps](struct.UrlMapValidateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapsValidateRequest { + /// Content of the UrlMap to be validated. + pub resource: Option, +} + +impl RequestValue for UrlMapsValidateRequest {} + + +/// Custom utilization metric policy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalingPolicyCustomMetricUtilization { + /// Identifier of the metric. It should be a Cloud Monitoring metric. The metric can not have negative values. The metric should be an utilization metric (increasing number of VMs handling requests x times should reduce average value of the metric roughly x times). For example you could use: compute.googleapis.com/instance/network/received_bytes_count. + pub metric: Option, + /// Defines type in which utilization_target is expressed. + #[serde(rename="utilizationTargetType")] + pub utilization_target_type: Option, + /// Target value of the metric which Autoscaler should maintain. Must be a positive value. + #[serde(rename="utilizationTarget")] + pub utilization_target: Option, +} + +impl Part for AutoscalingPolicyCustomMetricUtilization {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list disks](struct.DiskAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskAggregatedList { + /// [Output Only] A token used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] A map of scoped disk lists. + pub items: Option>, + /// [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks. + pub kind: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for DiskAggregatedList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list global operations](struct.GlobalOperationAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationAggregatedList { + /// [Output Only] A token used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] A map of scoped operation lists. + pub items: Option>, + /// [Output Only] Type of resource. Always compute#operationAggregatedList for aggregated lists of operations. + pub kind: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for OperationAggregatedList {} + + +/// [Output Only] Metadata for this warning in key: value format. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DisksScopedListWarningData { + /// [Output Only] A key for the warning data. + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for DisksScopedListWarningData {} +impl Part for DisksScopedListWarningData {} + + +/// [Output Only] Metadata for this warning in key: value format. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstancesScopedListWarningData { + /// [Output Only] A key for the warning data. + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for InstancesScopedListWarningData {} +impl Part for InstancesScopedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list addresses](struct.AddresseAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddressAggregatedList { + /// [Output Only] A token used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] A map of scoped address lists. + pub items: Option>, + /// [Output Only] Type of resource. Always compute#addressAggregatedList for aggregated lists of addresses. + pub kind: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for AddressAggregatedList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list instances instance groups](struct.InstanceGroupListInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupsListInstancesRequest { + /// A filter for the named ports that are associated with instances in the instance group. If you specify this parameter, the generated list includes only instances that are associated with the specified named ports. If you do not specify this parameter, the generated list includes all instances regardless of their named ports. + #[serde(rename="portName")] + pub port_name: Option, + /// A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state. + #[serde(rename="instanceState")] + pub instance_state: Option, +} + +impl RequestValue for InstanceGroupsListInstancesRequest {} + + +/// Informational warning which replaces the list of addresses when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolsScopedListWarning { + /// [Output Only] Optional human-readable details for this warning. + pub message: Option, + /// [Output Only] The warning type identifier for this warning. + pub code: Option, + /// [Output Only] Metadata for this warning in key: value format. + pub data: Option>, +} + +impl NestedType for TargetPoolsScopedListWarning {} +impl Part for TargetPoolsScopedListWarning {} + + +/// Contains a list of Snapshot resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list snapshots](struct.SnapshotListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SnapshotList { + /// A token used to continue a truncated list request (output only). + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of Snapshot resources. + pub items: Option>, /// Type of resource. pub kind: Option, /// Unique identifier for the resource; defined by the server (output only). @@ -3993,7 +3246,716 @@ pub struct BackendServiceList { pub self_link: Option, } -impl ResponseResult for BackendServiceList {} +impl ResponseResult for SnapshotList {} + + +/// A service account. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ServiceAccount { + /// The list of scopes to be made available for this service account. + pub scopes: Option>, + /// Email address of the service account. + pub email: Option, +} + +impl Part for ServiceAccount {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [remove instance target pools](struct.TargetPoolRemoveInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolsRemoveInstanceRequest { + /// URLs of the instances to be removed from targetPool. + pub instances: Option>, +} + +impl RequestValue for TargetPoolsRemoveInstanceRequest {} + + +/// [Output Only] Metadata for this warning in key: value format. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MachineTypesScopedListWarningData { + /// [Output Only] A key for the warning data. + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for MachineTypesScopedListWarningData {} +impl Part for MachineTypesScopedListWarningData {} + + +/// A persistent disk snapshot resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list snapshots](struct.SnapshotListCall.html) (none) +/// * [create snapshot disks](struct.DiskCreateSnapshotCall.html) (request) +/// * [delete snapshots](struct.SnapshotDeleteCall.html) (none) +/// * [get snapshots](struct.SnapshotGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Snapshot { + /// [Output Only] The status of the snapshot. + pub status: Option, + /// [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources. + pub kind: Option, + /// [Output Only] A size of the the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion. + #[serde(rename="storageBytes")] + pub storage_bytes: Option, + /// An optional textual description of the resource; provided by the client when the resource is created. + pub description: Option, + /// The source disk used to create this snapshot. + #[serde(rename="sourceDisk")] + pub source_disk: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name. + #[serde(rename="sourceDiskId")] + pub source_disk_id: Option, + /// [Output Only] Size of the snapshot, specified in GB. + #[serde(rename="diskSizeGb")] + pub disk_size_gb: Option, + /// Public visible licenses. + pub licenses: Option>, + /// [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. + #[serde(rename="storageBytesStatus")] + pub storage_bytes_status: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl RequestValue for Snapshot {} +impl Resource for Snapshot {} +impl ResponseResult for Snapshot {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskTypesScopedList { + /// [Output Only] Informational warning which replaces the list of disk types when the list is empty. + pub warning: Option, + /// [Output Only] List of disk types contained in this scope. + #[serde(rename="diskTypes")] + pub disk_types: Option>, +} + +impl Part for DiskTypesScopedList {} + + +/// A BackendService resource. This resource defines a group of backend VMs together with their serving capacity. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get backend services](struct.BackendServiceGetCall.html) (response) +/// * [insert backend services](struct.BackendServiceInsertCall.html) (request) +/// * [list backend services](struct.BackendServiceListCall.html) (none) +/// * [update backend services](struct.BackendServiceUpdateCall.html) (request) +/// * [get health backend services](struct.BackendServiceGetHealthCall.html) (none) +/// * [delete backend services](struct.BackendServiceDeleteCall.html) (none) +/// * [patch backend services](struct.BackendServicePatchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackendService { + /// [Output Only] Type of resource. Always compute#backendService for backend services. + pub kind: Option, + /// no description provided + pub protocol: Option, + /// An optional textual description of the resource. Provided by the client when the resource is created. + pub description: Option, + /// How many seconds to wait for the backend before considering it a failed request. Default is 30 seconds. + #[serde(rename="timeoutSec")] + pub timeout_sec: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// The list of backends that serve this BackendService. + pub backends: Option>, + /// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService. + pub fingerprint: Option, + /// Name of backend port. The same name should appear in the resource views referenced by this service. Required. + #[serde(rename="portName")] + pub port_name: Option, + /// The list of URLs to the HttpHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required. + #[serde(rename="healthChecks")] + pub health_checks: Option>, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// Deprecated in favor of port name. The TCP port to connect on the backend. The default value is 80. + pub port: Option, + /// [Output Only] Server defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl RequestValue for BackendService {} +impl Resource for BackendService {} +impl ResponseResult for BackendService {} + + +/// A Machine Type resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list machine types](struct.MachineTypeListCall.html) (none) +/// * [aggregated list machine types](struct.MachineTypeAggregatedListCall.html) (none) +/// * [get machine types](struct.MachineTypeGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MachineType { + /// [Output Only] The tumber of CPUs exposed to the instance. + #[serde(rename="guestCpus")] + pub guest_cpus: Option, + /// [Deprecated] This property is deprecated and will never be populated with any relevant values. + #[serde(rename="imageSpaceGb")] + pub image_space_gb: Option, + /// Type of the resource. + pub kind: Option, + /// [Output Only] An optional textual description of the resource. + pub description: Option, + /// [Output Only] The name of the zone where the machine type resides, such as us-central1-a. + pub zone: Option, + /// [Output Only] Maximum total persistent disks size (GB) allowed. + #[serde(rename="maximumPersistentDisksSizeGb")] + pub maximum_persistent_disks_size_gb: Option, + /// [Output Only] The deprecation status associated with this machine type. + pub deprecated: Option, + /// [Output Only] Maximum persistent disks allowed. + #[serde(rename="maximumPersistentDisks")] + pub maximum_persistent_disks: Option, + /// [Output Only] The amount of physical memory available to the instance, defined in MB. + #[serde(rename="memoryMb")] + pub memory_mb: Option, + /// [Output Only] List of extended scratch disks assigned to the instance. + #[serde(rename="scratchDisks")] + pub scratch_disks: Option>, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] Name of the resource. + pub name: Option, +} + +impl Resource for MachineType {} +impl ResponseResult for MachineType {} + + +/// Contains a list of Image resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list images](struct.ImageListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ImageList { + /// A token used to continue a truncated list request (output only). + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of Image resources. + pub items: Option>, + /// Type of resource. + pub kind: Option, + /// Unique identifier for the resource; defined by the server (output only). + pub id: Option, + /// Server defined URL for this resource (output only). + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for ImageList {} + + +/// [Output Only] Metadata for this warning in key: value format. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetVpnGatewaysScopedListWarningData { + /// [Output Only] A key for the warning data. + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for TargetVpnGatewaysScopedListWarningData {} +impl Part for TargetVpnGatewaysScopedListWarningData {} + + +/// [Output Only] Metadata for this warning in key: value format. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationWarningsData { + /// [Output Only] A key for the warning data. + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for OperationWarningsData {} +impl Part for OperationWarningsData {} + + +/// Informational warning which replaces the list of forwarding rules when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ForwardingRulesScopedListWarning { + /// [Output Only] Optional human-readable details for this warning. + pub message: Option, + /// [Output Only] The warning type identifier for this warning. + pub code: Option, + /// [Output Only] Metadata for this warning in key: value format. + pub data: Option>, +} + +impl NestedType for ForwardingRulesScopedListWarning {} +impl Part for ForwardingRulesScopedListWarning {} + + +/// UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HostRule { + /// The list of host patterns to match. They must be valid hostnames except that they may start with *. or *-. The * acts like a glob and will match any string of atoms (separated by .s and -s) to the left. + pub hosts: Option>, + /// An optional textual description. + pub description: Option, + /// The name of the PathMatcher to match the path portion of the URL, if the this hostRule matches the URL's host portion. + #[serde(rename="pathMatcher")] + pub path_matcher: Option, +} + +impl Part for HostRule {} + + +/// A Firewall resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [patch firewalls](struct.FirewallPatchCall.html) (request) +/// * [list firewalls](struct.FirewallListCall.html) (none) +/// * [get firewalls](struct.FirewallGetCall.html) (response) +/// * [update firewalls](struct.FirewallUpdateCall.html) (request) +/// * [delete firewalls](struct.FirewallDeleteCall.html) (none) +/// * [insert firewalls](struct.FirewallInsertCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Firewall { + /// [Output Ony] Type of the resource. Always compute#firewall for firewall rules. + pub kind: Option, + /// An optional textual description of the resource; provided by the client when the resource is created. + pub description: Option, + /// A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags may be set. + /// + /// If both properties are set, an inbound connection is allowed if the range matches the sourceRanges OR the tag of the source matches the sourceTags property. The connection does not need to match both properties. + #[serde(rename="sourceTags")] + pub source_tags: Option>, + /// The IP address blocks that this rule applies to, expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. + /// + /// If both properties are set, an inbound connection is allowed if the range matches the sourceRanges OR the tag of the source matches the sourceTags property. The connection does not need to match both properties. + #[serde(rename="sourceRanges")] + pub source_ranges: Option>, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network. + #[serde(rename="targetTags")] + pub target_tags: Option>, + /// The list of rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. + pub allowed: Option>, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// URL of the network resource for this firewall rule. This field is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used: + /// global/networks/default + /// If you choose to specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: + /// - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network + /// - projects/myproject/global/networks/my-network + /// - global/networks/default + pub network: Option, +} + +impl RequestValue for Firewall {} +impl Resource for Firewall {} +impl ResponseResult for Firewall {} + + +/// Contains a list of TargetVpnGateway resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list target vpn gateways](struct.TargetVpnGatewayListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetVpnGatewayList { + /// [Output Only] A token used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] A list of TargetVpnGateway resources. + pub items: Option>, + /// [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + pub kind: Option, + /// [Output Only] Unique identifier for the resource. Defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for TargetVpnGatewayList {} + + +/// The named port information. For example: . +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NamedPort { + /// The name for this NamedPort. + pub name: Option, + /// The port number, which can be a value between 1 and 65535. + pub port: Option, +} + +impl Part for NamedPort {} + + +/// A TargetInstance resource. This resource defines an endpoint VM that terminates traffic of certain protocols. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete target instances](struct.TargetInstanceDeleteCall.html) (none) +/// * [aggregated list target instances](struct.TargetInstanceAggregatedListCall.html) (none) +/// * [get target instances](struct.TargetInstanceGetCall.html) (response) +/// * [list target instances](struct.TargetInstanceListCall.html) (none) +/// * [insert target instances](struct.TargetInstanceInsertCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstance { + /// NAT option controlling how IPs are NAT'ed to the VM. Currently only NO_NAT (default value) is supported. + #[serde(rename="natPolicy")] + pub nat_policy: Option, + /// An optional textual description of the resource; provided by the client when the resource is created. + pub description: Option, + /// URL of the zone where the target instance resides (output only). + pub zone: Option, + /// Type of the resource. + pub kind: Option, + /// The URL to the instance that terminates the relevant traffic. + pub instance: Option, + /// Creation timestamp in RFC3339 text format (output only). + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// Unique identifier for the resource; defined by the server (output only). + pub id: Option, + /// Server defined URL for the resource (output only). + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + pub name: Option, +} + +impl RequestValue for TargetInstance {} +impl Resource for TargetInstance {} +impl ResponseResult for TargetInstance {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list target instances](struct.TargetInstanceAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstanceAggregatedList { + /// A token used to continue a truncated list request (output only). + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A map of scoped target instance lists. + pub items: Option>, + /// Type of resource. + pub kind: Option, + /// Unique identifier for the resource; defined by the server (output only). + pub id: Option, + /// Server defined URL for this resource (output only). + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for TargetInstanceAggregatedList {} + + +/// [Output Only] A list of InstanceGroupManager resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list instance group managers](struct.InstanceGroupManagerListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagerList { + /// [Output Only] A token that is used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] A list of managed instance group resources. + pub items: Option>, + /// [Output Only] Type of the resource. Always compute#instanceGroupManagerList for a list of managed instance group resources. + pub kind: Option, + /// [Output Only] A unique identifier for this managed instance group. The server defines this identifier. + pub id: Option, + /// [Output Only] The URL for this managed instance group. The server defines this URL. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for InstanceGroupManagerList {} + + +/// [Output Only] Metadata for this warning in key: value format. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupsScopedListWarningData { + /// [Output Only] A key for the warning data. + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for InstanceGroupsScopedListWarningData {} +impl Part for InstanceGroupsScopedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list disk types](struct.DiskTypeAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskTypeAggregatedList { + /// [Output Only] A token used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] A map of scoped disk type lists. + pub items: Option>, + /// [Output Only] Type of resource. Always compute#diskTypeAggregatedList. + pub kind: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for DiskTypeAggregatedList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstancesScopedList { + /// [Output Only] List of instances contained in this scope. + pub instances: Option>, + /// [Output Only] Informational warning which replaces the list of instances when the list is empty. + pub warning: Option, +} + +impl Part for InstancesScopedList {} + + +/// Encountered errors during the last attempt to create or delete the instance. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedInstanceLastAttemptErrors { + /// [Output Only] The array of errors encountered while processing this operation. + pub errors: Option>, +} + +impl NestedType for ManagedInstanceLastAttemptErrors {} +impl Part for ManagedInstanceLastAttemptErrors {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list machine types](struct.MachineTypeAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MachineTypeAggregatedList { + /// [Output Only] A token used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] A map of scoped machine type lists. + pub items: Option>, + /// [Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types. + pub kind: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for MachineTypeAggregatedList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [validate url maps](struct.UrlMapValidateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapsValidateResponse { + /// no description provided + pub result: Option, +} + +impl ResponseResult for UrlMapsValidateResponse {} + + +/// Informational warning which replaces the list of addresses when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstancesScopedListWarning { + /// [Output Only] Optional human-readable details for this warning. + pub message: Option, + /// [Output Only] The warning type identifier for this warning. + pub code: Option, + /// [Output Only] Metadata for this warning in key: value format. + pub data: Option>, +} + +impl NestedType for TargetInstancesScopedListWarning {} +impl Part for TargetInstancesScopedListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [abandon instances instance group managers](struct.InstanceGroupManagerAbandonInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagersAbandonInstancesRequest { + /// The names of instances to abandon from the managed instance group. + pub instances: Option>, +} + +impl RequestValue for InstanceGroupManagersAbandonInstancesRequest {} + + +/// A list of InstanceGroup resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list instance groups](struct.InstanceGroupListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupList { + /// [Output Only] A token that is used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of InstanceGroup resources. + pub items: Option>, + /// [Output Only] The resource type, which is always compute#instanceGroupList for instance group lists. + pub kind: Option, + /// [Output Only] A unique identifier for this list of instance groups. The server defines this identifier. + pub id: Option, + /// [Output Only] The URL for this instance group. The server defines this URL. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for InstanceGroupList {} /// [Output Only] Metadata for this warning in key: value format. @@ -4012,6 +3974,146 @@ impl NestedType for AddressesScopedListWarningData {} impl Part for AddressesScopedListWarningData {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete vpn tunnels](struct.VpnTunnelDeleteCall.html) (none) +/// * [aggregated list vpn tunnels](struct.VpnTunnelAggregatedListCall.html) (none) +/// * [get vpn tunnels](struct.VpnTunnelGetCall.html) (response) +/// * [insert vpn tunnels](struct.VpnTunnelInsertCall.html) (request) +/// * [list vpn tunnels](struct.VpnTunnelListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnTunnel { + /// [Output Only] Detailed status message for the VPN tunnel. + #[serde(rename="detailedStatus")] + pub detailed_status: Option, + /// IKE protocol version to use when establishing the VPN tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2. Default version is 2. + #[serde(rename="ikeVersion")] + pub ike_version: Option, + /// [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + pub kind: Option, + /// An optional textual description of the resource. Provided by the client when the resource is created. + pub description: Option, + /// IP address of the peer VPN gateway. + #[serde(rename="peerIp")] + pub peer_ip: Option, + /// [Output Only] URL of the region where the VPN tunnel resides. + pub region: Option, + /// IKE networks to use when establishing the VPN tunnel with peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges should be disjoint. + #[serde(rename="ikeNetworks")] + pub ike_networks: Option>, + /// [Output Only] The status of the VPN tunnel. + pub status: Option, + /// Hash of the shared secret. + #[serde(rename="sharedSecretHash")] + pub shared_secret_hash: Option, + /// URL of the VPN gateway to which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. + #[serde(rename="targetVpnGateway")] + pub target_vpn_gateway: Option, + /// Shared secret used to set the secure session between the GCE VPN gateway and the peer VPN gateway. + #[serde(rename="sharedSecret")] + pub shared_secret: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] Unique identifier for the resource. Defined by the server. + pub id: Option, + /// [Output Only] Server defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl RequestValue for VpnTunnel {} +impl Resource for VpnTunnel {} +impl ResponseResult for VpnTunnel {} + + +/// Deprecation status for a public resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [deprecate images](struct.ImageDeprecateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeprecationStatus { + /// An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to DELETED. + pub deleted: Option, + /// An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to DEPRECATED. + pub deprecated: Option, + /// The deprecation state of this resource. This can be DEPRECATED, OBSOLETE, or DELETED. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error. + pub state: Option, + /// An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to OBSOLETE. + pub obsolete: Option, + /// The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource. + pub replacement: Option, +} + +impl RequestValue for DeprecationStatus {} + + +/// [Output Only] Informational warning which replaces the list of disks when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DisksScopedListWarning { + /// [Output Only] Optional human-readable details for this warning. + pub message: Option, + /// [Output Only] The warning type identifier for this warning. + pub code: Option, + /// [Output Only] Metadata for this warning in key: value format. + pub data: Option>, +} + +impl NestedType for DisksScopedListWarning {} +impl Part for DisksScopedListWarning {} + + +/// Array of key/value pairs. The total size of all keys and values must be less than 512 KB. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MetadataItems { + /// Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. + pub key: Option, + /// Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes. + pub value: Option, +} + +impl NestedType for MetadataItems {} +impl Part for MetadataItems {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set url map target http proxies](struct.TargetHttpProxySetUrlMapCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapReference { + /// no description provided + #[serde(rename="urlMap")] + pub url_map: Option, +} + +impl RequestValue for UrlMapReference {} + + /// [Output Only] The array of errors encountered while processing this operation. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4030,22 +4132,909 @@ impl NestedType for OperationErrorErrors {} impl Part for OperationErrorErrors {} -/// If potential misconfigurations are detected for this route, this field will be populated with warning messages. +/// [Output Only] Informational warning which replaces the list of addresses when the list is empty. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouteWarnings { +pub struct AddressesScopedListWarning { /// [Output Only] Optional human-readable details for this warning. pub message: Option, /// [Output Only] The warning type identifier for this warning. pub code: Option, /// [Output Only] Metadata for this warning in key: value format. - pub data: Option>, + pub data: Option>, } -impl NestedType for RouteWarnings {} -impl Part for RouteWarnings {} +impl NestedType for AddressesScopedListWarning {} +impl Part for AddressesScopedListWarning {} + + +/// [Output Only] Metadata for this warning in key: value format. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagersScopedListWarningData { + /// [Output Only] A key for the warning data. + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for InstanceGroupManagersScopedListWarningData {} +impl Part for InstanceGroupManagersScopedListWarningData {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HealthCheckReference { + /// no description provided + #[serde(rename="healthCheck")] + pub health_check: Option, +} + +impl Part for HealthCheckReference {} + + +/// [Output Only] An informational warning that replaces the list of instance groups when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupsScopedListWarning { + /// [Output Only] Optional human-readable details for this warning. + pub message: Option, + /// [Output Only] The warning type identifier for this warning. + pub code: Option, + /// [Output Only] Metadata for this warning in key: value format. + pub data: Option>, +} + +impl NestedType for InstanceGroupsScopedListWarning {} +impl Part for InstanceGroupsScopedListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [insert autoscalers](struct.AutoscalerInsertCall.html) (request) +/// * [update autoscalers](struct.AutoscalerUpdateCall.html) (request) +/// * [get autoscalers](struct.AutoscalerGetCall.html) (response) +/// * [list autoscalers](struct.AutoscalerListCall.html) (none) +/// * [patch autoscalers](struct.AutoscalerPatchCall.html) (request) +/// * [aggregated list autoscalers](struct.AutoscalerAggregatedListCall.html) (none) +/// * [delete autoscalers](struct.AutoscalerDeleteCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Autoscaler { + /// Type of the resource. + pub kind: Option, + /// An optional textual description of the resource; provided by the client when the resource is created. + pub description: Option, + /// URL of the zone where the instance group resides (output only). + pub zone: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + pub name: Option, + /// Autoscaling configuration. + #[serde(rename="autoscalingPolicy")] + pub autoscaling_policy: Option, + /// Creation timestamp in RFC3339 text format (output only). + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// Unique identifier for the resource; defined by the server (output only). + pub id: Option, + /// Server defined URL for the resource (output only). + #[serde(rename="selfLink")] + pub self_link: Option, + /// URL of Instance Group Manager or Replica Pool which will be controlled by Autoscaler. + pub target: Option, +} + +impl RequestValue for Autoscaler {} +impl Resource for Autoscaler {} +impl ResponseResult for Autoscaler {} + + +/// [Output Only] Informational warning which replaces the list of addresses when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetVpnGatewaysScopedListWarning { + /// [Output Only] Optional human-readable details for this warning. + pub message: Option, + /// [Output Only] The warning type identifier for this warning. + pub code: Option, + /// [Output Only] Metadata for this warning in key: value format. + pub data: Option>, +} + +impl NestedType for TargetVpnGatewaysScopedListWarning {} +impl Part for TargetVpnGatewaysScopedListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [remove instances instance groups](struct.InstanceGroupRemoveInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupsRemoveInstancesRequest { + /// The instances to remove from the instance group. + pub instances: Option>, +} + +impl RequestValue for InstanceGroupsRemoveInstancesRequest {} + + +/// [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. +/// +/// This property is mutually exclusive with the source property; you can only define one or the other, but not both. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AttachedDiskInitializeParams { + /// Specifies the size of the disk in base-2 GB. + #[serde(rename="diskSizeGb")] + pub disk_size_gb: Option, + /// Specifies the disk name. If not specified, the default is to use the name of the instance. + #[serde(rename="diskName")] + pub disk_name: Option, + /// A source image used to create the disk. You can provide a private (custom) image, and Compute Engine will use the corresponding image from your project. For example: + /// + /// global/images/my-private-image + /// + /// Or you can provide an image from a publicly-available project. For example, to use a Debian image from the debian-cloud project, make sure to include the project in the URL: + /// + /// projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD + /// + /// where vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases. + #[serde(rename="sourceImage")] + pub source_image: Option, + /// Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example: + /// + /// https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard + /// + /// Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values: + /// - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType + /// - projects/project/zones/zone/diskTypes/diskType + /// - zones/zone/diskTypes/diskType + #[serde(rename="diskType")] + pub disk_type: Option, +} + +impl Part for AttachedDiskInitializeParams {} + + +/// A quotas entry. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Quota { + /// [Output Only] Current usage of this metric. + pub usage: Option, + /// [Output Only] Name of the quota metric. + pub metric: Option, + /// [Output Only] Quota limit for this metric. + pub limit: Option, +} + +impl Part for Quota {} + + +/// A TargetPool resource. This resource defines a pool of VMs, associated HttpHealthCheck resources, and the fallback TargetPool. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get health target pools](struct.TargetPoolGetHealthCall.html) (none) +/// * [add instance target pools](struct.TargetPoolAddInstanceCall.html) (none) +/// * [remove instance target pools](struct.TargetPoolRemoveInstanceCall.html) (none) +/// * [remove health check target pools](struct.TargetPoolRemoveHealthCheckCall.html) (none) +/// * [delete target pools](struct.TargetPoolDeleteCall.html) (none) +/// * [insert target pools](struct.TargetPoolInsertCall.html) (request) +/// * [aggregated list target pools](struct.TargetPoolAggregatedListCall.html) (none) +/// * [list target pools](struct.TargetPoolListCall.html) (none) +/// * [add health check target pools](struct.TargetPoolAddHealthCheckCall.html) (none) +/// * [get target pools](struct.TargetPoolGetCall.html) (response) +/// * [set backup target pools](struct.TargetPoolSetBackupCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPool { + /// This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1]. + /// + /// If set, 'backupPool' must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy VMs in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. + /// + /// In case where 'failoverRatio' is not set or all the VMs in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy. + #[serde(rename="failoverRatio")] + pub failover_ratio: Option, + /// An optional textual description of the resource; provided by the client when the resource is created. + pub description: Option, + /// URL of the region where the target pool resides (output only). + pub region: Option, + /// Type of the resource. + pub kind: Option, + /// Sesssion affinity option, must be one of the following values: 'NONE': Connections from the same client IP may go to any VM in the pool; 'CLIENT_IP': Connections from the same client IP will go to the same VM in the pool while that VM remains healthy. 'CLIENT_IP_PROTO': Connections from the same client IP with the same IP protocol will go to the same VM in the pool while that VM remains healthy. + #[serde(rename="sessionAffinity")] + pub session_affinity: Option, + /// A list of resource URLs to the member VMs serving this pool. They must live in zones contained in the same region as this pool. + pub instances: Option>, + /// This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its 'failoverRatio' field is properly set to a value between [0, 1]. + /// + /// 'backupPool' and 'failoverRatio' together define the fallback behavior of the primary target pool: if the ratio of the healthy VMs in the primary pool is at or below 'failoverRatio', traffic arriving at the load-balanced IP will be directed to the backup pool. + /// + /// In case where 'failoverRatio' and 'backupPool' are not set, or all the VMs in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy. + #[serde(rename="backupPool")] + pub backup_pool: Option, + /// A list of URLs to the HttpHealthCheck resource. A member VM in this pool is considered healthy if and only if all specified health checks pass. An empty list means all member VMs will be considered healthy at all times. + #[serde(rename="healthChecks")] + pub health_checks: Option>, + /// Creation timestamp in RFC3339 text format (output only). + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// Unique identifier for the resource; defined by the server (output only). + pub id: Option, + /// Server defined URL for the resource (output only). + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + pub name: Option, +} + +impl RequestValue for TargetPool {} +impl Resource for TargetPool {} +impl ResponseResult for TargetPool {} + + +/// [Output Only] Metadata for this warning in key: value format. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolsScopedListWarningData { + /// [Output Only] A key for the warning data. + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for TargetPoolsScopedListWarningData {} +impl Part for TargetPoolsScopedListWarningData {} + + +/// [Output Only] Metadata for this warning in key: value format. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstancesScopedListWarningData { + /// [Output Only] A key for the warning data. + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for TargetInstancesScopedListWarningData {} +impl Part for TargetInstancesScopedListWarningData {} + + +/// A reserved address resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [insert global addresses](struct.GlobalAddresseInsertCall.html) (request) +/// * [insert addresses](struct.AddresseInsertCall.html) (request) +/// * [get addresses](struct.AddresseGetCall.html) (response) +/// * [get global addresses](struct.GlobalAddresseGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Address { + /// [Output Only] The status of the address, which can be either IN_USE or RESERVED. An address that is RESERVED is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available. + pub status: Option, + /// [Output Only] Type of the resource. Always compute#address for addresses. + pub kind: Option, + /// An optional textual description of the resource; provided by the client when the resource is created. + pub description: Option, + /// [Output Only] URL of the region where the regional address resides. This field is not applicable to global addresses. + pub region: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// The static external IP address represented by this resource. + pub address: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] The URLs of the resources that are using this address. + pub users: Option>, +} + +impl RequestValue for Address {} +impl ResponseResult for Address {} + + +/// [Output Only] An informational warning that appears when the machine types list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MachineTypesScopedListWarning { + /// [Output Only] Optional human-readable details for this warning. + pub message: Option, + /// [Output Only] The warning type identifier for this warning. + pub code: Option, + /// [Output Only] Metadata for this warning in key: value format. + pub data: Option>, +} + +impl NestedType for MachineTypesScopedListWarning {} +impl Part for MachineTypesScopedListWarning {} + + +/// A ForwardingRule resource. A ForwardingRule resource specifies which pool of target VMs to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list forwarding rules](struct.ForwardingRuleAggregatedListCall.html) (none) +/// * [get global forwarding rules](struct.GlobalForwardingRuleGetCall.html) (response) +/// * [insert global forwarding rules](struct.GlobalForwardingRuleInsertCall.html) (request) +/// * [insert forwarding rules](struct.ForwardingRuleInsertCall.html) (request) +/// * [delete forwarding rules](struct.ForwardingRuleDeleteCall.html) (none) +/// * [set target forwarding rules](struct.ForwardingRuleSetTargetCall.html) (none) +/// * [get forwarding rules](struct.ForwardingRuleGetCall.html) (response) +/// * [list forwarding rules](struct.ForwardingRuleListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ForwardingRule { + /// Type of the resource. + pub kind: Option, + /// An optional textual description of the resource; provided by the client when the resource is created. + pub description: Option, + /// Applicable only when `IPProtocol` is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. If portRange is left empty (default value), all ports are forwarded. Forwarding rules with the same `[IPAddress, IPProtocol]` pair must have disjoint port ranges. + #[serde(rename="portRange")] + pub port_range: Option, + /// [Output Only] URL of the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules. + pub region: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// The IP protocol to which this rule applies, valid options are TCP, UDP, ESP, AH or SCTP. + #[serde(rename="IPProtocol")] + pub ip_protocol: Option, + /// Value of the reserved IP address that this forwarding rule is serving on behalf of. For global forwarding rules, the address must be a global IP; for regional forwarding rules, the address must live in the same region as the forwarding rule. If left empty (default value), an ephemeral IP from the same scope (global or regional) will be assigned. + #[serde(rename="IPAddress")] + pub ip_address: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global TargetHttpProxy or TargetHttpsProxy resource. + pub target: Option, +} + +impl RequestValue for ForwardingRule {} +impl Resource for ForwardingRule {} +impl ResponseResult for ForwardingRule {} + + +/// [Output Only] Metadata for this warning in key: value format. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskTypesScopedListWarningData { + /// [Output Only] A key for the warning data. + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for DiskTypesScopedListWarningData {} +impl Part for DiskTypesScopedListWarningData {} + + +/// A license resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get licenses](struct.LicenseGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct License { + /// If true, the customer will be charged license fee for running software that contains this license on an instance. + #[serde(rename="chargesUseFee")] + pub charges_use_fee: Option, + /// [Output Only] Type of resource. Always compute#license for licenses. + pub kind: Option, + /// Name of the resource. The name must be 1-63 characters long, and comply with RCF1035. + pub name: Option, + /// [Output Only] Server defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl Resource for License {} +impl ResponseResult for License {} + + +/// Contains a list of disk type resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list disk types](struct.DiskTypeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskTypeList { + /// [Output Only] A token used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] A list of Disk Type resources. + pub items: Option>, + /// [Output Only] Type of resource. Always compute#diskTypeList for disk types. + pub kind: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for DiskTypeList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalersScopedList { + /// Informational warning which replaces the list of autoscalers when the list is empty. + pub warning: Option, + /// List of autoscalers contained in this scope. + pub autoscalers: Option>, +} + +impl Part for AutoscalersScopedList {} + + +/// The route resource. A Route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with VMs by tag and the set of Routes for a particular VM is called its routing table. For each packet leaving a VM, the system searches that VM's routing table for a single best matching Route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the Route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching Routes. The packet is then forwarded as specified by the nextHop field of the winning Route -- either to another VM destination, a VM gateway or a GCE operated gateway. Packets that do not match any Route in the sending VM's routing table are dropped. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list routes](struct.RouteListCall.html) (none) +/// * [insert routes](struct.RouteInsertCall.html) (request) +/// * [delete routes](struct.RouteDeleteCall.html) (none) +/// * [get routes](struct.RouteGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Route { + /// The URL to a gateway that should handle matching packets. Currently, this is only the internet gateway: projects//global/gateways/default-internet-gateway + #[serde(rename="nextHopGateway")] + pub next_hop_gateway: Option, + /// An optional textual description of the resource. Provided by the client when the resource is created. + pub description: Option, + /// A list of instance tags to which this route applies. + pub tags: Option>, + /// The URL of the local network if it should handle matching packets. + #[serde(rename="nextHopNetwork")] + pub next_hop_network: Option, + /// The destination range of outgoing packets that this route applies to. + #[serde(rename="destRange")] + pub dest_range: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] Unique identifier for the resource. Defined by the server. + pub id: Option, + /// The network IP address of an instance that should handle matching packets. + #[serde(rename="nextHopIp")] + pub next_hop_ip: Option, + /// Fully-qualified URL of the network that this route applies to. + pub network: Option, + /// [Output Only] Type of this resource. Always compute#routes for Route resources. + pub kind: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// The fully-qualified URL to an instance that should handle matching packets. For example: + /// https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ + #[serde(rename="nextHopInstance")] + pub next_hop_instance: Option, + /// [Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages. + pub warnings: Option>, + /// Breaks ties between Routes of equal specificity. Routes with smaller values win when tied with routes with larger values. Default value is 1000. A valid range is between 0 and 65535. + pub priority: Option, + /// The URL to a VpnTunnel that should handle matching packets. + #[serde(rename="nextHopVpnTunnel")] + pub next_hop_vpn_tunnel: Option, + /// [Output Only] Server-defined fully-qualified URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl RequestValue for Route {} +impl Resource for Route {} +impl ResponseResult for Route {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetVpnGatewaysScopedList { + /// [Output Only] List of target vpn gateways contained in this scope. + #[serde(rename="targetVpnGateways")] + pub target_vpn_gateways: Option>, + /// [Output Only] Informational warning which replaces the list of addresses when the list is empty. + pub warning: Option, +} + +impl Part for TargetVpnGatewaysScopedList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set target forwarding rules](struct.ForwardingRuleSetTargetCall.html) (request) +/// * [set backup target pools](struct.TargetPoolSetBackupCall.html) (request) +/// * [set target global forwarding rules](struct.GlobalForwardingRuleSetTargetCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetReference { + /// no description provided + pub target: Option, +} + +impl RequestValue for TargetReference {} + + +/// A network interface resource attached to an instance. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkInterface { + /// An array of configurations for this interface. Currently, >, + /// [Output Only] An optional IPV4 internal network address assigned to the instance for this network interface. + #[serde(rename="networkIP")] + pub network_ip: Option, + /// [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc. + pub name: Option, + /// URL of the network resource for this instance. This is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used: + /// + /// global/networks/default + /// + /// If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: + /// - https://www.googleapis.com/compute/v1/projects/project/global/networks/network + /// - projects/project/global/networks/network + /// - global/networks/default + pub network: Option, +} + +impl Part for NetworkInterface {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DisksScopedList { + /// [Output Only] List of disks contained in this scope. + pub disks: Option>, + /// [Output Only] Informational warning which replaces the list of disks when the list is empty. + pub warning: Option, +} + +impl Part for DisksScopedList {} + + +/// Contains a list of VpnTunnel resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list vpn tunnels](struct.VpnTunnelListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnTunnelList { + /// [Output Only] A token used to continue a truncated list request. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] A list of VpnTunnel resources. + pub items: Option>, + /// [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + pub kind: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for VpnTunnelList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get health target pools](struct.TargetPoolGetHealthCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolInstanceHealth { + /// Type of resource. + pub kind: Option, + /// no description provided + #[serde(rename="healthStatus")] + pub health_status: Option>, +} + +impl ResponseResult for TargetPoolInstanceHealth {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstancesScopedList { + /// List of target instances contained in this scope. + #[serde(rename="targetInstances")] + pub target_instances: Option>, + /// Informational warning which replaces the list of addresses when the list is empty. + pub warning: Option, +} + +impl Part for TargetInstancesScopedList {} + + +/// A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [update url maps](struct.UrlMapUpdateCall.html) (request) +/// * [insert url maps](struct.UrlMapInsertCall.html) (request) +/// * [list url maps](struct.UrlMapListCall.html) (none) +/// * [validate url maps](struct.UrlMapValidateCall.html) (none) +/// * [delete url maps](struct.UrlMapDeleteCall.html) (none) +/// * [get url maps](struct.UrlMapGetCall.html) (response) +/// * [patch url maps](struct.UrlMapPatchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMap { + /// Type of the resource. + pub kind: Option, + /// An optional textual description of the resource. Provided by the client when the resource is created. + pub description: Option, + /// The URL of the BackendService resource if none of the hostRules match. + #[serde(rename="defaultService")] + pub default_service: Option, + /// The list of expected URL mappings. Request to update this UrlMap will succeed only all of the test cases pass. + pub tests: Option>, + /// The list of HostRules to use against the URL. + #[serde(rename="hostRules")] + pub host_rules: Option>, + /// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a UrlMap. An up-to-date fingerprint must be provided in order to update the UrlMap. + pub fingerprint: Option, + /// The list of named PathMatchers to use against the URL. + #[serde(rename="pathMatchers")] + pub path_matchers: Option>, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] Unique identifier for the resource. Set by the server. + pub id: Option, + /// [Output Only] Server defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl RequestValue for UrlMap {} +impl Resource for UrlMap {} +impl ResponseResult for UrlMap {} + + +/// [Output Only] Metadata for this warning in key: value format. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouteWarningsData { + /// [Output Only] A key for the warning data. + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for RouteWarningsData {} +impl Part for RouteWarningsData {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupsScopedList { + /// [Output Only] An informational warning that replaces the list of instance groups when the list is empty. + pub warning: Option, + /// [Output Only] The list of instance groups that are contained in this scope. + #[serde(rename="instanceGroups")] + pub instance_groups: Option>, +} + +impl Part for InstanceGroupsScopedList {} + + +/// Contains a list of TargetPool resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list target pools](struct.TargetPoolListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolList { + /// A token used to continue a truncated list request (output only). + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of TargetPool resources. + pub items: Option>, + /// Type of resource. + pub kind: Option, + /// Unique identifier for the resource; defined by the server (output only). + pub id: Option, + /// Server defined URL for this resource (output only). + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for TargetPoolList {} + + +/// +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceProperties { + /// A boolean that specifies if instances created from this template can send packets with source IP addresses other than their own or receive packets with destination IP addresses other than their own. If you use these instances as an IP gateway or as the next-hop in a Route resource, specify true. Otherwise, specify false. + #[serde(rename="canIpForward")] + pub can_ip_forward: Option, + /// An optional text description for the instances that are created from this instance template. + pub description: Option, + /// A list of tags to apply to the instances that are created from this template. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. + pub tags: Option, + /// An array of disks that are associated with the instances that are created from this template. + pub disks: Option>, + /// A list of scheduling options for the instances that are created from this template. + pub scheduling: Option, + /// The machine type to use for instances that are created from this template. + #[serde(rename="machineType")] + pub machine_type: Option, + /// A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this template. Use metadata queries to obtain the access tokens for these instances. + #[serde(rename="serviceAccounts")] + pub service_accounts: Option>, + /// An array of network access configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only supported access configuration. If you do not specify any access configurations, the instances that are created from this template will have no external internet access. + #[serde(rename="networkInterfaces")] + pub network_interfaces: Option>, + /// The metadata key/value pairs to assign to instances that are created from this template. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information. + pub metadata: Option, +} + +impl Part for InstanceProperties {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [remove health check target pools](struct.TargetPoolRemoveHealthCheckCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolsRemoveHealthCheckRequest { + /// Health check URLs to be removed from targetPool. + #[serde(rename="healthChecks")] + pub health_checks: Option>, +} + +impl RequestValue for TargetPoolsRemoveHealthCheckRequest {} + + +/// Informational warning which replaces the list of addresses when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnTunnelsScopedListWarning { + /// [Output Only] Optional human-readable details for this warning. + pub message: Option, + /// [Output Only] The warning type identifier for this warning. + pub code: Option, + /// [Output Only] Metadata for this warning in key: value format. + pub data: Option>, +} + +impl NestedType for VpnTunnelsScopedListWarning {} +impl Part for VpnTunnelsScopedListWarning {} + + +/// [Output Only] The array of errors encountered while processing this operation. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedInstanceLastAttemptErrorsErrors { + /// [Output Only] An optional, human-readable error message. + pub message: Option, + /// [Output Only] The error type identifier for this error. + pub code: Option, + /// [Output Only] Indicates the field in the request which caused the error. This property is optional. + pub location: Option, +} + +impl NestedType for ManagedInstanceLastAttemptErrorsErrors {} +impl Part for ManagedInstanceLastAttemptErrorsErrors {} /// Sets the scheduling options for an Instance. @@ -4088,62 +5077,20 @@ pub struct TargetPoolsScopedList { impl Part for TargetPoolsScopedList {} -/// Contains a list of region resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list regions](struct.RegionListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionList { - /// [Output Only] A token used to continue a truncated list request. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] A list of Region resources. - pub items: Option>, - /// [Output Only] Type of resource. Always compute#regionList for lists of regions. - pub kind: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for RegionList {} - - -/// Message containing information of one individual backend. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Backend { - /// The multiplier (a value between 0.0 and 1.0) of the max capacity (CPU or RPS, depending on 'balancingMode') the group should serve up to. 0 means the group is totally drained. Default value is 1. Valid range is [0.0, 1.0]. - #[serde(rename="capacityScaler")] - pub capacity_scaler: Option, - /// The max RPS of the group. Can be used with either balancing mode, but required if RATE mode. For RATE mode, either maxRate or maxRatePerInstance must be set. - #[serde(rename="maxRate")] - pub max_rate: Option, - /// URL of a zonal Cloud Resource View resource. This resource view defines the list of instances that serve traffic. Member virtual machine instances from each resource view must live in the same zone as the resource view itself. No two backends in a backend service are allowed to use same Resource View resource. - pub group: Option, - /// An optional textual description of the resource, which is provided by the client when the resource is created. - pub description: Option, - /// Used when 'balancingMode' is UTILIZATION. This ratio defines the CPU utilization target for the group. The default is 0.8. Valid range is [0, 1]. - #[serde(rename="maxUtilization")] - pub max_utilization: Option, - /// The max RPS that a single backed instance can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerInstance must be set. - #[serde(rename="maxRatePerInstance")] - pub max_rate_per_instance: Option, - /// The balancing mode of this backend, default is UTILIZATION. - #[serde(rename="balancingMode")] - pub balancing_mode: Option, +pub struct InstanceGroupManagersScopedList { + /// [Output Only] The warning that replaces the list of managed instance groups when the list is empty. + pub warning: Option, + /// [Output Only] The list of managed instance groups that are contained in the specified project and zone. + #[serde(rename="instanceGroupManagers")] + pub instance_group_managers: Option>, } -impl Part for Backend {} +impl Part for InstanceGroupManagersScopedList {} @@ -4191,7 +5138,7 @@ impl<'a, C, A> DiskMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified persistent disk. + /// Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. /// /// # Arguments /// @@ -4230,6 +5177,27 @@ impl<'a, C, A> DiskMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns a specified persistent disk. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + /// * `disk` - Name of the persistent disk to return. + pub fn get(&self, project: &str, zone: &str, disk: &str) -> DiskGetCall<'a, C, A> { + DiskGetCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _disk: disk.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Retrieves the list of persistent disks contained within the specified zone. @@ -4296,27 +5264,6 @@ impl<'a, C, A> DiskMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Returns a specified persistent disk. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone for this request. - /// * `disk` - Name of the persistent disk to return. - pub fn get(&self, project: &str, zone: &str, disk: &str) -> DiskGetCall<'a, C, A> { - DiskGetCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _disk: disk.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -4806,12 +5753,12 @@ impl<'a, C, A> SnapshotMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns the specified persistent disk snapshot resource. + /// Returns the specified Snapshot resource. /// /// # Arguments /// /// * `project` - Name of the project scoping this request. - /// * `snapshot` - Name of the persistent disk snapshot resource to return. + /// * `snapshot` - Name of the Snapshot resource to return. pub fn get(&self, project: &str, snapshot: &str) -> SnapshotGetCall<'a, C, A> { SnapshotGetCall { hub: self.hub, @@ -4825,7 +5772,7 @@ impl<'a, C, A> SnapshotMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the list of persistent disk snapshot resources contained within the specified project. + /// Retrieves the list of Snapshot resources contained within the specified project. /// /// # Arguments /// @@ -4845,12 +5792,14 @@ impl<'a, C, A> SnapshotMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified persistent disk snapshot resource. + /// Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. + /// + /// For more information, see Deleting snaphots. /// /// # Arguments /// /// * `project` - Name of the project scoping this request. - /// * `snapshot` - Name of the persistent disk snapshot resource to delete. + /// * `snapshot` - Name of the Snapshot resource to delete. pub fn delete(&self, project: &str, snapshot: &str) -> SnapshotDeleteCall<'a, C, A> { SnapshotDeleteCall { hub: self.hub, @@ -4865,7 +5814,7 @@ impl<'a, C, A> SnapshotMethods<'a, C, A> { -/// A builder providing access to all methods supported on *diskType* resources. +/// A builder providing access to all methods supported on *instanceGroupManager* resources. /// It is not used directly, but through the `Compute` hub. /// /// # Example @@ -4888,36 +5837,38 @@ impl<'a, C, A> SnapshotMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `aggregated_list(...)`, `get(...)` and `list(...)` +/// // like `abandon_instances(...)`, `aggregated_list(...)`, `delete(...)`, `delete_instances(...)`, `get(...)`, `insert(...)`, `list(...)`, `list_managed_instances(...)`, `recreate_instances(...)`, `resize(...)`, `set_instance_template(...)` and `set_target_pools(...)` /// // to build up your call. -/// let rb = hub.disk_types(); +/// let rb = hub.instance_group_managers(); /// # } /// ``` -pub struct DiskTypeMethods<'a, C, A> +pub struct InstanceGroupManagerMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, } -impl<'a, C, A> MethodsBuilder for DiskTypeMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for InstanceGroupManagerMethods<'a, C, A> {} -impl<'a, C, A> DiskTypeMethods<'a, C, A> { +impl<'a, C, A> InstanceGroupManagerMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns the specified disk type resource. + /// Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group removes instances in the order that is outlined in Resizing a managed instance group. /// /// # Arguments /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone for this request. - /// * `diskType` - Name of the disk type resource to return. - pub fn get(&self, project: &str, zone: &str, disk_type: &str) -> DiskTypeGetCall<'a, C, A> { - DiskTypeGetCall { + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the instance group manager. + /// * `size` - The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + pub fn resize(&self, project: &str, zone: &str, instance_group_manager: &str, size: i32) -> InstanceGroupManagerResizeCall<'a, C, A> { + InstanceGroupManagerResizeCall { hub: self.hub, _project: project.to_string(), _zone: zone.to_string(), - _disk_type: disk_type.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _size: size, _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4926,13 +5877,77 @@ impl<'a, C, A> DiskTypeMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the list of disk type resources grouped by scope. + /// Retrieves a list of managed instance groups that are contained within the specified project and zone. /// /// # Arguments /// - /// * `project` - Project ID for this request. - pub fn aggregated_list(&self, project: &str) -> DiskTypeAggregatedListCall<'a, C, A> { - DiskTypeAggregatedListCall { + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the managed instance group is located. + pub fn list(&self, project: &str, zone: &str) -> InstanceGroupManagerListCall<'a, C, A> { + InstanceGroupManagerListCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists managed instances. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the managed instance group. + pub fn list_managed_instances(&self, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { + InstanceGroupManagerListManagedInstanceCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a managed instance group resource in the specified project using the data that is included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the managed instance group is located. + pub fn insert(&self, request: InstanceGroupManager, project: &str, zone: &str) -> InstanceGroupManagerInsertCall<'a, C, A> { + InstanceGroupManagerInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of managed instance groups, and groups them by project and zone. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + pub fn aggregated_list(&self, project: &str) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { + InstanceGroupManagerAggregatedListCall { hub: self.hub, _project: project.to_string(), _page_token: Default::default(), @@ -4946,20 +5961,155 @@ impl<'a, C, A> DiskTypeMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the list of disk type resources available to the specified project. + /// Deletes the specified instances. The instances are deleted and removed from the instance group and any target pools where they are a member. The managed instance group automatically reduces its targetSize value by the number of instances that you delete. /// /// # Arguments /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone for this request. - pub fn list(&self, project: &str, zone: &str) -> DiskTypeListCall<'a, C, A> { - DiskTypeListCall { + /// * `request` - No description provided. + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the instance group manager. + pub fn delete_instances(&self, request: InstanceGroupManagersDeleteInstancesRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { + InstanceGroupManagerDeleteInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the instance group manager. + pub fn set_instance_template(&self, request: InstanceGroupManagersSetInstanceTemplateRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + InstanceGroupManagerSetInstanceTemplateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Modifies the target pools to which all new instances in this group are assigned. The target pools for existing instances in the group do not change unless you recreate them. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the instance group manager. + pub fn set_target_pools(&self, request: InstanceGroupManagersSetTargetPoolsRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { + InstanceGroupManagerSetTargetPoolCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified managed instance group resource. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the instance group manager to delete. + pub fn delete(&self, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerDeleteCall<'a, C, A> { + InstanceGroupManagerDeleteCall { hub: self.hub, _project: project.to_string(), _zone: zone.to_string(), - _page_token: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), + _instance_group_manager: instance_group_manager.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified managed instance group resource. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the instance group manager resource. + pub fn get(&self, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerGetCall<'a, C, A> { + InstanceGroupManagerGetCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Removes the specified instances from the managed instance group, and from any target pools where they are a member. The instances are not deleted. The managed instance group automatically reduces its targetSize value by the number of instances that you abandon from the group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the instance group manager. + pub fn abandon_instances(&self, request: InstanceGroupManagersAbandonInstancesRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { + InstanceGroupManagerAbandonInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Recreates the specified instances. The instances are deleted, then recreated using the managed instance group's current instance template. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the instance group manager. + pub fn recreate_instances(&self, request: InstanceGroupManagersRecreateInstancesRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { + InstanceGroupManagerRecreateInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5203,6 +6353,29 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Sets metadata for the specified instance to the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + /// * `instance` - Name of the instance scoping this request. + pub fn set_metadata(&self, request: Metadata, project: &str, zone: &str, instance: &str) -> InstanceSetMetadataCall<'a, C, A> { + InstanceSetMetadataCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance: instance.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// This method starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. @@ -5270,18 +6443,16 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets metadata for the specified instance to the data included in the request. + /// This method stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses,will continue to be charged until they are deleted. For more information, see Stopping an instance. /// /// # Arguments /// - /// * `request` - No description provided. /// * `project` - Project ID for this request. /// * `zone` - The name of the zone for this request. - /// * `instance` - Name of the instance scoping this request. - pub fn set_metadata(&self, request: Metadata, project: &str, zone: &str, instance: &str) -> InstanceSetMetadataCall<'a, C, A> { - InstanceSetMetadataCall { + /// * `instance` - Name of the instance resource to stop. + pub fn stop(&self, project: &str, zone: &str, instance: &str) -> InstanceStopCall<'a, C, A> { + InstanceStopCall { hub: self.hub, - _request: request, _project: project.to_string(), _zone: zone.to_string(), _instance: instance.to_string(), @@ -5316,16 +6487,18 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// This method stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses,will continue to be charged until they are deleted. For more information, see Stopping an instance. + /// Attaches a Disk resource to an instance. /// /// # Arguments /// + /// * `request` - No description provided. /// * `project` - Project ID for this request. /// * `zone` - The name of the zone for this request. - /// * `instance` - Name of the instance resource to stop. - pub fn stop(&self, project: &str, zone: &str, instance: &str) -> InstanceStopCall<'a, C, A> { - InstanceStopCall { + /// * `instance` - Instance name. + pub fn attach_disk(&self, request: AttachedDisk, project: &str, zone: &str, instance: &str) -> InstanceAttachDiskCall<'a, C, A> { + InstanceAttachDiskCall { hub: self.hub, + _request: request, _project: project.to_string(), _zone: zone.to_string(), _instance: instance.to_string(), @@ -5356,6 +6529,28 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of instance resources contained within the specified zone. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + pub fn list(&self, project: &str, zone: &str) -> InstanceListCall<'a, C, A> { + InstanceListCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Performs a hard reset on the instance. @@ -5402,51 +6597,6 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Attaches a Disk resource to an instance. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone for this request. - /// * `instance` - Instance name. - pub fn attach_disk(&self, request: AttachedDisk, project: &str, zone: &str, instance: &str) -> InstanceAttachDiskCall<'a, C, A> { - InstanceAttachDiskCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _zone: zone.to_string(), - _instance: instance.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the list of instance resources contained within the specified zone. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone for this request. - pub fn list(&self, project: &str, zone: &str) -> InstanceListCall<'a, C, A> { - InstanceListCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _page_token: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// /// # Arguments /// @@ -5648,6 +6798,147 @@ impl<'a, C, A> BackendServiceMethods<'a, C, A> { +/// A builder providing access to all methods supported on *image* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `delete(...)`, `deprecate(...)`, `get(...)`, `insert(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.images(); +/// # } +/// ``` +pub struct ImageMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for ImageMethods<'a, C, A> {} + +impl<'a, C, A> ImageMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of image resources available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn list(&self, project: &str) -> ImageListCall<'a, C, A> { + ImageListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the deprecation status of an image. + /// + /// If an empty request body is given, clears the deprecation status instead. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `image` - Image name. + pub fn deprecate(&self, request: DeprecationStatus, project: &str, image: &str) -> ImageDeprecateCall<'a, C, A> { + ImageDeprecateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _image: image.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates an image resource in the specified project using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + pub fn insert(&self, request: Image, project: &str) -> ImageInsertCall<'a, C, A> { + ImageInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified image resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `image` - Name of the image resource to return. + pub fn get(&self, project: &str, image: &str) -> ImageGetCall<'a, C, A> { + ImageGetCall { + hub: self.hub, + _project: project.to_string(), + _image: image.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified image resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `image` - Name of the image resource to delete. + pub fn delete(&self, project: &str, image: &str) -> ImageDeleteCall<'a, C, A> { + ImageDeleteCall { + hub: self.hub, + _project: project.to_string(), + _image: image.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *license* resources. /// It is not used directly, but through the `Compute` hub. /// @@ -5866,7 +7157,7 @@ impl<'a, C, A> GlobalOperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the list of operation resources contained within the specified project. + /// Retrieves the list of Operation resources contained within the specified project. /// /// # Arguments /// @@ -5886,12 +7177,32 @@ impl<'a, C, A> GlobalOperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the specified operation resource. + /// Retrieves the list of all operations grouped by scope. /// /// # Arguments /// /// * `project` - Project ID for this request. - /// * `operation` - Name of the operation resource to return. + pub fn aggregated_list(&self, project: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { + GlobalOperationAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified Operations resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `operation` - Name of the Operations resource to return. pub fn get(&self, project: &str, operation: &str) -> GlobalOperationGetCall<'a, C, A> { GlobalOperationGetCall { hub: self.hub, @@ -5905,12 +7216,12 @@ impl<'a, C, A> GlobalOperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified operation resource. + /// Deletes the specified Operations resource. /// /// # Arguments /// /// * `project` - Project ID for this request. - /// * `operation` - Name of the operation resource to delete. + /// * `operation` - Name of the Operations resource to delete. pub fn delete(&self, project: &str, operation: &str) -> GlobalOperationDeleteCall<'a, C, A> { GlobalOperationDeleteCall { hub: self.hub, @@ -5921,18 +7232,430 @@ impl<'a, C, A> GlobalOperationMethods<'a, C, A> { _additional_params: Default::default(), } } +} + + + +/// A builder providing access to all methods supported on *autoscaler* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.autoscalers(); +/// # } +/// ``` +pub struct AutoscalerMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for AutoscalerMethods<'a, C, A> {} + +impl<'a, C, A> AutoscalerMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the list of all operations grouped by scope. + /// Deletes the specified autoscaler resource. /// /// # Arguments /// - /// * `project` - Project ID for this request. - pub fn aggregated_list(&self, project: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { - GlobalOperationAggregatedListCall { + /// * `project` - Name of the project scoping this request. + /// * `zone` - Name of the zone scoping this request. + /// * `autoscaler` - Name of the persistent autoscaler resource to delete. + pub fn delete(&self, project: &str, zone: &str, autoscaler: &str) -> AutoscalerDeleteCall<'a, C, A> { + AutoscalerDeleteCall { hub: self.hub, _project: project.to_string(), + _zone: zone.to_string(), + _autoscaler: autoscaler.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified autoscaler resource. + /// + /// # Arguments + /// + /// * `project` - Name of the project scoping this request. + /// * `zone` - Name of the zone scoping this request. + /// * `autoscaler` - Name of the persistent autoscaler resource to return. + pub fn get(&self, project: &str, zone: &str, autoscaler: &str) -> AutoscalerGetCall<'a, C, A> { + AutoscalerGetCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _autoscaler: autoscaler.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of autoscaler resources contained within the specified zone. + /// + /// # Arguments + /// + /// * `project` - Name of the project scoping this request. + /// * `zone` - Name of the zone scoping this request. + pub fn list(&self, project: &str, zone: &str) -> AutoscalerListCall<'a, C, A> { + AutoscalerListCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an autoscaler resource in the specified project using the data included in the request. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Name of the project scoping this request. + /// * `zone` - Name of the zone scoping this request. + /// * `autoscaler` - Name of the autoscaler resource to update. + pub fn patch(&self, request: Autoscaler, project: &str, zone: &str, autoscaler: &str) -> AutoscalerPatchCall<'a, C, A> { + AutoscalerPatchCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _autoscaler: autoscaler.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates an autoscaler resource in the specified project using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Name of the project scoping this request. + /// * `zone` - Name of the zone scoping this request. + pub fn insert(&self, request: Autoscaler, project: &str, zone: &str) -> AutoscalerInsertCall<'a, C, A> { + AutoscalerInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of autoscalers grouped by scope. + /// + /// # Arguments + /// + /// * `project` - Name of the project scoping this request. + pub fn aggregated_list(&self, project: &str) -> AutoscalerAggregatedListCall<'a, C, A> { + AutoscalerAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an autoscaler resource in the specified project using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Name of the project scoping this request. + /// * `zone` - Name of the zone scoping this request. + pub fn update(&self, request: Autoscaler, project: &str, zone: &str) -> AutoscalerUpdateCall<'a, C, A> { + AutoscalerUpdateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _autoscaler: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *instanceGroup* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `add_instances(...)`, `aggregated_list(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `list_instances(...)`, `remove_instances(...)` and `set_named_ports(...)` +/// // to build up your call. +/// let rb = hub.instance_groups(); +/// # } +/// ``` +pub struct InstanceGroupMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for InstanceGroupMethods<'a, C, A> {} + +impl<'a, C, A> InstanceGroupMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified instance group. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the instance group is located. + /// * `instanceGroup` - The name of the instance group to delete. + pub fn delete(&self, project: &str, zone: &str, instance_group: &str) -> InstanceGroupDeleteCall<'a, C, A> { + InstanceGroupDeleteCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group: instance_group.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists instances in an instance group. The parameters for this method specify whether the list filters instances by state and named ports information. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the instance group is located. + /// * `instanceGroup` - The name of the instance group from which you want to generate a list of included instances. + pub fn list_instances(&self, request: InstanceGroupsListInstancesRequest, project: &str, zone: &str, instance_group: &str) -> InstanceGroupListInstanceCall<'a, C, A> { + InstanceGroupListInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group: instance_group.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates an instance group in the specified project using the parameters that are included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the instance group is located. + pub fn insert(&self, request: InstanceGroup, project: &str, zone: &str) -> InstanceGroupInsertCall<'a, C, A> { + InstanceGroupInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified instance group resource. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the instance group is located. + /// * `instanceGroup` - The name of the instance group. + pub fn get(&self, project: &str, zone: &str, instance_group: &str) -> InstanceGroupGetCall<'a, C, A> { + InstanceGroupGetCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group: instance_group.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Removes a list of instances from an instance group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the instance group is located. + /// * `instanceGroup` - The name of the instance group where the specified instances will be removed. + pub fn remove_instances(&self, request: InstanceGroupsRemoveInstancesRequest, project: &str, zone: &str, instance_group: &str) -> InstanceGroupRemoveInstanceCall<'a, C, A> { + InstanceGroupRemoveInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group: instance_group.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Adds a list of instances to an instance group. All of the instances in the instance group must be in the same network. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the instance group is located. + /// * `instanceGroup` - The name of the instance group where you are adding instances. + pub fn add_instances(&self, request: InstanceGroupsAddInstancesRequest, project: &str, zone: &str, instance_group: &str) -> InstanceGroupAddInstanceCall<'a, C, A> { + InstanceGroupAddInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group: instance_group.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the named ports in an instance group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the instance group is located. + /// * `instanceGroup` - The name of the instance group where the named ports are updated. + pub fn set_named_ports(&self, request: InstanceGroupsSetNamedPortsRequest, project: &str, zone: &str, instance_group: &str) -> InstanceGroupSetNamedPortCall<'a, C, A> { + InstanceGroupSetNamedPortCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group: instance_group.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of instance groups, and sorts them by zone. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + pub fn aggregated_list(&self, project: &str) -> InstanceGroupAggregatedListCall<'a, C, A> { + InstanceGroupAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of instance groups that are located in the specified project and zone. + /// + /// # Arguments + /// + /// * `project` - The project ID for this request. + /// * `zone` - The URL of the zone where the instance group is located. + pub fn list(&self, project: &str, zone: &str) -> InstanceGroupListCall<'a, C, A> { + InstanceGroupListCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), _page_token: Default::default(), _max_results: Default::default(), _filter: Default::default(), @@ -6063,26 +7786,6 @@ impl<'a, C, A> MethodsBuilder for ForwardingRuleMethods<'a, C, A> {} impl<'a, C, A> ForwardingRuleMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Retrieves the list of forwarding rules grouped by scope. - /// - /// # Arguments - /// - /// * `project` - Name of the project scoping this request. - pub fn aggregated_list(&self, project: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { - ForwardingRuleAggregatedListCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Creates a ForwardingRule resource in the specified project and region using the data included in the request. @@ -6127,27 +7830,6 @@ impl<'a, C, A> ForwardingRuleMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Returns the specified ForwardingRule resource. - /// - /// # Arguments - /// - /// * `project` - Name of the project scoping this request. - /// * `region` - Name of the region scoping this request. - /// * `forwardingRule` - Name of the ForwardingRule resource to return. - pub fn get(&self, project: &str, region: &str, forwarding_rule: &str) -> ForwardingRuleGetCall<'a, C, A> { - ForwardingRuleGetCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _forwarding_rule: forwarding_rule.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves the list of ForwardingRule resources available to the specified project and region. @@ -6170,6 +7852,47 @@ impl<'a, C, A> ForwardingRuleMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of forwarding rules grouped by scope. + /// + /// # Arguments + /// + /// * `project` - Name of the project scoping this request. + pub fn aggregated_list(&self, project: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { + ForwardingRuleAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified ForwardingRule resource. + /// + /// # Arguments + /// + /// * `project` - Name of the project scoping this request. + /// * `region` - Name of the region scoping this request. + /// * `forwardingRule` - Name of the ForwardingRule resource to return. + pub fn get(&self, project: &str, region: &str, forwarding_rule: &str) -> ForwardingRuleGetCall<'a, C, A> { + ForwardingRuleGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _forwarding_rule: forwarding_rule.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes the specified ForwardingRule resource. @@ -6232,28 +7955,6 @@ impl<'a, C, A> MethodsBuilder for TargetPoolMethods<'a, C, A> {} impl<'a, C, A> TargetPoolMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Retrieves the list of TargetPool resources available to the specified project and region. - /// - /// # Arguments - /// - /// * `project` - Name of the project scoping this request. - /// * `region` - Name of the region scoping this request. - pub fn list(&self, project: &str, region: &str) -> TargetPoolListCall<'a, C, A> { - TargetPoolListCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _page_token: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Adds health check URL to targetPool. @@ -6475,6 +8176,28 @@ impl<'a, C, A> TargetPoolMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of TargetPool resources available to the specified project and region. + /// + /// # Arguments + /// + /// * `project` - Name of the project scoping this request. + /// * `region` - Name of the region scoping this request. + pub fn list(&self, project: &str, region: &str) -> TargetPoolListCall<'a, C, A> { + TargetPoolListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -6582,15 +8305,15 @@ impl<'a, C, A> TargetInstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns the specified TargetInstance resource. + /// Deletes the specified TargetInstance resource. /// /// # Arguments /// /// * `project` - Name of the project scoping this request. /// * `zone` - Name of the zone scoping this request. - /// * `targetInstance` - Name of the TargetInstance resource to return. - pub fn get(&self, project: &str, zone: &str, target_instance: &str) -> TargetInstanceGetCall<'a, C, A> { - TargetInstanceGetCall { + /// * `targetInstance` - Name of the TargetInstance resource to delete. + pub fn delete(&self, project: &str, zone: &str, target_instance: &str) -> TargetInstanceDeleteCall<'a, C, A> { + TargetInstanceDeleteCall { hub: self.hub, _project: project.to_string(), _zone: zone.to_string(), @@ -6603,15 +8326,15 @@ impl<'a, C, A> TargetInstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified TargetInstance resource. + /// Returns the specified TargetInstance resource. /// /// # Arguments /// /// * `project` - Name of the project scoping this request. /// * `zone` - Name of the zone scoping this request. - /// * `targetInstance` - Name of the TargetInstance resource to delete. - pub fn delete(&self, project: &str, zone: &str, target_instance: &str) -> TargetInstanceDeleteCall<'a, C, A> { - TargetInstanceDeleteCall { + /// * `targetInstance` - Name of the TargetInstance resource to return. + pub fn get(&self, project: &str, zone: &str, target_instance: &str) -> TargetInstanceGetCall<'a, C, A> { + TargetInstanceGetCall { hub: self.hub, _project: project.to_string(), _zone: zone.to_string(), @@ -6663,25 +8386,6 @@ impl<'a, C, A> MethodsBuilder for GlobalForwardingRuleMethods<'a, C, A> {} impl<'a, C, A> GlobalForwardingRuleMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Returns the specified ForwardingRule resource. - /// - /// # Arguments - /// - /// * `project` - Name of the project scoping this request. - /// * `forwardingRule` - Name of the ForwardingRule resource to return. - pub fn get(&self, project: &str, forwarding_rule: &str) -> GlobalForwardingRuleGetCall<'a, C, A> { - GlobalForwardingRuleGetCall { - hub: self.hub, - _project: project.to_string(), - _forwarding_rule: forwarding_rule.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes the specified ForwardingRule resource. @@ -6760,142 +8464,20 @@ impl<'a, C, A> GlobalForwardingRuleMethods<'a, C, A> { _additional_params: Default::default(), } } -} - - - -/// A builder providing access to all methods supported on *image* resources. -/// It is not used directly, but through the `Compute` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_compute1 as compute1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use compute1::Compute; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::new(), -/// ::default(), None); -/// let mut hub = Compute::new(hyper::Client::new(), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `deprecate(...)`, `get(...)`, `insert(...)` and `list(...)` -/// // to build up your call. -/// let rb = hub.images(); -/// # } -/// ``` -pub struct ImageMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, -} - -impl<'a, C, A> MethodsBuilder for ImageMethods<'a, C, A> {} - -impl<'a, C, A> ImageMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the list of image resources available to the specified project. + /// Returns the specified ForwardingRule resource. /// /// # Arguments /// - /// * `project` - Project ID for this request. - pub fn list(&self, project: &str) -> ImageListCall<'a, C, A> { - ImageListCall { + /// * `project` - Name of the project scoping this request. + /// * `forwardingRule` - Name of the ForwardingRule resource to return. + pub fn get(&self, project: &str, forwarding_rule: &str) -> GlobalForwardingRuleGetCall<'a, C, A> { + GlobalForwardingRuleGetCall { hub: self.hub, _project: project.to_string(), - _page_token: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified image resource. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `image` - Name of the image resource to delete. - pub fn delete(&self, project: &str, image: &str) -> ImageDeleteCall<'a, C, A> { - ImageDeleteCall { - hub: self.hub, - _project: project.to_string(), - _image: image.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Sets the deprecation status of an image. - /// - /// If an empty request body is given, clears the deprecation status instead. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `image` - Image name. - pub fn deprecate(&self, request: DeprecationStatus, project: &str, image: &str) -> ImageDeprecateCall<'a, C, A> { - ImageDeprecateCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _image: image.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates an image resource in the specified project using the data included in the request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - pub fn insert(&self, request: Image, project: &str) -> ImageInsertCall<'a, C, A> { - ImageInsertCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the specified image resource. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `image` - Name of the image resource to return. - pub fn get(&self, project: &str, image: &str) -> ImageGetCall<'a, C, A> { - ImageGetCall { - hub: self.hub, - _project: project.to_string(), - _image: image.to_string(), + _forwarding_rule: forwarding_rule.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -7155,6 +8737,110 @@ impl<'a, C, A> TargetVpnGatewayMethods<'a, C, A> { +/// A builder providing access to all methods supported on *diskType* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `aggregated_list(...)`, `get(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.disk_types(); +/// # } +/// ``` +pub struct DiskTypeMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for DiskTypeMethods<'a, C, A> {} + +impl<'a, C, A> DiskTypeMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified disk type resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + /// * `diskType` - Name of the disk type resource to return. + pub fn get(&self, project: &str, zone: &str, disk_type: &str) -> DiskTypeGetCall<'a, C, A> { + DiskTypeGetCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _disk_type: disk_type.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of disk type resources grouped by scope. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn aggregated_list(&self, project: &str) -> DiskTypeAggregatedListCall<'a, C, A> { + DiskTypeAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of disk type resources available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + pub fn list(&self, project: &str, zone: &str) -> DiskTypeListCall<'a, C, A> { + DiskTypeListCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *project* resources. /// It is not used directly, but through the `Compute` hub. /// @@ -7644,25 +9330,6 @@ impl<'a, C, A> TargetHttpProxyMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Returns the specified TargetHttpProxy resource. - /// - /// # Arguments - /// - /// * `project` - Name of the project scoping this request. - /// * `targetHttpProxy` - Name of the TargetHttpProxy resource to return. - pub fn get(&self, project: &str, target_http_proxy: &str) -> TargetHttpProxyGetCall<'a, C, A> { - TargetHttpProxyGetCall { - hub: self.hub, - _project: project.to_string(), - _target_http_proxy: target_http_proxy.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Changes the URL map for TargetHttpProxy. @@ -7684,6 +9351,25 @@ impl<'a, C, A> TargetHttpProxyMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns the specified TargetHttpProxy resource. + /// + /// # Arguments + /// + /// * `project` - Name of the project scoping this request. + /// * `targetHttpProxy` - Name of the TargetHttpProxy resource to return. + pub fn get(&self, project: &str, target_http_proxy: &str) -> TargetHttpProxyGetCall<'a, C, A> { + TargetHttpProxyGetCall { + hub: self.hub, + _project: project.to_string(), + _target_http_proxy: target_http_proxy.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates a TargetHttpProxy resource in the specified project using the data included in the request. @@ -7746,13 +9432,13 @@ impl<'a, C, A> ZoneOperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified zone-specific operation resource. + /// Deletes the specified zone-specific Operations resource. /// /// # Arguments /// /// * `project` - Project ID for this request. /// * `zone` - Name of the zone scoping this request. - /// * `operation` - Name of the operation resource to delete. + /// * `operation` - Name of the Operations resource to delete. pub fn delete(&self, project: &str, zone: &str, operation: &str) -> ZoneOperationDeleteCall<'a, C, A> { ZoneOperationDeleteCall { hub: self.hub, @@ -7767,7 +9453,7 @@ impl<'a, C, A> ZoneOperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the list of operation resources contained within the specified zone. + /// Retrieves the list of Operation resources contained within the specified zone. /// /// # Arguments /// @@ -7789,13 +9475,13 @@ impl<'a, C, A> ZoneOperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the specified zone-specific operation resource. + /// Retrieves the specified zone-specific Operations resource. /// /// # Arguments /// /// * `project` - Project ID for this request. /// * `zone` - Name of the zone scoping this request. - /// * `operation` - Name of the operation resource to return. + /// * `operation` - Name of the Operations resource to return. pub fn get(&self, project: &str, zone: &str, operation: &str) -> ZoneOperationGetCall<'a, C, A> { ZoneOperationGetCall { hub: self.hub, @@ -8007,25 +9693,6 @@ impl<'a, C, A> FirewallMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Creates a firewall resource in the specified project using the data included in the request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - pub fn insert(&self, request: Firewall, project: &str) -> FirewallInsertCall<'a, C, A> { - FirewallInsertCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Updates the specified firewall resource with the data included in the request. @@ -8049,17 +9716,17 @@ impl<'a, C, A> FirewallMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified firewall resource. + /// Creates a firewall resource in the specified project using the data included in the request. /// /// # Arguments /// + /// * `request` - No description provided. /// * `project` - Project ID for this request. - /// * `firewall` - Name of the firewall resource to delete. - pub fn delete(&self, project: &str, firewall: &str) -> FirewallDeleteCall<'a, C, A> { - FirewallDeleteCall { + pub fn insert(&self, request: Firewall, project: &str) -> FirewallInsertCall<'a, C, A> { + FirewallInsertCall { hub: self.hub, + _request: request, _project: project.to_string(), - _firewall: firewall.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -8085,6 +9752,25 @@ impl<'a, C, A> FirewallMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified firewall resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `firewall` - Name of the firewall resource to delete. + pub fn delete(&self, project: &str, firewall: &str) -> FirewallDeleteCall<'a, C, A> { + FirewallDeleteCall { + hub: self.hub, + _project: project.to_string(), + _firewall: firewall.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -8150,20 +9836,19 @@ impl<'a, C, A> VpnTunnelMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the list of VpnTunnel resources contained in the specified project and region. + /// Creates a VpnTunnel resource in the specified project and region using the data included in the request. /// /// # Arguments /// + /// * `request` - No description provided. /// * `project` - Project ID for this request. /// * `region` - The name of the region for this request. - pub fn list(&self, project: &str, region: &str) -> VpnTunnelListCall<'a, C, A> { - VpnTunnelListCall { + pub fn insert(&self, request: VpnTunnel, project: &str, region: &str) -> VpnTunnelInsertCall<'a, C, A> { + VpnTunnelInsertCall { hub: self.hub, + _request: request, _project: project.to_string(), _region: region.to_string(), - _page_token: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -8193,19 +9878,20 @@ impl<'a, C, A> VpnTunnelMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a VpnTunnel resource in the specified project and region using the data included in the request. + /// Retrieves the list of VpnTunnel resources contained in the specified project and region. /// /// # Arguments /// - /// * `request` - No description provided. /// * `project` - Project ID for this request. /// * `region` - The name of the region for this request. - pub fn insert(&self, request: VpnTunnel, project: &str, region: &str) -> VpnTunnelInsertCall<'a, C, A> { - VpnTunnelInsertCall { + pub fn list(&self, project: &str, region: &str) -> VpnTunnelListCall<'a, C, A> { + VpnTunnelListCall { hub: self.hub, - _request: request, _project: project.to_string(), _region: region.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -8275,7 +9961,7 @@ impl<'a, C, A> RegionOperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the list of operation resources contained within the specified region. + /// Retrieves the list of Operation resources contained within the specified region. /// /// # Arguments /// @@ -8297,13 +9983,13 @@ impl<'a, C, A> RegionOperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified region-specific operation resource. + /// Deletes the specified region-specific Operations resource. /// /// # Arguments /// /// * `project` - Project ID for this request. /// * `region` - Name of the region scoping this request. - /// * `operation` - Name of the operation resource to delete. + /// * `operation` - Name of the Operations resource to delete. pub fn delete(&self, project: &str, region: &str, operation: &str) -> RegionOperationDeleteCall<'a, C, A> { RegionOperationDeleteCall { hub: self.hub, @@ -8318,13 +10004,13 @@ impl<'a, C, A> RegionOperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the specified region-specific operation resource. + /// Retrieves the specified region-specific Operations resource. /// /// # Arguments /// /// * `project` - Project ID for this request. /// * `region` - Name of the zone scoping this request. - /// * `operation` - Name of the operation resource to return. + /// * `operation` - Name of the Operations resource to return. pub fn get(&self, project: &str, region: &str, operation: &str) -> RegionOperationGetCall<'a, C, A> { RegionOperationGetCall { hub: self.hub, @@ -8346,7 +10032,7 @@ impl<'a, C, A> RegionOperationMethods<'a, C, A> { // CallBuilders ### // ################# -/// Deletes the specified persistent disk. +/// Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. /// /// A builder for the *delete* method supported by a *disk* resource. /// It is not used directly, but through a `DiskMethods` instance. @@ -8805,7 +10491,7 @@ impl<'a, C, A> DiskAggregatedListCall<'a, C, A> where C: BorrowMut DiskAggregatedListCall<'a, C, A> { @@ -8819,7 +10505,14 @@ impl<'a, C, A> DiskAggregatedListCall<'a, C, A> where C: BorrowMut DiskAggregatedListCall<'a, C, A> { @@ -8878,6 +10571,266 @@ impl<'a, C, A> DiskAggregatedListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.disks().get("project", "zone", "disk") +/// .doit(); +/// # } +/// ``` +pub struct DiskGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _disk: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DiskGetCall<'a, C, A> {} + +impl<'a, C, A> DiskGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Disk)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.disks.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("disk", self._disk.to_string())); + for &field in ["alt", "project", "zone", "disk"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks/{disk}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{disk}", "disk")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["disk", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> DiskGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> DiskGetCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the persistent disk to return. + /// + /// Sets the *disk* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn disk(mut self, new_value: &str) -> DiskGetCall<'a, C, A> { + self._disk = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DiskGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DiskGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DiskGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Retrieves the list of persistent disks contained within the specified zone. /// /// A builder for the *list* method supported by a *disk* resource. @@ -8905,9 +10858,9 @@ impl<'a, C, A> DiskAggregatedListCall<'a, C, A> where C: BorrowMut DiskListCall<'a, C, A> where C: BorrowMut, A: oaut self._zone = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> DiskListCall<'a, C, A> { @@ -9103,7 +11056,14 @@ impl<'a, C, A> DiskListCall<'a, C, A> where C: BorrowMut, A: oaut self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> DiskListCall<'a, C, A> { @@ -9195,7 +11155,7 @@ impl<'a, C, A> DiskListCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.disks().insert(req, "project", "zone") -/// .source_image("et") +/// .source_image("Lorem") /// .doit(); /// # } /// ``` @@ -9744,266 +11704,6 @@ impl<'a, C, A> DiskCreateSnapshotCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::new(), auth); -/// // 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.disks().get("project", "zone", "disk") -/// .doit(); -/// # } -/// ``` -pub struct DiskGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _zone: String, - _disk: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DiskGetCall<'a, C, A> {} - -impl<'a, C, A> DiskGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Disk)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.disks.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("disk", self._disk.to_string())); - for &field in ["alt", "project", "zone", "disk"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks/{disk}".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{disk}", "disk")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["disk", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> DiskGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone for this request. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> DiskGetCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// Name of the persistent disk to return. - /// - /// Sets the *disk* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn disk(mut self, new_value: &str) -> DiskGetCall<'a, C, A> { - self._disk = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> DiskGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DiskGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DiskGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Retrieves the list of address resources contained within the specified region. /// /// A builder for the *list* method supported by a *addresse* resource. @@ -10215,7 +11915,7 @@ impl<'a, C, A> AddresseListCall<'a, C, A> where C: BorrowMut, A: self._region = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> AddresseListCall<'a, C, A> { @@ -10229,7 +11929,14 @@ impl<'a, C, A> AddresseListCall<'a, C, A> where C: BorrowMut, A: self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> AddresseListCall<'a, C, A> { @@ -10487,7 +12194,7 @@ impl<'a, C, A> AddresseAggregatedListCall<'a, C, A> where C: BorrowMut AddresseAggregatedListCall<'a, C, A> { @@ -10501,7 +12208,14 @@ impl<'a, C, A> AddresseAggregatedListCall<'a, C, A> where C: BorrowMut AddresseAggregatedListCall<'a, C, A> { @@ -12352,7 +14066,7 @@ impl<'a, C, A> UrlMapListCall<'a, C, A> where C: BorrowMut, A: oa self._project = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> UrlMapListCall<'a, C, A> { @@ -12366,7 +14080,14 @@ impl<'a, C, A> UrlMapListCall<'a, C, A> where C: BorrowMut, A: oa self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> UrlMapListCall<'a, C, A> { @@ -13697,7 +15418,7 @@ impl<'a, C, A> GlobalAddresseListCall<'a, C, A> where C: BorrowMut GlobalAddresseListCall<'a, C, A> { @@ -13711,7 +15432,14 @@ impl<'a, C, A> GlobalAddresseListCall<'a, C, A> where C: BorrowMut GlobalAddresseListCall<'a, C, A> { @@ -14266,7 +15994,7 @@ impl<'a, C, A> GlobalAddresseDeleteCall<'a, C, A> where C: BorrowMut SnapshotGetCall<'a, C, A> where C: BorrowMut, A: o self._project = new_value.to_string(); self } - /// Name of the persistent disk snapshot resource to return. + /// Name of the Snapshot resource to return. /// /// Sets the *snapshot* path property to the given value. /// @@ -14514,7 +16242,7 @@ impl<'a, C, A> SnapshotGetCall<'a, C, A> where C: BorrowMut, A: o } -/// Retrieves the list of persistent disk snapshot resources contained within the specified project. +/// Retrieves the list of Snapshot resources contained within the specified project. /// /// A builder for the *list* method supported by a *snapshot* resource. /// It is not used directly, but through a `SnapshotMethods` instance. @@ -14713,7 +16441,7 @@ impl<'a, C, A> SnapshotListCall<'a, C, A> where C: BorrowMut, A: self._project = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> SnapshotListCall<'a, C, A> { @@ -14727,7 +16455,14 @@ impl<'a, C, A> SnapshotListCall<'a, C, A> where C: BorrowMut, A: self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> SnapshotListCall<'a, C, A> { @@ -14786,7 +16521,9 @@ impl<'a, C, A> SnapshotListCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes the specified persistent disk snapshot resource. +/// Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. +/// +/// For more information, see Deleting snaphots. /// /// A builder for the *delete* method supported by a *snapshot* resource. /// It is not used directly, but through a `SnapshotMethods` instance. @@ -14972,7 +16709,7 @@ impl<'a, C, A> SnapshotDeleteCall<'a, C, A> where C: BorrowMut, A self._project = new_value.to_string(); self } - /// Name of the persistent disk snapshot resource to delete. + /// Name of the Snapshot resource to delete. /// /// Sets the *snapshot* path property to the given value. /// @@ -15034,10 +16771,10 @@ impl<'a, C, A> SnapshotDeleteCall<'a, C, A> where C: BorrowMut, A } -/// Returns the specified disk type resource. +/// Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group removes instances in the order that is outlined in Resizing a managed instance group. /// -/// A builder for the *get* method supported by a *diskType* resource. -/// It is not used directly, but through a `DiskTypeMethods` instance. +/// A builder for the *resize* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. /// /// # Example /// @@ -15060,29 +16797,30 @@ impl<'a, C, A> SnapshotDeleteCall<'a, C, A> where C: BorrowMut, A /// // 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.disk_types().get("project", "zone", "diskType") +/// let result = hub.instance_group_managers().resize("project", "zone", "instanceGroupManager", -82) /// .doit(); /// # } /// ``` -pub struct DiskTypeGetCall<'a, C, A> +pub struct InstanceGroupManagerResizeCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, _project: String, _zone: String, - _disk_type: String, + _instance_group_manager: String, + _size: i32, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for DiskTypeGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for InstanceGroupManagerResizeCall<'a, C, A> {} -impl<'a, C, A> DiskTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> InstanceGroupManagerResizeCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, DiskType)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -15090,13 +16828,14 @@ impl<'a, C, A> DiskTypeGetCall<'a, C, A> where C: BorrowMut, A: o Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.diskTypes.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.resize", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("project", self._project.to_string())); params.push(("zone", self._zone.to_string())); - params.push(("diskType", self._disk_type.to_string())); - for &field in ["alt", "project", "zone", "diskType"].iter() { + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + params.push(("size", self._size.to_string())); + for &field in ["alt", "project", "zone", "instanceGroupManager", "size"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -15108,12 +16847,12 @@ impl<'a, C, A> DiskTypeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes/{diskType}".to_string(); + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize".to_string(); if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{diskType}", "diskType")].iter() { + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -15125,7 +16864,7 @@ impl<'a, C, A> DiskTypeGetCall<'a, C, A> where C: BorrowMut, A: o } { let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["diskType", "zone", "project"].iter() { + for param_name in ["instanceGroupManager", "zone", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -15159,7 +16898,7 @@ impl<'a, C, A> DiskTypeGetCall<'a, C, A> where C: BorrowMut, A: o access_token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()); @@ -15212,34 +16951,44 @@ impl<'a, C, A> DiskTypeGetCall<'a, C, A> where C: BorrowMut, A: o } - /// Project ID for this request. + /// The project ID for this request. /// /// Sets the *project* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> DiskTypeGetCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerResizeCall<'a, C, A> { self._project = new_value.to_string(); self } - /// The name of the zone for this request. + /// The URL of the zone where the managed instance group is located. /// /// Sets the *zone* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> DiskTypeGetCall<'a, C, A> { + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerResizeCall<'a, C, A> { self._zone = new_value.to_string(); self } - /// Name of the disk type resource to return. + /// The name of the instance group manager. /// - /// Sets the *disk type* path property to the given value. + /// Sets the *instance group manager* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn disk_type(mut self, new_value: &str) -> DiskTypeGetCall<'a, C, A> { - self._disk_type = new_value.to_string(); + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerResizeCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + /// + /// Sets the *size* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn size(mut self, new_value: i32) -> InstanceGroupManagerResizeCall<'a, C, A> { + self._size = new_value; self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -15248,7 +16997,7 @@ impl<'a, C, A> DiskTypeGetCall<'a, C, A> where C: BorrowMut, A: o /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> DiskTypeGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupManagerResizeCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -15269,7 +17018,7 @@ impl<'a, C, A> DiskTypeGetCall<'a, C, A> where C: BorrowMut, A: o /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DiskTypeGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerResizeCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -15278,7 +17027,7 @@ impl<'a, C, A> DiskTypeGetCall<'a, C, A> where C: BorrowMut, A: o /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. + /// `Scope::CloudPlatform`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -15286,7 +17035,7 @@ impl<'a, C, A> DiskTypeGetCall<'a, C, A> where C: BorrowMut, A: o /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DiskTypeGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerResizeCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -15294,10 +17043,10 @@ impl<'a, C, A> DiskTypeGetCall<'a, C, A> where C: BorrowMut, A: o } -/// Retrieves the list of disk type resources grouped by scope. +/// Retrieves a list of managed instance groups that are contained within the specified project and zone. /// -/// A builder for the *aggregatedList* method supported by a *diskType* resource. -/// It is not used directly, but through a `DiskTypeMethods` instance. +/// A builder for the *list* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. /// /// # Example /// @@ -15320,286 +17069,14 @@ impl<'a, C, A> DiskTypeGetCall<'a, C, A> where C: BorrowMut, A: o /// // 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.disk_types().aggregated_list("project") -/// .page_token("Lorem") -/// .max_results(84) -/// .filter("clita") +/// let result = hub.instance_group_managers().list("project", "zone") +/// .page_token("clita") +/// .max_results(56) +/// .filter("takimata") /// .doit(); /// # } /// ``` -pub struct DiskTypeAggregatedListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DiskTypeAggregatedListCall<'a, C, A> {} - -impl<'a, C, A> DiskTypeAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, DiskTypeAggregatedList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.diskTypes.aggregatedList", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/aggregated/diskTypes".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> DiskTypeAggregatedListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> DiskTypeAggregatedListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum count of results to be returned. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> DiskTypeAggregatedListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// Filter expression for filtering listed resources. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> DiskTypeAggregatedListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> DiskTypeAggregatedListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DiskTypeAggregatedListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DiskTypeAggregatedListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Retrieves the list of disk type resources available to the specified project. -/// -/// A builder for the *list* method supported by a *diskType* resource. -/// It is not used directly, but through a `DiskTypeMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::new(), auth); -/// // 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.disk_types().list("project", "zone") -/// .page_token("nonumy") -/// .max_results(88) -/// .filter("sanctus") -/// .doit(); -/// # } -/// ``` -pub struct DiskTypeListCall<'a, C, A> +pub struct InstanceGroupManagerListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, @@ -15613,13 +17090,13 @@ pub struct DiskTypeListCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for DiskTypeListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for InstanceGroupManagerListCall<'a, C, A> {} -impl<'a, C, A> DiskTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> InstanceGroupManagerListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, DiskTypeList)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManagerList)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -15627,7 +17104,7 @@ impl<'a, C, A> DiskTypeListCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.diskTypes.list", + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.list", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); params.push(("project", self._project.to_string())); @@ -15653,7 +17130,7 @@ impl<'a, C, A> DiskTypeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes".to_string(); + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -15757,44 +17234,51 @@ impl<'a, C, A> DiskTypeListCall<'a, C, A> where C: BorrowMut, A: } - /// Project ID for this request. + /// The project ID for this request. /// /// Sets the *project* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> DiskTypeListCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerListCall<'a, C, A> { self._project = new_value.to_string(); self } - /// The name of the zone for this request. + /// The URL of the zone where the managed instance group is located. /// /// Sets the *zone* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> DiskTypeListCall<'a, C, A> { + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerListCall<'a, C, A> { self._zone = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> DiskTypeListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> InstanceGroupManagerListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> DiskTypeListCall<'a, C, A> { + pub fn max_results(mut self, new_value: u32) -> InstanceGroupManagerListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> DiskTypeListCall<'a, C, A> { + pub fn filter(mut self, new_value: &str) -> InstanceGroupManagerListCall<'a, C, A> { self._filter = Some(new_value.to_string()); self } @@ -15804,7 +17288,7 @@ impl<'a, C, A> DiskTypeListCall<'a, C, A> where C: BorrowMut, A: /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> DiskTypeListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupManagerListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -15825,7 +17309,7 @@ impl<'a, C, A> DiskTypeListCall<'a, C, A> where C: BorrowMut, A: /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DiskTypeListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -15842,7 +17326,2800 @@ impl<'a, C, A> DiskTypeListCall<'a, C, A> where C: BorrowMut, A: /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DiskTypeListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists managed instances. +/// +/// A builder for the *listManagedInstances* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.instance_group_managers().list_managed_instances("project", "zone", "instanceGroupManager") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerListManagedInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _instance_group_manager: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerListManagedInstanceCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerListManagedInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManagersListManagedInstancesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.listManagedInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + for &field in ["alt", "project", "zone", "instanceGroupManager"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Creates a managed instance group resource in the specified project using the data that is included in the request. +/// +/// A builder for the *insert* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManager; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = InstanceGroupManager::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.instance_group_managers().insert(req, "project", "zone") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManager, + _project: String, + _zone: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerInsertCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + for &field in ["alt", "project", "zone"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManager) -> InstanceGroupManagerInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerInsertCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupManagerInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerInsertCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves the list of managed instance groups, and groups them by project and zone. +/// +/// A builder for the *aggregatedList* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.instance_group_managers().aggregated_list("project") +/// .page_token("invidunt") +/// .max_results(35) +/// .filter("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManagerAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/aggregated/instanceGroupManagers".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerAggregatedListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Deletes the specified instances. The instances are deleted and removed from the instance group and any target pools where they are a member. The managed instance group automatically reduces its targetSize value by the number of instances that you delete. +/// +/// A builder for the *deleteInstances* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManagersDeleteInstancesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = InstanceGroupManagersDeleteInstancesRequest::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.instance_group_managers().delete_instances(req, "project", "zone", "instanceGroupManager") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerDeleteInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManagersDeleteInstancesRequest, + _project: String, + _zone: String, + _instance_group_manager: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerDeleteInstanceCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerDeleteInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.deleteInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + for &field in ["alt", "project", "zone", "instanceGroupManager"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManagersDeleteInstancesRequest) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group manager. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them. +/// +/// A builder for the *setInstanceTemplate* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManagersSetInstanceTemplateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = InstanceGroupManagersSetInstanceTemplateRequest::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.instance_group_managers().set_instance_template(req, "project", "zone", "instanceGroupManager") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManagersSetInstanceTemplateRequest, + _project: String, + _zone: String, + _instance_group_manager: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.setInstanceTemplate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + for &field in ["alt", "project", "zone", "instanceGroupManager"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManagersSetInstanceTemplateRequest) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group manager. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Modifies the target pools to which all new instances in this group are assigned. The target pools for existing instances in the group do not change unless you recreate them. +/// +/// A builder for the *setTargetPools* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManagersSetTargetPoolsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = InstanceGroupManagersSetTargetPoolsRequest::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.instance_group_managers().set_target_pools(req, "project", "zone", "instanceGroupManager") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerSetTargetPoolCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManagersSetTargetPoolsRequest, + _project: String, + _zone: String, + _instance_group_manager: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerSetTargetPoolCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerSetTargetPoolCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.setTargetPools", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + for &field in ["alt", "project", "zone", "instanceGroupManager"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManagersSetTargetPoolsRequest) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group manager. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Deletes the specified managed instance group resource. +/// +/// A builder for the *delete* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.instance_group_managers().delete("project", "zone", "instanceGroupManager") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _instance_group_manager: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerDeleteCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + for &field in ["alt", "project", "zone", "instanceGroupManager"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerDeleteCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group manager to delete. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerDeleteCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupManagerDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns the specified managed instance group resource. +/// +/// A builder for the *get* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.instance_group_managers().get("project", "zone", "instanceGroupManager") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _instance_group_manager: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerGetCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManager)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + for &field in ["alt", "project", "zone", "instanceGroupManager"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerGetCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group manager resource. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerGetCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupManagerGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Removes the specified instances from the managed instance group, and from any target pools where they are a member. The instances are not deleted. The managed instance group automatically reduces its targetSize value by the number of instances that you abandon from the group. +/// +/// A builder for the *abandonInstances* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManagersAbandonInstancesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = InstanceGroupManagersAbandonInstancesRequest::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.instance_group_managers().abandon_instances(req, "project", "zone", "instanceGroupManager") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerAbandonInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManagersAbandonInstancesRequest, + _project: String, + _zone: String, + _instance_group_manager: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerAbandonInstanceCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerAbandonInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.abandonInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + for &field in ["alt", "project", "zone", "instanceGroupManager"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManagersAbandonInstancesRequest) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group manager. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Recreates the specified instances. The instances are deleted, then recreated using the managed instance group's current instance template. +/// +/// A builder for the *recreateInstances* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManagersRecreateInstancesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = InstanceGroupManagersRecreateInstancesRequest::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.instance_group_managers().recreate_instances(req, "project", "zone", "instanceGroupManager") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerRecreateInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManagersRecreateInstancesRequest, + _project: String, + _zone: String, + _instance_group_manager: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerRecreateInstanceCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerRecreateInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.recreateInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + for &field in ["alt", "project", "zone", "instanceGroupManager"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManagersRecreateInstancesRequest) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group manager. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -16125,9 +20402,9 @@ impl<'a, C, A> ZoneGetCall<'a, C, A> where C: BorrowMut, A: oauth /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.zones().list("project") -/// .page_token("invidunt") -/// .max_results(35) -/// .filter("sadipscing") +/// .page_token("est") +/// .max_results(55) +/// .filter("accusam") /// .doit(); /// # } /// ``` @@ -16297,7 +20574,7 @@ impl<'a, C, A> ZoneListCall<'a, C, A> where C: BorrowMut, A: oaut self._project = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ZoneListCall<'a, C, A> { @@ -16311,7 +20588,14 @@ impl<'a, C, A> ZoneListCall<'a, C, A> where C: BorrowMut, A: oaut self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ZoneListCall<'a, C, A> { @@ -16948,7 +21232,7 @@ impl<'a, C, A> InstanceDeleteCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instances().get_serial_port_output("project", "zone", "instance") -/// .port(-30) +/// .port(-78) /// .doit(); /// # } /// ``` @@ -17134,7 +21418,7 @@ impl<'a, C, A> InstanceGetSerialPortOutputCall<'a, C, A> where C: BorrowMut InstanceGetSerialPortOutputCall<'a, C, A> { @@ -17219,7 +21503,7 @@ impl<'a, C, A> InstanceGetSerialPortOutputCall<'a, C, A> where C: BorrowMut InstanceAddAccessConfigCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::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 = Metadata::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.instances().set_metadata(req, "project", "zone", "instance") +/// .doit(); +/// # } +/// ``` +pub struct InstanceSetMetadataCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: Metadata, + _project: String, + _zone: String, + _instance: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceSetMetadataCall<'a, C, A> {} + +impl<'a, C, A> InstanceSetMetadataCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instances.setMetadata", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instance", self._instance.to_string())); + for &field in ["alt", "project", "zone", "instance"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMetadata".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instance}", "instance")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instance", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Metadata) -> InstanceSetMetadataCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceSetMetadataCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceSetMetadataCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the instance scoping this request. + /// + /// Sets the *instance* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance(mut self, new_value: &str) -> InstanceSetMetadataCall<'a, C, A> { + self._instance = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceSetMetadataCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceSetMetadataCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceSetMetadataCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// This method starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. /// /// A builder for the *start* method supported by a *instance* resource. @@ -18591,9 +23166,9 @@ impl<'a, C, A> InstanceSetTagCall<'a, C, A> where C: BorrowMut, A } -/// Sets metadata for the specified instance to the data included in the request. +/// This method stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses,will continue to be charged until they are deleted. For more information, see Stopping an instance. /// -/// A builder for the *setMetadata* method supported by a *instance* resource. +/// A builder for the *stop* method supported by a *instance* resource. /// It is not used directly, but through a `InstanceMethods` instance. /// /// # Example @@ -18604,7 +23179,6 @@ impl<'a, C, A> InstanceSetTagCall<'a, C, A> where C: BorrowMut, A /// # extern crate hyper; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_compute1 as compute1; -/// use compute1::Metadata; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -18615,23 +23189,17 @@ impl<'a, C, A> InstanceSetTagCall<'a, C, A> where C: BorrowMut, A /// # hyper::Client::new(), /// # ::default(), None); /// # let mut hub = Compute::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 = Metadata::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.instances().set_metadata(req, "project", "zone", "instance") +/// let result = hub.instances().stop("project", "zone", "instance") /// .doit(); /// # } /// ``` -pub struct InstanceSetMetadataCall<'a, C, A> +pub struct InstanceStopCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, - _request: Metadata, _project: String, _zone: String, _instance: String, @@ -18640,9 +23208,9 @@ pub struct InstanceSetMetadataCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for InstanceSetMetadataCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for InstanceStopCall<'a, C, A> {} -impl<'a, C, A> InstanceSetMetadataCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> InstanceStopCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -18654,9 +23222,9 @@ impl<'a, C, A> InstanceSetMetadataCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.instances.setMetadata", + dlg.begin(MethodInfo { id: "compute.instances.stop", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("project", self._project.to_string())); params.push(("zone", self._zone.to_string())); params.push(("instance", self._instance.to_string())); @@ -18672,7 +23240,7 @@ impl<'a, C, A> InstanceSetMetadataCall<'a, C, A> where C: BorrowMut InstanceSetMetadataCall<'a, C, A> where C: BorrowMut InstanceSetMetadataCall<'a, C, A> where C: BorrowMut InstanceSetMetadataCall<'a, C, A> where C: BorrowMut InstanceSetMetadataCall<'a, C, A> { - self._request = new_value; - self - } /// Project ID for this request. /// /// Sets the *project* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceSetMetadataCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> InstanceStopCall<'a, C, A> { self._project = new_value.to_string(); self } @@ -18816,17 +23360,17 @@ impl<'a, C, A> InstanceSetMetadataCall<'a, C, A> where C: BorrowMut InstanceSetMetadataCall<'a, C, A> { + pub fn zone(mut self, new_value: &str) -> InstanceStopCall<'a, C, A> { self._zone = new_value.to_string(); self } - /// Name of the instance scoping this request. + /// Name of the instance resource to stop. /// /// Sets the *instance* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn instance(mut self, new_value: &str) -> InstanceSetMetadataCall<'a, C, A> { + pub fn instance(mut self, new_value: &str) -> InstanceStopCall<'a, C, A> { self._instance = new_value.to_string(); self } @@ -18836,7 +23380,7 @@ impl<'a, C, A> InstanceSetMetadataCall<'a, C, A> where C: BorrowMut InstanceSetMetadataCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceStopCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -18857,7 +23401,7 @@ impl<'a, C, A> InstanceSetMetadataCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> InstanceSetMetadataCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> InstanceStopCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -18874,7 +23418,7 @@ impl<'a, C, A> InstanceSetMetadataCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> InstanceSetMetadataCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> InstanceStopCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -19154,9 +23698,9 @@ impl<'a, C, A> InstanceDetachDiskCall<'a, C, A> where C: BorrowMut InstanceDetachDiskCall<'a, C, A> where C: BorrowMut InstanceDetachDiskCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Compute::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 = AttachedDisk::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.instances().stop("project", "zone", "instance") +/// let result = hub.instances().attach_disk(req, "project", "zone", "instance") /// .doit(); /// # } /// ``` -pub struct InstanceStopCall<'a, C, A> +pub struct InstanceAttachDiskCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, + _request: AttachedDisk, _project: String, _zone: String, _instance: String, @@ -19196,9 +23747,9 @@ pub struct InstanceStopCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for InstanceStopCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for InstanceAttachDiskCall<'a, C, A> {} -impl<'a, C, A> InstanceStopCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> InstanceAttachDiskCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -19210,9 +23761,9 @@ impl<'a, C, A> InstanceStopCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.instances.stop", + dlg.begin(MethodInfo { id: "compute.instances.attachDisk", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("project", self._project.to_string())); params.push(("zone", self._zone.to_string())); params.push(("instance", self._instance.to_string())); @@ -19228,7 +23779,7 @@ impl<'a, C, A> InstanceStopCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/stop".to_string(); + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/attachDisk".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -19260,6 +23811,17 @@ impl<'a, C, A> InstanceStopCall<'a, C, A> where C: BorrowMut, A: url.push_str(&url::form_urlencoded::serialize(params)); } + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { @@ -19277,11 +23839,15 @@ impl<'a, C, A> InstanceStopCall<'a, C, A> where C: BorrowMut, A: }; let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); dlg.pre_request(); req.send() @@ -19332,13 +23898,22 @@ impl<'a, C, A> InstanceStopCall<'a, C, A> where C: BorrowMut, A: } + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AttachedDisk) -> InstanceAttachDiskCall<'a, C, A> { + self._request = new_value; + self + } /// Project ID for this request. /// /// Sets the *project* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceStopCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> InstanceAttachDiskCall<'a, C, A> { self._project = new_value.to_string(); self } @@ -19348,17 +23923,17 @@ impl<'a, C, A> InstanceStopCall<'a, C, A> where C: BorrowMut, A: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceStopCall<'a, C, A> { + pub fn zone(mut self, new_value: &str) -> InstanceAttachDiskCall<'a, C, A> { self._zone = new_value.to_string(); self } - /// Name of the instance resource to stop. + /// Instance name. /// /// Sets the *instance* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn instance(mut self, new_value: &str) -> InstanceStopCall<'a, C, A> { + pub fn instance(mut self, new_value: &str) -> InstanceAttachDiskCall<'a, C, A> { self._instance = new_value.to_string(); self } @@ -19368,7 +23943,7 @@ impl<'a, C, A> InstanceStopCall<'a, C, A> where C: BorrowMut, A: /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceStopCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceAttachDiskCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -19389,7 +23964,7 @@ impl<'a, C, A> InstanceStopCall<'a, C, A> where C: BorrowMut, A: /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceStopCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> InstanceAttachDiskCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -19406,7 +23981,7 @@ impl<'a, C, A> InstanceStopCall<'a, C, A> where C: BorrowMut, A: /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceStopCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> InstanceAttachDiskCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -19693,6 +24268,297 @@ impl<'a, C, A> InstanceInsertCall<'a, C, A> where C: BorrowMut, A } +/// Retrieves the list of instance resources contained within the specified zone. +/// +/// A builder for the *list* method supported by a *instance* resource. +/// It is not used directly, but through a `InstanceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.instances().list("project", "zone") +/// .page_token("eirmod") +/// .max_results(93) +/// .filter("voluptua.") +/// .doit(); +/// # } +/// ``` +pub struct InstanceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceListCall<'a, C, A> {} + +impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instances.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "zone", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> InstanceListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Performs a hard reset on the instance. /// /// A builder for the *reset* method supported by a *instance* resource. @@ -20237,581 +25103,6 @@ impl<'a, C, A> InstanceDeleteAccessConfigCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::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 = AttachedDisk::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.instances().attach_disk(req, "project", "zone", "instance") -/// .doit(); -/// # } -/// ``` -pub struct InstanceAttachDiskCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: AttachedDisk, - _project: String, - _zone: String, - _instance: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceAttachDiskCall<'a, C, A> {} - -impl<'a, C, A> InstanceAttachDiskCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instances.attachDisk", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instance", self._instance.to_string())); - for &field in ["alt", "project", "zone", "instance"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/attachDisk".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instance}", "instance")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instance", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: AttachedDisk) -> InstanceAttachDiskCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceAttachDiskCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone for this request. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceAttachDiskCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// Instance name. - /// - /// Sets the *instance* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance(mut self, new_value: &str) -> InstanceAttachDiskCall<'a, C, A> { - self._instance = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceAttachDiskCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceAttachDiskCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceAttachDiskCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Retrieves the list of instance resources contained within the specified zone. -/// -/// A builder for the *list* method supported by a *instance* resource. -/// It is not used directly, but through a `InstanceMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::new(), auth); -/// // 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.instances().list("project", "zone") -/// .page_token("consetetur") -/// .max_results(79) -/// .filter("sed") -/// .doit(); -/// # } -/// ``` -pub struct InstanceListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _zone: String, - _page_token: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceListCall<'a, C, A> {} - -impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instances.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "zone", "pageToken", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone for this request. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum count of results to be returned. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> InstanceListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// Filter expression for filtering listed resources. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// A builder for the *aggregatedList* method supported by a *instance* resource. /// It is not used directly, but through a `InstanceMethods` instance. /// @@ -20837,9 +25128,9 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instances().aggregated_list("project") -/// .page_token("takimata") -/// .max_results(58) -/// .filter("nonumy") +/// .page_token("dolore") +/// .max_results(75) +/// .filter("dolor") /// .doit(); /// # } /// ``` @@ -21009,7 +25300,7 @@ impl<'a, C, A> InstanceAggregatedListCall<'a, C, A> where C: BorrowMut InstanceAggregatedListCall<'a, C, A> { @@ -21023,7 +25314,14 @@ impl<'a, C, A> InstanceAggregatedListCall<'a, C, A> where C: BorrowMut InstanceAggregatedListCall<'a, C, A> { @@ -22162,9 +26460,9 @@ impl<'a, C, A> BackendServiceUpdateCall<'a, C, A> where C: BorrowMut BackendServiceListCall<'a, C, A> where C: BorrowMut BackendServiceListCall<'a, C, A> { @@ -22348,7 +26646,14 @@ impl<'a, C, A> BackendServiceListCall<'a, C, A> where C: BorrowMut BackendServiceListCall<'a, C, A> { @@ -22953,6 +27258,1329 @@ impl<'a, C, A> BackendServiceInsertCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.images().list("project") +/// .page_token("consetetur") +/// .max_results(22) +/// .filter("accusam") +/// .doit(); +/// # } +/// ``` +pub struct ImageListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ImageListCall<'a, C, A> {} + +impl<'a, C, A> ImageListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ImageList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.images.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/images".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ImageListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ImageListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ImageListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ImageListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ImageListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ImageListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ImageListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Sets the deprecation status of an image. +/// +/// If an empty request body is given, clears the deprecation status instead. +/// +/// A builder for the *deprecate* method supported by a *image* resource. +/// It is not used directly, but through a `ImageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::DeprecationStatus; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = DeprecationStatus::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.images().deprecate(req, "project", "image") +/// .doit(); +/// # } +/// ``` +pub struct ImageDeprecateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: DeprecationStatus, + _project: String, + _image: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ImageDeprecateCall<'a, C, A> {} + +impl<'a, C, A> ImageDeprecateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.images.deprecate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("image", self._image.to_string())); + for &field in ["alt", "project", "image"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/images/{image}/deprecate".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{image}", "image")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["image", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: DeprecationStatus) -> ImageDeprecateCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ImageDeprecateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Image name. + /// + /// Sets the *image* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn image(mut self, new_value: &str) -> ImageDeprecateCall<'a, C, A> { + self._image = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ImageDeprecateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ImageDeprecateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ImageDeprecateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Creates an image resource in the specified project using the data included in the request. +/// +/// A builder for the *insert* method supported by a *image* resource. +/// It is not used directly, but through a `ImageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::Image; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = Image::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.images().insert(req, "project") +/// .doit(); +/// # } +/// ``` +pub struct ImageInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: Image, + _project: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ImageInsertCall<'a, C, A> {} + +impl<'a, C, A> ImageInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.images.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + for &field in ["alt", "project"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/images".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Image) -> ImageInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ImageInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ImageInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ImageInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ImageInsertCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns the specified image resource. +/// +/// A builder for the *get* method supported by a *image* resource. +/// It is not used directly, but through a `ImageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.images().get("project", "image") +/// .doit(); +/// # } +/// ``` +pub struct ImageGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _image: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ImageGetCall<'a, C, A> {} + +impl<'a, C, A> ImageGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Image)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.images.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("image", self._image.to_string())); + for &field in ["alt", "project", "image"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/images/{image}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{image}", "image")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["image", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ImageGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the image resource to return. + /// + /// Sets the *image* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn image(mut self, new_value: &str) -> ImageGetCall<'a, C, A> { + self._image = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ImageGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ImageGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ImageGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Deletes the specified image resource. +/// +/// A builder for the *delete* method supported by a *image* resource. +/// It is not used directly, but through a `ImageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.images().delete("project", "image") +/// .doit(); +/// # } +/// ``` +pub struct ImageDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _image: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ImageDeleteCall<'a, C, A> {} + +impl<'a, C, A> ImageDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.images.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("image", self._image.to_string())); + for &field in ["alt", "project", "image"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/images/{image}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{image}", "image")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["image", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ImageDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the image resource to delete. + /// + /// Sets the *image* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn image(mut self, new_value: &str) -> ImageDeleteCall<'a, C, A> { + self._image = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ImageDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ImageDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ImageDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Returns the specified license resource. /// /// A builder for the *get* method supported by a *license* resource. @@ -23495,9 +29123,9 @@ impl<'a, C, A> NetworkInsertCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.networks().list("project") -/// .page_token("ut") -/// .max_results(71) -/// .filter("et") +/// .page_token("dolore") +/// .max_results(96) +/// .filter("consetetur") /// .doit(); /// # } /// ``` @@ -23667,7 +29295,7 @@ impl<'a, C, A> NetworkListCall<'a, C, A> where C: BorrowMut, A: o self._project = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> NetworkListCall<'a, C, A> { @@ -23681,7 +29309,14 @@ impl<'a, C, A> NetworkListCall<'a, C, A> where C: BorrowMut, A: o self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> NetworkListCall<'a, C, A> { @@ -24236,7 +29871,7 @@ impl<'a, C, A> NetworkGetCall<'a, C, A> where C: BorrowMut, A: oa } -/// Retrieves the list of operation resources contained within the specified project. +/// Retrieves the list of Operation resources contained within the specified project. /// /// A builder for the *list* method supported by a *globalOperation* resource. /// It is not used directly, but through a `GlobalOperationMethods` instance. @@ -24263,9 +29898,9 @@ impl<'a, C, A> NetworkGetCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.global_operations().list("project") -/// .page_token("takimata") -/// .max_results(80) -/// .filter("nonumy") +/// .page_token("sadipscing") +/// .max_results(28) +/// .filter("magna") /// .doit(); /// # } /// ``` @@ -24435,7 +30070,7 @@ impl<'a, C, A> GlobalOperationListCall<'a, C, A> where C: BorrowMut GlobalOperationListCall<'a, C, A> { @@ -24449,7 +30084,14 @@ impl<'a, C, A> GlobalOperationListCall<'a, C, A> where C: BorrowMut GlobalOperationListCall<'a, C, A> { @@ -24508,7 +30150,286 @@ impl<'a, C, A> GlobalOperationListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.global_operations().aggregated_list("project") +/// .page_token("rebum.") +/// .max_results(30) +/// .filter("clita") +/// .doit(); +/// # } +/// ``` +pub struct GlobalOperationAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GlobalOperationAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> GlobalOperationAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OperationAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.globalOperations.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/aggregated/operations".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> GlobalOperationAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> GlobalOperationAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GlobalOperationAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GlobalOperationAggregatedListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves the specified Operations resource. /// /// A builder for the *get* method supported by a *globalOperation* resource. /// It is not used directly, but through a `GlobalOperationMethods` instance. @@ -24694,7 +30615,7 @@ impl<'a, C, A> GlobalOperationGetCall<'a, C, A> where C: BorrowMut GlobalOperationGetCall<'a, C, A> where C: BorrowMut GlobalOperationDeleteCall<'a, C, A> where C: BorrowMut GlobalOperationDeleteCall<'a, C, A> where C: BorrowMut GlobalOperationDeleteCall<'a, C, A> where C: BorrowMut + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _autoscaler: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AutoscalerDeleteCall<'a, C, A> {} + +impl<'a, C, A> AutoscalerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.autoscalers.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("autoscaler", self._autoscaler.to_string())); + for &field in ["alt", "project", "zone", "autoscaler"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{autoscaler}", "autoscaler")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["autoscaler", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the project scoping this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> AutoscalerDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the zone scoping this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> AutoscalerDeleteCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the persistent autoscaler resource to delete. + /// + /// Sets the *autoscaler* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn autoscaler(mut self, new_value: &str) -> AutoscalerDeleteCall<'a, C, A> { + self._autoscaler = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AutoscalerDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AutoscalerDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AutoscalerDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns the specified autoscaler resource. +/// +/// A builder for the *get* method supported by a *autoscaler* resource. +/// It is not used directly, but through a `AutoscalerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.autoscalers().get("project", "zone", "autoscaler") +/// .doit(); +/// # } +/// ``` +pub struct AutoscalerGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _autoscaler: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AutoscalerGetCall<'a, C, A> {} + +impl<'a, C, A> AutoscalerGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Autoscaler)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.autoscalers.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("autoscaler", self._autoscaler.to_string())); + for &field in ["alt", "project", "zone", "autoscaler"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{autoscaler}", "autoscaler")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["autoscaler", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the project scoping this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> AutoscalerGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the zone scoping this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> AutoscalerGetCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the persistent autoscaler resource to return. + /// + /// Sets the *autoscaler* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn autoscaler(mut self, new_value: &str) -> AutoscalerGetCall<'a, C, A> { + self._autoscaler = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AutoscalerGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AutoscalerGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AutoscalerGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves the list of autoscaler resources contained within the specified zone. +/// +/// A builder for the *list* method supported by a *autoscaler* resource. +/// It is not used directly, but through a `AutoscalerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.autoscalers().list("project", "zone") +/// .page_token("dolore") +/// .max_results(18) /// .filter("elitr") /// .doit(); /// # } /// ``` -pub struct GlobalOperationAggregatedListCall<'a, C, A> +pub struct AutoscalerListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AutoscalerListCall<'a, C, A> {} + +impl<'a, C, A> AutoscalerListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AutoscalerList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.autoscalers.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "zone", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/autoscalers".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the project scoping this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> AutoscalerListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the zone scoping this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> AutoscalerListCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AutoscalerListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> AutoscalerListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> AutoscalerListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AutoscalerListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AutoscalerListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AutoscalerListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates an autoscaler resource in the specified project using the data included in the request. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *autoscaler* resource. +/// It is not used directly, but through a `AutoscalerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::Autoscaler; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = Autoscaler::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.autoscalers().patch(req, "project", "zone", "autoscaler") +/// .doit(); +/// # } +/// ``` +pub struct AutoscalerPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: Autoscaler, + _project: String, + _zone: String, + _autoscaler: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AutoscalerPatchCall<'a, C, A> {} + +impl<'a, C, A> AutoscalerPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.autoscalers.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("autoscaler", self._autoscaler.to_string())); + for &field in ["alt", "project", "zone", "autoscaler"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/autoscalers".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Autoscaler) -> AutoscalerPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the project scoping this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> AutoscalerPatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the zone scoping this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> AutoscalerPatchCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the autoscaler resource to update. + /// + /// Sets the *autoscaler* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn autoscaler(mut self, new_value: &str) -> AutoscalerPatchCall<'a, C, A> { + self._autoscaler = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AutoscalerPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AutoscalerPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AutoscalerPatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Creates an autoscaler resource in the specified project using the data included in the request. +/// +/// A builder for the *insert* method supported by a *autoscaler* resource. +/// It is not used directly, but through a `AutoscalerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::Autoscaler; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = Autoscaler::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.autoscalers().insert(req, "project", "zone") +/// .doit(); +/// # } +/// ``` +pub struct AutoscalerInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: Autoscaler, + _project: String, + _zone: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AutoscalerInsertCall<'a, C, A> {} + +impl<'a, C, A> AutoscalerInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.autoscalers.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + for &field in ["alt", "project", "zone"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/autoscalers".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Autoscaler) -> AutoscalerInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the project scoping this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> AutoscalerInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the zone scoping this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> AutoscalerInsertCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AutoscalerInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AutoscalerInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AutoscalerInsertCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves the list of autoscalers grouped by scope. +/// +/// A builder for the *aggregatedList* method supported by a *autoscaler* resource. +/// It is not used directly, but through a `AutoscalerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.autoscalers().aggregated_list("project") +/// .page_token("nonumy") +/// .max_results(8) +/// .filter("diam") +/// .doit(); +/// # } +/// ``` +pub struct AutoscalerAggregatedListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, @@ -25039,13 +32341,13 @@ pub struct GlobalOperationAggregatedListCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for GlobalOperationAggregatedListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for AutoscalerAggregatedListCall<'a, C, A> {} -impl<'a, C, A> GlobalOperationAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> AutoscalerAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OperationAggregatedList)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, AutoscalerAggregatedList)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -25053,7 +32355,7 @@ impl<'a, C, A> GlobalOperationAggregatedListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.globalOperations.aggregatedList", + dlg.begin(MethodInfo { id: "compute.autoscalers.aggregatedList", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("project", self._project.to_string())); @@ -25078,7 +32380,7 @@ impl<'a, C, A> GlobalOperationAggregatedListCall<'a, C, A> where C: BorrowMut GlobalOperationAggregatedListCall<'a, C, A> where C: BorrowMut GlobalOperationAggregatedListCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> AutoscalerAggregatedListCall<'a, C, A> { self._project = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> AutoscalerAggregatedListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } /// Maximum count of results to be returned. /// /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> GlobalOperationAggregatedListCall<'a, C, A> { + pub fn max_results(mut self, new_value: u32) -> AutoscalerAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { + pub fn filter(mut self, new_value: &str) -> AutoscalerAggregatedListCall<'a, C, A> { self._filter = Some(new_value.to_string()); self } @@ -25219,7 +32528,7 @@ impl<'a, C, A> GlobalOperationAggregatedListCall<'a, C, A> where C: BorrowMut GlobalOperationAggregatedListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AutoscalerAggregatedListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -25240,7 +32549,7 @@ impl<'a, C, A> GlobalOperationAggregatedListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> GlobalOperationAggregatedListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> AutoscalerAggregatedListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -25257,7 +32566,2874 @@ impl<'a, C, A> GlobalOperationAggregatedListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> GlobalOperationAggregatedListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> AutoscalerAggregatedListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates an autoscaler resource in the specified project using the data included in the request. +/// +/// A builder for the *update* method supported by a *autoscaler* resource. +/// It is not used directly, but through a `AutoscalerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::Autoscaler; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = Autoscaler::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.autoscalers().update(req, "project", "zone") +/// .autoscaler("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct AutoscalerUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: Autoscaler, + _project: String, + _zone: String, + _autoscaler: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AutoscalerUpdateCall<'a, C, A> {} + +impl<'a, C, A> AutoscalerUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.autoscalers.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + if let Some(value) = self._autoscaler { + params.push(("autoscaler", value.to_string())); + } + for &field in ["alt", "project", "zone", "autoscaler"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/autoscalers".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Autoscaler) -> AutoscalerUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the project scoping this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> AutoscalerUpdateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the zone scoping this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> AutoscalerUpdateCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the autoscaler resource to update. + /// + /// Sets the *autoscaler* query property to the given value. + pub fn autoscaler(mut self, new_value: &str) -> AutoscalerUpdateCall<'a, C, A> { + self._autoscaler = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AutoscalerUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AutoscalerUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AutoscalerUpdateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Deletes the specified instance group. +/// +/// A builder for the *delete* method supported by a *instanceGroup* resource. +/// It is not used directly, but through a `InstanceGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.instance_groups().delete("project", "zone", "instanceGroup") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _instance_group: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupDeleteCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroups.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroup", self._instance_group.to_string())); + for &field in ["alt", "project", "zone", "instanceGroup"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroup}", "instanceGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroup", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupDeleteCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group to delete. + /// + /// Sets the *instance group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group(mut self, new_value: &str) -> InstanceGroupDeleteCall<'a, C, A> { + self._instance_group = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists instances in an instance group. The parameters for this method specify whether the list filters instances by state and named ports information. +/// +/// A builder for the *listInstances* method supported by a *instanceGroup* resource. +/// It is not used directly, but through a `InstanceGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupsListInstancesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = InstanceGroupsListInstancesRequest::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.instance_groups().list_instances(req, "project", "zone", "instanceGroup") +/// .page_token("erat") +/// .max_results(49) +/// .filter("dolores") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupListInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupsListInstancesRequest, + _project: String, + _zone: String, + _instance_group: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupListInstanceCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupListInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupsListInstances)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroups.listInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroup", self._instance_group.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "zone", "instanceGroup", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroup}", "instanceGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroup", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupsListInstancesRequest) -> InstanceGroupListInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupListInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupListInstanceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group from which you want to generate a list of included instances. + /// + /// Sets the *instance group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group(mut self, new_value: &str) -> InstanceGroupListInstanceCall<'a, C, A> { + self._instance_group = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> InstanceGroupListInstanceCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> InstanceGroupListInstanceCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> InstanceGroupListInstanceCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupListInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupListInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupListInstanceCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Creates an instance group in the specified project using the parameters that are included in the request. +/// +/// A builder for the *insert* method supported by a *instanceGroup* resource. +/// It is not used directly, but through a `InstanceGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = InstanceGroup::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.instance_groups().insert(req, "project", "zone") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroup, + _project: String, + _zone: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupInsertCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroups.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + for &field in ["alt", "project", "zone"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroup) -> InstanceGroupInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupInsertCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupInsertCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns the specified instance group resource. +/// +/// A builder for the *get* method supported by a *instanceGroup* resource. +/// It is not used directly, but through a `InstanceGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.instance_groups().get("project", "zone", "instanceGroup") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _instance_group: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupGetCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroups.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroup", self._instance_group.to_string())); + for &field in ["alt", "project", "zone", "instanceGroup"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroup}", "instanceGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroup", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupGetCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group. + /// + /// Sets the *instance group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group(mut self, new_value: &str) -> InstanceGroupGetCall<'a, C, A> { + self._instance_group = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Removes a list of instances from an instance group. +/// +/// A builder for the *removeInstances* method supported by a *instanceGroup* resource. +/// It is not used directly, but through a `InstanceGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupsRemoveInstancesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = InstanceGroupsRemoveInstancesRequest::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.instance_groups().remove_instances(req, "project", "zone", "instanceGroup") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupRemoveInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupsRemoveInstancesRequest, + _project: String, + _zone: String, + _instance_group: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupRemoveInstanceCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupRemoveInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroups.removeInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroup", self._instance_group.to_string())); + for &field in ["alt", "project", "zone", "instanceGroup"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroup}", "instanceGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroup", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupsRemoveInstancesRequest) -> InstanceGroupRemoveInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupRemoveInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupRemoveInstanceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group where the specified instances will be removed. + /// + /// Sets the *instance group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group(mut self, new_value: &str) -> InstanceGroupRemoveInstanceCall<'a, C, A> { + self._instance_group = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupRemoveInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupRemoveInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupRemoveInstanceCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Adds a list of instances to an instance group. All of the instances in the instance group must be in the same network. +/// +/// A builder for the *addInstances* method supported by a *instanceGroup* resource. +/// It is not used directly, but through a `InstanceGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupsAddInstancesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = InstanceGroupsAddInstancesRequest::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.instance_groups().add_instances(req, "project", "zone", "instanceGroup") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupAddInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupsAddInstancesRequest, + _project: String, + _zone: String, + _instance_group: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupAddInstanceCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupAddInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroups.addInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroup", self._instance_group.to_string())); + for &field in ["alt", "project", "zone", "instanceGroup"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroup}", "instanceGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroup", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupsAddInstancesRequest) -> InstanceGroupAddInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupAddInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupAddInstanceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group where you are adding instances. + /// + /// Sets the *instance group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group(mut self, new_value: &str) -> InstanceGroupAddInstanceCall<'a, C, A> { + self._instance_group = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupAddInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupAddInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupAddInstanceCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Sets the named ports in an instance group. +/// +/// A builder for the *setNamedPorts* method supported by a *instanceGroup* resource. +/// It is not used directly, but through a `InstanceGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupsSetNamedPortsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = InstanceGroupsSetNamedPortsRequest::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.instance_groups().set_named_ports(req, "project", "zone", "instanceGroup") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupSetNamedPortCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupsSetNamedPortsRequest, + _project: String, + _zone: String, + _instance_group: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupSetNamedPortCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupSetNamedPortCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroups.setNamedPorts", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroup", self._instance_group.to_string())); + for &field in ["alt", "project", "zone", "instanceGroup"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroup}", "instanceGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroup", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupsSetNamedPortsRequest) -> InstanceGroupSetNamedPortCall<'a, C, A> { + self._request = new_value; + self + } + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupSetNamedPortCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupSetNamedPortCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group where the named ports are updated. + /// + /// Sets the *instance group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group(mut self, new_value: &str) -> InstanceGroupSetNamedPortCall<'a, C, A> { + self._instance_group = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupSetNamedPortCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupSetNamedPortCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupSetNamedPortCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves the list of instance groups, and sorts them by zone. +/// +/// A builder for the *aggregatedList* method supported by a *instanceGroup* resource. +/// It is not used directly, but through a `InstanceGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.instance_groups().aggregated_list("project") +/// .page_token("eirmod") +/// .max_results(43) +/// .filter("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroups.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/aggregated/instanceGroups".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> InstanceGroupAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> InstanceGroupAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> InstanceGroupAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupAggregatedListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves the list of instance groups that are located in the specified project and zone. +/// +/// A builder for the *list* method supported by a *instanceGroup* resource. +/// It is not used directly, but through a `InstanceGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.instance_groups().list("project", "zone") +/// .page_token("eirmod") +/// .max_results(56) +/// .filter("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupListCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroups.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "zone", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The URL of the zone where the instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupListCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> InstanceGroupListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> InstanceGroupListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> InstanceGroupListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceGroupListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupListCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -25292,9 +35468,9 @@ impl<'a, C, A> GlobalOperationAggregatedListCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa self._project = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> RegionListCall<'a, C, A> { @@ -25478,7 +35654,14 @@ impl<'a, C, A> RegionListCall<'a, C, A> where C: BorrowMut, A: oa self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> RegionListCall<'a, C, A> { @@ -25785,278 +35968,6 @@ impl<'a, C, A> RegionGetCall<'a, C, A> where C: BorrowMut, A: oau } -/// Retrieves the list of forwarding rules grouped by scope. -/// -/// A builder for the *aggregatedList* method supported by a *forwardingRule* resource. -/// It is not used directly, but through a `ForwardingRuleMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::new(), auth); -/// // 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.forwarding_rules().aggregated_list("project") -/// .page_token("accusam") -/// .max_results(33) -/// .filter("consetetur") -/// .doit(); -/// # } -/// ``` -pub struct ForwardingRuleAggregatedListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ForwardingRuleAggregatedListCall<'a, C, A> {} - -impl<'a, C, A> ForwardingRuleAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ForwardingRuleAggregatedList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.forwardingRules.aggregatedList", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/aggregated/forwardingRules".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Name of the project scoping this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum count of results to be returned. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> ForwardingRuleAggregatedListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// Filter expression for filtering listed resources. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ForwardingRuleAggregatedListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ForwardingRuleAggregatedListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ForwardingRuleAggregatedListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Creates a ForwardingRule resource in the specified project and region using the data included in the request. /// /// A builder for the *insert* method supported by a *forwardingRule* resource. @@ -26627,6 +36538,576 @@ impl<'a, C, A> ForwardingRuleSetTargetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.forwarding_rules().list("project", "region") +/// .page_token("et") +/// .max_results(37) +/// .filter("sed") +/// .doit(); +/// # } +/// ``` +pub struct ForwardingRuleListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ForwardingRuleListCall<'a, C, A> {} + +impl<'a, C, A> ForwardingRuleListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ForwardingRuleList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.forwardingRules.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/forwardingRules".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the project scoping this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ForwardingRuleListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ForwardingRuleListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ForwardingRuleListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ForwardingRuleListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves the list of forwarding rules grouped by scope. +/// +/// A builder for the *aggregatedList* method supported by a *forwardingRule* resource. +/// It is not used directly, but through a `ForwardingRuleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.forwarding_rules().aggregated_list("project") +/// .page_token("clita") +/// .max_results(27) +/// .filter("amet") +/// .doit(); +/// # } +/// ``` +pub struct ForwardingRuleAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ForwardingRuleAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> ForwardingRuleAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ForwardingRuleAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.forwardingRules.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/aggregated/forwardingRules".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the project scoping this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ForwardingRuleAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ForwardingRuleAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ForwardingRuleAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ForwardingRuleAggregatedListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Returns the specified ForwardingRule resource. /// /// A builder for the *get* method supported by a *forwardingRule* resource. @@ -26887,290 +37368,6 @@ impl<'a, C, A> ForwardingRuleGetCall<'a, C, A> where C: BorrowMut } -/// Retrieves the list of ForwardingRule resources available to the specified project and region. -/// -/// A builder for the *list* method supported by a *forwardingRule* resource. -/// It is not used directly, but through a `ForwardingRuleMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::new(), auth); -/// // 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.forwarding_rules().list("project", "region") -/// .page_token("Lorem") -/// .max_results(5) -/// .filter("consetetur") -/// .doit(); -/// # } -/// ``` -pub struct ForwardingRuleListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _page_token: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ForwardingRuleListCall<'a, C, A> {} - -impl<'a, C, A> ForwardingRuleListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ForwardingRuleList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.forwardingRules.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "pageToken", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/forwardingRules".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Name of the project scoping this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum count of results to be returned. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> ForwardingRuleListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// Filter expression for filtering listed resources. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ForwardingRuleListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ForwardingRuleListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ForwardingRuleListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Deletes the specified ForwardingRule resource. /// /// A builder for the *delete* method supported by a *forwardingRule* resource. @@ -27431,290 +37628,6 @@ impl<'a, C, A> ForwardingRuleDeleteCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::new(), auth); -/// // 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.target_pools().list("project", "region") -/// .page_token("accusam") -/// .max_results(69) -/// .filter("Lorem") -/// .doit(); -/// # } -/// ``` -pub struct TargetPoolListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _page_token: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TargetPoolListCall<'a, C, A> {} - -impl<'a, C, A> TargetPoolListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TargetPoolList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.targetPools.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "pageToken", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/targetPools".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Name of the project scoping this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum count of results to be returned. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> TargetPoolListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// Filter expression for filtering listed resources. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> TargetPoolListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> TargetPoolListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TargetPoolListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Adds health check URL to targetPool. /// /// A builder for the *addHealthCheck* method supported by a *targetPool* resource. @@ -28897,7 +38810,7 @@ impl<'a, C, A> TargetPoolGetHealthCall<'a, C, A> where C: BorrowMut TargetPoolSetBackupCall<'a, C, A> where C: BorrowMut TargetPoolAggregatedListCall<'a, C, A> where C: BorrowMut TargetPoolAggregatedListCall<'a, C, A> { @@ -29380,7 +39293,14 @@ impl<'a, C, A> TargetPoolAggregatedListCall<'a, C, A> where C: BorrowMut TargetPoolAggregatedListCall<'a, C, A> { @@ -30539,6 +40459,297 @@ impl<'a, C, A> TargetPoolDeleteCall<'a, C, A> where C: BorrowMut, } +/// Retrieves the list of TargetPool resources available to the specified project and region. +/// +/// A builder for the *list* method supported by a *targetPool* resource. +/// It is not used directly, but through a `TargetPoolMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.target_pools().list("project", "region") +/// .page_token("amet") +/// .max_results(59) +/// .filter("sit") +/// .doit(); +/// # } +/// ``` +pub struct TargetPoolListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetPoolListCall<'a, C, A> {} + +impl<'a, C, A> TargetPoolListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TargetPoolList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.targetPools.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/targetPools".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the project scoping this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> TargetPoolListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> TargetPoolListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TargetPoolListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TargetPoolListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Retrieves the list of TargetInstance resources available to the specified project and zone. /// /// A builder for the *list* method supported by a *targetInstance* resource. @@ -30566,9 +40777,9 @@ impl<'a, C, A> TargetPoolDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.target_instances().list("project", "zone") -/// .page_token("takimata") -/// .max_results(32) -/// .filter("consetetur") +/// .page_token("et") +/// .max_results(94) +/// .filter("takimata") /// .doit(); /// # } /// ``` @@ -30750,7 +40961,7 @@ impl<'a, C, A> TargetInstanceListCall<'a, C, A> where C: BorrowMut TargetInstanceListCall<'a, C, A> { @@ -30764,7 +40975,14 @@ impl<'a, C, A> TargetInstanceListCall<'a, C, A> where C: BorrowMut TargetInstanceListCall<'a, C, A> { @@ -31129,9 +41347,9 @@ impl<'a, C, A> TargetInstanceInsertCall<'a, C, A> where C: BorrowMut TargetInstanceAggregatedListCall<'a, C, A> where C: BorrowMut TargetInstanceAggregatedListCall<'a, C, A> { @@ -31315,7 +41533,14 @@ impl<'a, C, A> TargetInstanceAggregatedListCall<'a, C, A> where C: BorrowMut TargetInstanceAggregatedListCall<'a, C, A> { @@ -31374,266 +41599,6 @@ impl<'a, C, A> TargetInstanceAggregatedListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::new(), auth); -/// // 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.target_instances().get("project", "zone", "targetInstance") -/// .doit(); -/// # } -/// ``` -pub struct TargetInstanceGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _zone: String, - _target_instance: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TargetInstanceGetCall<'a, C, A> {} - -impl<'a, C, A> TargetInstanceGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TargetInstance)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.targetInstances.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("targetInstance", self._target_instance.to_string())); - for &field in ["alt", "project", "zone", "targetInstance"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/targetInstances/{targetInstance}".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{targetInstance}", "targetInstance")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["targetInstance", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Name of the project scoping this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> TargetInstanceGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the zone scoping this request. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> TargetInstanceGetCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// Name of the TargetInstance resource to return. - /// - /// Sets the *target instance* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn target_instance(mut self, new_value: &str) -> TargetInstanceGetCall<'a, C, A> { - self._target_instance = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> TargetInstanceGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> TargetInstanceGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TargetInstanceGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Deletes the specified TargetInstance resource. /// /// A builder for the *delete* method supported by a *targetInstance* resource. @@ -31894,10 +41859,10 @@ impl<'a, C, A> TargetInstanceDeleteCall<'a, C, A> where C: BorrowMut TargetInstanceDeleteCall<'a, C, A> where C: BorrowMut +pub struct TargetInstanceGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, _project: String, - _forwarding_rule: String, + _zone: String, + _target_instance: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for GlobalForwardingRuleGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for TargetInstanceGetCall<'a, C, A> {} -impl<'a, C, A> GlobalForwardingRuleGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> TargetInstanceGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ForwardingRule)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, TargetInstance)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -31949,12 +41915,13 @@ impl<'a, C, A> GlobalForwardingRuleGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.globalForwardingRules.get", + dlg.begin(MethodInfo { id: "compute.targetInstances.get", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("project", self._project.to_string())); - params.push(("forwardingRule", self._forwarding_rule.to_string())); - for &field in ["alt", "project", "forwardingRule"].iter() { + params.push(("zone", self._zone.to_string())); + params.push(("targetInstance", self._target_instance.to_string())); + for &field in ["alt", "project", "zone", "targetInstance"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -31966,12 +41933,12 @@ impl<'a, C, A> GlobalForwardingRuleGetCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -31982,8 +41949,8 @@ impl<'a, C, A> GlobalForwardingRuleGetCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(2); - for param_name in ["forwardingRule", "project"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["targetInstance", "zone", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -32076,18 +42043,28 @@ impl<'a, C, A> GlobalForwardingRuleGetCall<'a, C, A> where C: BorrowMut GlobalForwardingRuleGetCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> TargetInstanceGetCall<'a, C, A> { self._project = new_value.to_string(); self } - /// Name of the ForwardingRule resource to return. + /// Name of the zone scoping this request. /// - /// Sets the *forwarding rule* path property to the given value. + /// Sets the *zone* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn forwarding_rule(mut self, new_value: &str) -> GlobalForwardingRuleGetCall<'a, C, A> { - self._forwarding_rule = new_value.to_string(); + pub fn zone(mut self, new_value: &str) -> TargetInstanceGetCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the TargetInstance resource to return. + /// + /// Sets the *target instance* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn target_instance(mut self, new_value: &str) -> TargetInstanceGetCall<'a, C, A> { + self._target_instance = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -32096,7 +42073,7 @@ impl<'a, C, A> GlobalForwardingRuleGetCall<'a, C, A> where C: BorrowMut GlobalForwardingRuleGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> TargetInstanceGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -32117,7 +42094,7 @@ impl<'a, C, A> GlobalForwardingRuleGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> GlobalForwardingRuleGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> TargetInstanceGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -32134,7 +42111,7 @@ impl<'a, C, A> GlobalForwardingRuleGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> GlobalForwardingRuleGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> TargetInstanceGetCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -32963,9 +42940,9 @@ impl<'a, C, A> GlobalForwardingRuleInsertCall<'a, C, A> where C: BorrowMut GlobalForwardingRuleListCall<'a, C, A> where C: BorrowMut GlobalForwardingRuleListCall<'a, C, A> { @@ -33149,7 +43126,14 @@ impl<'a, C, A> GlobalForwardingRuleListCall<'a, C, A> where C: BorrowMut GlobalForwardingRuleListCall<'a, C, A> { @@ -33208,10 +43192,10 @@ impl<'a, C, A> GlobalForwardingRuleListCall<'a, C, A> where C: BorrowMut GlobalForwardingRuleListCall<'a, C, A> where C: BorrowMut +pub struct GlobalForwardingRuleGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, _project: String, - _page_token: Option, - _max_results: Option, - _filter: Option, + _forwarding_rule: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ImageListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for GlobalForwardingRuleGetCall<'a, C, A> {} -impl<'a, C, A> ImageListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> GlobalForwardingRuleGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ImageList)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ForwardingRule)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -33268,20 +43247,12 @@ impl<'a, C, A> ImageListCall<'a, C, A> where C: BorrowMut, A: oau Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.images.list", + dlg.begin(MethodInfo { id: "compute.globalForwardingRules.get", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "maxResults", "filter"].iter() { + params.push(("forwardingRule", self._forwarding_rule.to_string())); + for &field in ["alt", "project", "forwardingRule"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -33293,12 +43264,12 @@ impl<'a, C, A> ImageListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/images".to_string(); + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/forwardingRules/{forwardingRule}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{project}", "project")].iter() { + for &(find_this, param_name) in [("{project}", "project"), ("{forwardingRule}", "forwardingRule")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -33309,8 +43280,8 @@ impl<'a, C, A> ImageListCall<'a, C, A> where C: BorrowMut, A: oau url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["forwardingRule", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -33397,35 +43368,24 @@ impl<'a, C, A> ImageListCall<'a, C, A> where C: BorrowMut, A: oau } - /// Project ID for this request. + /// Name of the project scoping this request. /// /// Sets the *project* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ImageListCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> GlobalForwardingRuleGetCall<'a, C, A> { self._project = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Name of the ForwardingRule resource to return. /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ImageListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum count of results to be returned. + /// Sets the *forwarding rule* path property to the given value. /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> ImageListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// Filter expression for filtering listed resources. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ImageListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn forwarding_rule(mut self, new_value: &str) -> GlobalForwardingRuleGetCall<'a, C, A> { + self._forwarding_rule = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -33434,7 +43394,7 @@ impl<'a, C, A> ImageListCall<'a, C, A> where C: BorrowMut, A: oau /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ImageListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> GlobalForwardingRuleGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -33455,7 +43415,7 @@ impl<'a, C, A> ImageListCall<'a, C, A> where C: BorrowMut, A: oau /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ImageListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> GlobalForwardingRuleGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -33472,1051 +43432,7 @@ impl<'a, C, A> ImageListCall<'a, C, A> where C: BorrowMut, A: oau /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ImageListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Deletes the specified image resource. -/// -/// A builder for the *delete* method supported by a *image* resource. -/// It is not used directly, but through a `ImageMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::new(), auth); -/// // 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.images().delete("project", "image") -/// .doit(); -/// # } -/// ``` -pub struct ImageDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _image: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ImageDeleteCall<'a, C, A> {} - -impl<'a, C, A> ImageDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.images.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - params.push(("image", self._image.to_string())); - for &field in ["alt", "project", "image"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/images/{image}".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{image}", "image")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["image", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ImageDeleteCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the image resource to delete. - /// - /// Sets the *image* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn image(mut self, new_value: &str) -> ImageDeleteCall<'a, C, A> { - self._image = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ImageDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ImageDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ImageDeleteCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Sets the deprecation status of an image. -/// -/// If an empty request body is given, clears the deprecation status instead. -/// -/// A builder for the *deprecate* method supported by a *image* resource. -/// It is not used directly, but through a `ImageMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::DeprecationStatus; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Compute::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 = DeprecationStatus::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.images().deprecate(req, "project", "image") -/// .doit(); -/// # } -/// ``` -pub struct ImageDeprecateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: DeprecationStatus, - _project: String, - _image: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ImageDeprecateCall<'a, C, A> {} - -impl<'a, C, A> ImageDeprecateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.images.deprecate", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - params.push(("image", self._image.to_string())); - for &field in ["alt", "project", "image"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/images/{image}/deprecate".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{image}", "image")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["image", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: DeprecationStatus) -> ImageDeprecateCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ImageDeprecateCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Image name. - /// - /// Sets the *image* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn image(mut self, new_value: &str) -> ImageDeprecateCall<'a, C, A> { - self._image = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ImageDeprecateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ImageDeprecateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ImageDeprecateCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Creates an image resource in the specified project using the data included in the request. -/// -/// A builder for the *insert* method supported by a *image* resource. -/// It is not used directly, but through a `ImageMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::Image; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Compute::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 = Image::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.images().insert(req, "project") -/// .doit(); -/// # } -/// ``` -pub struct ImageInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: Image, - _project: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ImageInsertCall<'a, C, A> {} - -impl<'a, C, A> ImageInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.images.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - for &field in ["alt", "project"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/images".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Image) -> ImageInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ImageInsertCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ImageInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ImageInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ImageInsertCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Returns the specified image resource. -/// -/// A builder for the *get* method supported by a *image* resource. -/// It is not used directly, but through a `ImageMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::new(), auth); -/// // 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.images().get("project", "image") -/// .doit(); -/// # } -/// ``` -pub struct ImageGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _image: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ImageGetCall<'a, C, A> {} - -impl<'a, C, A> ImageGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Image)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.images.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - params.push(("image", self._image.to_string())); - for &field in ["alt", "project", "image"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/images/{image}".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{image}", "image")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["image", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ImageGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the image resource to return. - /// - /// Sets the *image* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn image(mut self, new_value: &str) -> ImageGetCall<'a, C, A> { - self._image = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ImageGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ImageGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ImageGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> GlobalForwardingRuleGetCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -34551,9 +43467,9 @@ impl<'a, C, A> ImageGetCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.machine_types().aggregated_list("project") -/// .page_token("et") -/// .max_results(20) -/// .filter("dolores") +/// .page_token("sadipscing") +/// .max_results(71) +/// .filter("vero") /// .doit(); /// # } /// ``` @@ -34723,7 +43639,7 @@ impl<'a, C, A> MachineTypeAggregatedListCall<'a, C, A> where C: BorrowMut MachineTypeAggregatedListCall<'a, C, A> { @@ -34737,7 +43653,14 @@ impl<'a, C, A> MachineTypeAggregatedListCall<'a, C, A> where C: BorrowMut MachineTypeAggregatedListCall<'a, C, A> { @@ -35083,9 +44006,9 @@ impl<'a, C, A> MachineTypeGetCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.machine_types().list("project", "zone") -/// .page_token("clita") -/// .max_results(27) -/// .filter("amet") +/// .page_token("labore") +/// .max_results(50) +/// .filter("aliquyam") /// .doit(); /// # } /// ``` @@ -35267,7 +44190,7 @@ impl<'a, C, A> MachineTypeListCall<'a, C, A> where C: BorrowMut, self._zone = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> MachineTypeListCall<'a, C, A> { @@ -35281,7 +44204,14 @@ impl<'a, C, A> MachineTypeListCall<'a, C, A> where C: BorrowMut, self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> MachineTypeListCall<'a, C, A> { @@ -35367,9 +44297,9 @@ impl<'a, C, A> MachineTypeListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.target_vpn_gateways().aggregated_list("project") -/// .page_token("takimata") -/// .max_results(48) -/// .filter("labore") +/// .page_token("et") +/// .max_results(55) +/// .filter("et") /// .doit(); /// # } /// ``` @@ -35539,7 +44469,7 @@ impl<'a, C, A> TargetVpnGatewayAggregatedListCall<'a, C, A> where C: BorrowMut TargetVpnGatewayAggregatedListCall<'a, C, A> { @@ -35553,7 +44483,14 @@ impl<'a, C, A> TargetVpnGatewayAggregatedListCall<'a, C, A> where C: BorrowMut TargetVpnGatewayAggregatedListCall<'a, C, A> { @@ -35899,8 +44836,8 @@ impl<'a, C, A> TargetVpnGatewayGetCall<'a, C, A> where C: BorrowMut TargetVpnGatewayListCall<'a, C, A> where C: BorrowMut TargetVpnGatewayListCall<'a, C, A> { @@ -36097,7 +45034,14 @@ impl<'a, C, A> TargetVpnGatewayListCall<'a, C, A> where C: BorrowMut TargetVpnGatewayListCall<'a, C, A> { @@ -36695,6 +45639,836 @@ impl<'a, C, A> TargetVpnGatewayDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.disk_types().get("project", "zone", "diskType") +/// .doit(); +/// # } +/// ``` +pub struct DiskTypeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _disk_type: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DiskTypeGetCall<'a, C, A> {} + +impl<'a, C, A> DiskTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DiskType)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.diskTypes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("diskType", self._disk_type.to_string())); + for &field in ["alt", "project", "zone", "diskType"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes/{diskType}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{diskType}", "diskType")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["diskType", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> DiskTypeGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> DiskTypeGetCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the disk type resource to return. + /// + /// Sets the *disk type* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn disk_type(mut self, new_value: &str) -> DiskTypeGetCall<'a, C, A> { + self._disk_type = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DiskTypeGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DiskTypeGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DiskTypeGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves the list of disk type resources grouped by scope. +/// +/// A builder for the *aggregatedList* method supported by a *diskType* resource. +/// It is not used directly, but through a `DiskTypeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.disk_types().aggregated_list("project") +/// .page_token("eirmod") +/// .max_results(57) +/// .filter("clita") +/// .doit(); +/// # } +/// ``` +pub struct DiskTypeAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DiskTypeAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> DiskTypeAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DiskTypeAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.diskTypes.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/aggregated/diskTypes".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> DiskTypeAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> DiskTypeAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> DiskTypeAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> DiskTypeAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DiskTypeAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DiskTypeAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DiskTypeAggregatedListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves the list of disk type resources available to the specified project. +/// +/// A builder for the *list* method supported by a *diskType* resource. +/// It is not used directly, but through a `DiskTypeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.disk_types().list("project", "zone") +/// .page_token("ea") +/// .max_results(30) +/// .filter("sed") +/// .doit(); +/// # } +/// ``` +pub struct DiskTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DiskTypeListCall<'a, C, A> {} + +impl<'a, C, A> DiskTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DiskTypeList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.diskTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "zone", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> DiskTypeListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> DiskTypeListCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> DiskTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> DiskTypeListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> DiskTypeListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DiskTypeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DiskTypeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DiskTypeListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Moves a persistent disk from one zone to another. /// /// A builder for the *moveDisk* method supported by a *project* resource. @@ -38553,9 +48327,9 @@ impl<'a, C, A> HttpHealthCheckPatchCall<'a, C, A> where C: BorrowMut HttpHealthCheckListCall<'a, C, A> where C: BorrowMut HttpHealthCheckListCall<'a, C, A> { @@ -38739,7 +48513,14 @@ impl<'a, C, A> HttpHealthCheckListCall<'a, C, A> where C: BorrowMut HttpHealthCheckListCall<'a, C, A> { @@ -40115,9 +49896,9 @@ impl<'a, C, A> InstanceTemplateGetCall<'a, C, A> where C: BorrowMut InstanceTemplateListCall<'a, C, A> where C: BorrowMut InstanceTemplateListCall<'a, C, A> { @@ -40301,7 +50082,14 @@ impl<'a, C, A> InstanceTemplateListCall<'a, C, A> where C: BorrowMut InstanceTemplateListCall<'a, C, A> { @@ -40902,9 +50690,9 @@ impl<'a, C, A> TargetHttpProxyDeleteCall<'a, C, A> where C: BorrowMut TargetHttpProxyListCall<'a, C, A> where C: BorrowMut TargetHttpProxyListCall<'a, C, A> { @@ -41088,7 +50876,14 @@ impl<'a, C, A> TargetHttpProxyListCall<'a, C, A> where C: BorrowMut TargetHttpProxyListCall<'a, C, A> { @@ -41147,254 +50942,6 @@ impl<'a, C, A> TargetHttpProxyListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::new(), auth); -/// // 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.target_http_proxies().get("project", "targetHttpProxy") -/// .doit(); -/// # } -/// ``` -pub struct TargetHttpProxyGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _target_http_proxy: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TargetHttpProxyGetCall<'a, C, A> {} - -impl<'a, C, A> TargetHttpProxyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TargetHttpProxy)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.targetHttpProxies.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - params.push(("targetHttpProxy", self._target_http_proxy.to_string())); - for &field in ["alt", "project", "targetHttpProxy"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/targetHttpProxies/{targetHttpProxy}".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{targetHttpProxy}", "targetHttpProxy")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["targetHttpProxy", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Name of the project scoping this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> TargetHttpProxyGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the TargetHttpProxy resource to return. - /// - /// Sets the *target http proxy* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn target_http_proxy(mut self, new_value: &str) -> TargetHttpProxyGetCall<'a, C, A> { - self._target_http_proxy = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> TargetHttpProxyGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> TargetHttpProxyGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TargetHttpProxyGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Changes the URL map for TargetHttpProxy. /// /// A builder for the *setUrlMap* method supported by a *targetHttpProxy* resource. @@ -41674,6 +51221,254 @@ impl<'a, C, A> TargetHttpProxySetUrlMapCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.target_http_proxies().get("project", "targetHttpProxy") +/// .doit(); +/// # } +/// ``` +pub struct TargetHttpProxyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _target_http_proxy: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetHttpProxyGetCall<'a, C, A> {} + +impl<'a, C, A> TargetHttpProxyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TargetHttpProxy)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.targetHttpProxies.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("targetHttpProxy", self._target_http_proxy.to_string())); + for &field in ["alt", "project", "targetHttpProxy"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/targetHttpProxies/{targetHttpProxy}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{targetHttpProxy}", "targetHttpProxy")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["targetHttpProxy", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the project scoping this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> TargetHttpProxyGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the TargetHttpProxy resource to return. + /// + /// Sets the *target http proxy* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn target_http_proxy(mut self, new_value: &str) -> TargetHttpProxyGetCall<'a, C, A> { + self._target_http_proxy = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> TargetHttpProxyGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TargetHttpProxyGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TargetHttpProxyGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Creates a TargetHttpProxy resource in the specified project using the data included in the request. /// /// A builder for the *insert* method supported by a *targetHttpProxy* resource. @@ -41941,7 +51736,7 @@ impl<'a, C, A> TargetHttpProxyInsertCall<'a, C, A> where C: BorrowMut ZoneOperationDeleteCall<'a, C, A> where C: BorrowMut ZoneOperationDeleteCall<'a, C, A> where C: BorrowMut ZoneOperationDeleteCall<'a, C, A> where C: BorrowMut ZoneOperationListCall<'a, C, A> where C: BorrowMut self._zone = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ZoneOperationListCall<'a, C, A> { @@ -42415,7 +52210,14 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ZoneOperationListCall<'a, C, A> { @@ -42474,7 +52276,7 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut } -/// Retrieves the specified zone-specific operation resource. +/// Retrieves the specified zone-specific Operations resource. /// /// A builder for the *get* method supported by a *zoneOperation* resource. /// It is not used directly, but through a `ZoneOperationMethods` instance. @@ -42672,7 +52474,7 @@ impl<'a, C, A> ZoneOperationGetCall<'a, C, A> where C: BorrowMut, self._zone = new_value.to_string(); self } - /// Name of the operation resource to return. + /// Name of the Operations resource to return. /// /// Sets the *operation* path property to the given value. /// @@ -43276,9 +53078,9 @@ impl<'a, C, A> RouteInsertCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.routes().list("project") -/// .page_token("vero") -/// .max_results(57) -/// .filter("sed") +/// .page_token("elitr") +/// .max_results(89) +/// .filter("sit") /// .doit(); /// # } /// ``` @@ -43448,7 +53250,7 @@ impl<'a, C, A> RouteListCall<'a, C, A> where C: BorrowMut, A: oau self._project = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> RouteListCall<'a, C, A> { @@ -43462,7 +53264,14 @@ impl<'a, C, A> RouteListCall<'a, C, A> where C: BorrowMut, A: oau self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> RouteListCall<'a, C, A> { @@ -44296,273 +54105,6 @@ impl<'a, C, A> FirewallGetCall<'a, C, A> where C: BorrowMut, A: o } -/// Creates a firewall resource in the specified project using the data included in the request. -/// -/// A builder for the *insert* method supported by a *firewall* resource. -/// It is not used directly, but through a `FirewallMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::Firewall; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Compute::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 = Firewall::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.firewalls().insert(req, "project") -/// .doit(); -/// # } -/// ``` -pub struct FirewallInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: Firewall, - _project: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for FirewallInsertCall<'a, C, A> {} - -impl<'a, C, A> FirewallInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.firewalls.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - for &field in ["alt", "project"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/firewalls".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Firewall) -> FirewallInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> FirewallInsertCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> FirewallInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> FirewallInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> FirewallInsertCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Updates the specified firewall resource with the data included in the request. /// /// A builder for the *update* method supported by a *firewall* resource. @@ -44842,6 +54384,552 @@ impl<'a, C, A> FirewallUpdateCall<'a, C, A> where C: BorrowMut, A } +/// Creates a firewall resource in the specified project using the data included in the request. +/// +/// A builder for the *insert* method supported by a *firewall* resource. +/// It is not used directly, but through a `FirewallMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::Firewall; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::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 = Firewall::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.firewalls().insert(req, "project") +/// .doit(); +/// # } +/// ``` +pub struct FirewallInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: Firewall, + _project: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FirewallInsertCall<'a, C, A> {} + +impl<'a, C, A> FirewallInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.firewalls.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + for &field in ["alt", "project"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/firewalls".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Firewall) -> FirewallInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> FirewallInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> FirewallInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> FirewallInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FirewallInsertCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves the list of firewall resources available to the specified project. +/// +/// A builder for the *list* method supported by a *firewall* resource. +/// It is not used directly, but through a `FirewallMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.firewalls().list("project") +/// .page_token("ea") +/// .max_results(85) +/// .filter("et") +/// .doit(); +/// # } +/// ``` +pub struct FirewallListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FirewallListCall<'a, C, A> {} + +impl<'a, C, A> FirewallListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, FirewallList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.firewalls.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/firewalls".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> FirewallListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> FirewallListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> FirewallListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> FirewallListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> FirewallListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> FirewallListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FirewallListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Deletes the specified firewall resource. /// /// A builder for the *delete* method supported by a *firewall* resource. @@ -45090,278 +55178,6 @@ impl<'a, C, A> FirewallDeleteCall<'a, C, A> where C: BorrowMut, A } -/// Retrieves the list of firewall resources available to the specified project. -/// -/// A builder for the *list* method supported by a *firewall* resource. -/// It is not used directly, but through a `FirewallMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::new(), auth); -/// // 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.firewalls().list("project") -/// .page_token("et") -/// .max_results(30) -/// .filter("kasd") -/// .doit(); -/// # } -/// ``` -pub struct FirewallListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for FirewallListCall<'a, C, A> {} - -impl<'a, C, A> FirewallListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, FirewallList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.firewalls.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/global/firewalls".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> FirewallListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> FirewallListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum count of results to be returned. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> FirewallListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// Filter expression for filtering listed resources. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> FirewallListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> FirewallListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> FirewallListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> FirewallListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Deletes the specified VpnTunnel resource. /// /// A builder for the *delete* method supported by a *vpnTunnel* resource. @@ -45622,550 +55438,6 @@ impl<'a, C, A> VpnTunnelDeleteCall<'a, C, A> where C: BorrowMut, } -/// Retrieves the list of VpnTunnel resources contained in the specified project and region. -/// -/// A builder for the *list* method supported by a *vpnTunnel* resource. -/// It is not used directly, but through a `VpnTunnelMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::new(), auth); -/// // 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.vpn_tunnels().list("project", "region") -/// .page_token("voluptua.") -/// .max_results(15) -/// .filter("erat") -/// .doit(); -/// # } -/// ``` -pub struct VpnTunnelListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _page_token: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for VpnTunnelListCall<'a, C, A> {} - -impl<'a, C, A> VpnTunnelListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, VpnTunnelList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.vpnTunnels.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "pageToken", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/vpnTunnels".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> VpnTunnelListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> VpnTunnelListCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> VpnTunnelListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum count of results to be returned. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> VpnTunnelListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// Filter expression for filtering listed resources. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> VpnTunnelListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> VpnTunnelListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> VpnTunnelListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> VpnTunnelListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Returns the specified VpnTunnel resource. -/// -/// A builder for the *get* method supported by a *vpnTunnel* resource. -/// It is not used directly, but through a `VpnTunnelMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::new(), auth); -/// // 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.vpn_tunnels().get("project", "region", "vpnTunnel") -/// .doit(); -/// # } -/// ``` -pub struct VpnTunnelGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _vpn_tunnel: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for VpnTunnelGetCall<'a, C, A> {} - -impl<'a, C, A> VpnTunnelGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, VpnTunnel)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.vpnTunnels.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("vpnTunnel", self._vpn_tunnel.to_string())); - for &field in ["alt", "project", "region", "vpnTunnel"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{vpnTunnel}", "vpnTunnel")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["vpnTunnel", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> VpnTunnelGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> VpnTunnelGetCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the VpnTunnel resource to return. - /// - /// Sets the *vpn tunnel* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn vpn_tunnel(mut self, new_value: &str) -> VpnTunnelGetCall<'a, C, A> { - self._vpn_tunnel = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> VpnTunnelGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> VpnTunnelGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> VpnTunnelGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Creates a VpnTunnel resource in the specified project and region using the data included in the request. /// /// A builder for the *insert* method supported by a *vpnTunnel* resource. @@ -46445,6 +55717,557 @@ impl<'a, C, A> VpnTunnelInsertCall<'a, C, A> where C: BorrowMut, } +/// Returns the specified VpnTunnel resource. +/// +/// A builder for the *get* method supported by a *vpnTunnel* resource. +/// It is not used directly, but through a `VpnTunnelMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.vpn_tunnels().get("project", "region", "vpnTunnel") +/// .doit(); +/// # } +/// ``` +pub struct VpnTunnelGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _vpn_tunnel: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VpnTunnelGetCall<'a, C, A> {} + +impl<'a, C, A> VpnTunnelGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, VpnTunnel)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.vpnTunnels.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("vpnTunnel", self._vpn_tunnel.to_string())); + for &field in ["alt", "project", "region", "vpnTunnel"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{vpnTunnel}", "vpnTunnel")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["vpnTunnel", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> VpnTunnelGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> VpnTunnelGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the VpnTunnel resource to return. + /// + /// Sets the *vpn tunnel* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn vpn_tunnel(mut self, new_value: &str) -> VpnTunnelGetCall<'a, C, A> { + self._vpn_tunnel = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VpnTunnelGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> VpnTunnelGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VpnTunnelGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves the list of VpnTunnel resources contained in the specified project and region. +/// +/// A builder for the *list* method supported by a *vpnTunnel* resource. +/// It is not used directly, but through a `VpnTunnelMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::new(), auth); +/// // 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.vpn_tunnels().list("project", "region") +/// .page_token("no") +/// .max_results(19) +/// .filter("accusam") +/// .doit(); +/// # } +/// ``` +pub struct VpnTunnelListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VpnTunnelListCall<'a, C, A> {} + +impl<'a, C, A> VpnTunnelListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, VpnTunnelList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.vpnTunnels.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/vpnTunnels".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> VpnTunnelListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> VpnTunnelListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> VpnTunnelListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum count of results to be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> VpnTunnelListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> VpnTunnelListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VpnTunnelListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> VpnTunnelListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VpnTunnelListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Retrieves the list of VPN tunnels grouped by scope. /// /// A builder for the *aggregatedList* method supported by a *vpnTunnel* resource. @@ -46472,9 +56295,9 @@ impl<'a, C, A> VpnTunnelInsertCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.vpn_tunnels().aggregated_list("project") -/// .page_token("Lorem") -/// .max_results(62) -/// .filter("elitr") +/// .page_token("sea") +/// .max_results(100) +/// .filter("clita") /// .doit(); /// # } /// ``` @@ -46644,7 +56467,7 @@ impl<'a, C, A> VpnTunnelAggregatedListCall<'a, C, A> where C: BorrowMut VpnTunnelAggregatedListCall<'a, C, A> { @@ -46658,7 +56481,14 @@ impl<'a, C, A> VpnTunnelAggregatedListCall<'a, C, A> where C: BorrowMut VpnTunnelAggregatedListCall<'a, C, A> { @@ -46717,7 +56547,7 @@ impl<'a, C, A> VpnTunnelAggregatedListCall<'a, C, A> where C: BorrowMut VpnTunnelAggregatedListCall<'a, C, A> where C: BorrowMut RegionOperationListCall<'a, C, A> where C: BorrowMut RegionOperationListCall<'a, C, A> { @@ -46942,7 +56772,14 @@ impl<'a, C, A> RegionOperationListCall<'a, C, A> where C: BorrowMut RegionOperationListCall<'a, C, A> { @@ -47001,7 +56838,7 @@ impl<'a, C, A> RegionOperationListCall<'a, C, A> where C: BorrowMut RegionOperationDeleteCall<'a, C, A> where C: BorrowMut RegionOperationDeleteCall<'a, C, A> where C: BorrowMut RegionOperationGetCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with container (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/container1_beta1-cli" @@ -17,9 +17,10 @@ keywords = ["container", "google", "cli"] name = "container1-beta1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/container1_beta1-cli/README.md b/gen/container1_beta1-cli/README.md index 052802d562..937c71ead6 100644 --- a/gen/container1_beta1-cli/README.md +++ b/gen/container1_beta1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *container* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/container1-beta1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/container1-beta1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/container1-beta1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/container1-beta1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/container1_beta1-cli). # Usage -This documentation was generated from the *container* API at revision *20150617*. The CLI is at version *0.3.1*. +This documentation was generated from the *container* API at revision *20150713*. The CLI is at version *0.3.2*. ```bash container1-beta1 [options] diff --git a/gen/container1_beta1-cli/mkdocs.yml b/gen/container1_beta1-cli/mkdocs.yml index 9d2672e2e9..a774fe9e89 100644 --- a/gen/container1_beta1-cli/mkdocs.yml +++ b/gen/container1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: container v0.3.1+20150617 +site_name: container v0.3.2+20150713 site_url: http://byron.github.io/google-apis-rs/google-container1_beta1-cli site_description: Write integrating applications with bcore diff --git a/gen/container1_beta1-cli/src/cmn.rs b/gen/container1_beta1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/container1_beta1-cli/src/cmn.rs +++ b/gen/container1_beta1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/container1_beta1-cli/src/main.rs b/gen/container1_beta1-cli/src/main.rs index 3274c11882..3a49f8fb7d 100644 --- a/gen/container1_beta1-cli/src/main.rs +++ b/gen/container1_beta1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -887,7 +888,7 @@ fn main() { let mut app = App::new("container1-beta1") .author("Sebastian Thiel ") - .version("0.3.1+20150617") + .version("0.3.2+20150713") .about("The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_container1_beta1_cli") .arg(Arg::with_name("url") @@ -969,7 +970,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/container1_beta1/Cargo.toml b/gen/container1_beta1/Cargo.toml index 8c7822056c..b325924672 100644 --- a/gen/container1_beta1/Cargo.toml +++ b/gen/container1_beta1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-container1_beta1" -version = "0.1.8+20150617" +version = "0.1.9+20150713" authors = ["Sebastian Thiel "] description = "A complete library to interact with container (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/container1_beta1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/container1_beta1/README.md b/gen/container1_beta1/README.md index d8157ca895..3462b906be 100644 --- a/gen/container1_beta1/README.md +++ b/gen/container1_beta1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-container1_beta1` library allows access to all features of the *Google container* service. -This documentation was generated from *container* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *container:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *container* crate version *0.1.9+20150713*, where *20150713* is the exact revision of the *container:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *container* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/container-engine/docs/v1beta1/). diff --git a/gen/container1_beta1/src/cmn.rs b/gen/container1_beta1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/container1_beta1/src/cmn.rs +++ b/gen/container1_beta1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/container1_beta1/src/lib.rs b/gen/container1_beta1/src/lib.rs index 484d4c02ea..f63399fc27 100644 --- a/gen/container1_beta1/src/lib.rs +++ b/gen/container1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *container* crate version *0.1.8+20150617*, where *20150617* is the exact revision of the *container:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *container* crate version *0.1.9+20150713*, where *20150713* is the exact revision of the *container:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *container* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/container-engine/docs/v1beta1/). diff --git a/gen/container1_beta1/src/lib.rs.in b/gen/container1_beta1/src/lib.rs.in index 5cb689d083..e0d4981e12 100644 --- a/gen/container1_beta1/src/lib.rs.in +++ b/gen/container1_beta1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -125,7 +126,7 @@ impl<'a, C, A> Container Container { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -134,7 +135,7 @@ impl<'a, C, A> Container } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/content2-cli/Cargo.toml b/gen/content2-cli/Cargo.toml index 35e6f7eeef..214a96732a 100644 --- a/gen/content2-cli/Cargo.toml +++ b/gen/content2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-content2-cli" -version = "0.3.1+20150528" +version = "0.3.2+20150710" authors = ["Sebastian Thiel "] description = "A complete library to interact with Shopping Content (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/content2-cli" @@ -17,9 +17,10 @@ keywords = ["content", "google", "cli"] name = "content2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/content2-cli/README.md b/gen/content2-cli/README.md index 01db0cdaa0..036f83df98 100644 --- a/gen/content2-cli/README.md +++ b/gen/content2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *Shopping Content* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/content2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/content2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/content2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/content2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/content2-cli). # Usage -This documentation was generated from the *Shopping Content* API at revision *20150528*. The CLI is at version *0.3.1*. +This documentation was generated from the *Shopping Content* API at revision *20150710*. The CLI is at version *0.3.2*. ```bash content2 [options] diff --git a/gen/content2-cli/mkdocs.yml b/gen/content2-cli/mkdocs.yml index aaf65f4512..92c408b1ad 100644 --- a/gen/content2-cli/mkdocs.yml +++ b/gen/content2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Shopping Content v0.3.1+20150528 +site_name: Shopping Content v0.3.2+20150710 site_url: http://byron.github.io/google-apis-rs/google-content2-cli site_description: Write integrating applications with bcore diff --git a/gen/content2-cli/src/cmn.rs b/gen/content2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/content2-cli/src/cmn.rs +++ b/gen/content2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/content2-cli/src/main.rs b/gen/content2-cli/src/main.rs index 3e60f331e6..8727c0eed1 100644 --- a/gen/content2-cli/src/main.rs +++ b/gen/content2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -134,6 +135,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "dry-run" => { + call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -147,6 +151,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["dry-run"].iter().map(|v|*v)); v } )); } } @@ -186,6 +191,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "dry-run" => { + call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -199,6 +207,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["dry-run"].iter().map(|v|*v)); v } )); } } @@ -321,6 +330,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "dry-run" => { + call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -334,6 +346,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["dry-run"].iter().map(|v|*v)); v } )); } } @@ -471,6 +484,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "dry-run" => { + call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -484,6 +500,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["dry-run"].iter().map(|v|*v)); v } )); } } @@ -562,6 +579,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "dry-run" => { + call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -575,6 +595,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["dry-run"].iter().map(|v|*v)); v } )); } } @@ -1599,6 +1620,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "dry-run" => { + call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1612,6 +1636,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["dry-run"].iter().map(|v|*v)); v } )); } } @@ -1651,6 +1676,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "dry-run" => { + call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1664,6 +1692,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["dry-run"].iter().map(|v|*v)); v } )); } } @@ -1798,6 +1827,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "dry-run" => { + call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1811,6 +1843,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["dry-run"].iter().map(|v|*v)); v } )); } } @@ -1960,6 +1993,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "dry-run" => { + call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1973,6 +2009,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["dry-run"].iter().map(|v|*v)); v } )); } } @@ -2063,6 +2100,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "dry-run" => { + call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -2076,6 +2116,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["dry-run"].iter().map(|v|*v)); v } )); } } @@ -2342,6 +2383,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "dry-run" => { + call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -2355,6 +2399,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["dry-run"].iter().map(|v|*v)); v } )); } } @@ -2433,6 +2478,9 @@ impl<'n, 'a> Engine<'n, 'a> { for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "dry-run" => { + call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -2446,6 +2494,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["dry-run"].iter().map(|v|*v)); v } )); } } @@ -4472,7 +4521,7 @@ fn main() { let mut app = App::new("content2") .author("Sebastian Thiel ") - .version("0.3.1+20150528") + .version("0.3.2+20150710") .about("Manage product items, inventory, and Merchant Center accounts for Google Shopping.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_content2_cli") .arg(Arg::with_name("url") @@ -4554,7 +4603,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/content2/Cargo.toml b/gen/content2/Cargo.toml index 37113ef25d..f95041bd72 100644 --- a/gen/content2/Cargo.toml +++ b/gen/content2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-content2" -version = "0.1.8+20150528" +version = "0.1.9+20150710" authors = ["Sebastian Thiel "] description = "A complete library to interact with Shopping Content (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/content2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/content2/README.md b/gen/content2/README.md index 8ed1b41ce4..c6eb38eae4 100644 --- a/gen/content2/README.md +++ b/gen/content2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-content2` library allows access to all features of the *Google Shopping Content* service. -This documentation was generated from *Shopping Content* crate version *0.1.8+20150528*, where *20150528* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Shopping Content* crate version *0.1.9+20150710*, where *20150710* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *Shopping Content* *v2* API can be found at the [official documentation site](https://developers.google.com/shopping-content/v2/). @@ -122,6 +122,7 @@ let mut req = Account::default(); // execute the final call using `doit()`. // Values shown here are possibly random and not representative ! let result = hub.accounts().patch(req, "merchantId", "accountId") + .dry_run(false) .doit(); match result { diff --git a/gen/content2/src/cmn.rs b/gen/content2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/content2/src/cmn.rs +++ b/gen/content2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/content2/src/lib.rs b/gen/content2/src/lib.rs index 1e8aef0b87..c89043f9a3 100644 --- a/gen/content2/src/lib.rs +++ b/gen/content2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Shopping Content* crate version *0.1.8+20150528*, where *20150528* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Shopping Content* crate version *0.1.9+20150710*, where *20150710* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *Shopping Content* *v2* API can be found at the //! [official documentation site](https://developers.google.com/shopping-content/v2/). @@ -123,6 +123,7 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.accounts().patch(req, "merchantId", "accountId") +//! .dry_run(false) //! .doit(); //! //! match result { diff --git a/gen/content2/src/lib.rs.in b/gen/content2/src/lib.rs.in index d67a43c482..05f632f57a 100644 --- a/gen/content2/src/lib.rs.in +++ b/gen/content2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -96,6 +97,7 @@ impl Default for Scope { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounts().patch(req, "merchantId", "accountId") +/// .dry_run(true) /// .doit(); /// /// match result { @@ -131,7 +133,7 @@ impl<'a, C, A> ShoppingContent ShoppingContent { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -164,7 +166,7 @@ impl<'a, C, A> ShoppingContent } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -2699,6 +2701,7 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { DatafeedCustombatchCall { hub: self.hub, _request: request, + _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2739,6 +2742,7 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { _request: request, _merchant_id: merchant_id.to_string(), _datafeed_id: datafeed_id.to_string(), + _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2758,6 +2762,7 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { hub: self.hub, _merchant_id: merchant_id.to_string(), _datafeed_id: datafeed_id.to_string(), + _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2777,6 +2782,7 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { hub: self.hub, _request: request, _merchant_id: merchant_id.to_string(), + _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2817,6 +2823,7 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { _request: request, _merchant_id: merchant_id.to_string(), _datafeed_id: datafeed_id.to_string(), + _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2987,6 +2994,7 @@ impl<'a, C, A> AccountMethods<'a, C, A> { _request: request, _merchant_id: merchant_id.to_string(), _account_id: account_id.to_string(), + _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3027,6 +3035,7 @@ impl<'a, C, A> AccountMethods<'a, C, A> { _request: request, _merchant_id: merchant_id.to_string(), _account_id: account_id.to_string(), + _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3065,6 +3074,7 @@ impl<'a, C, A> AccountMethods<'a, C, A> { hub: self.hub, _merchant_id: merchant_id.to_string(), _account_id: account_id.to_string(), + _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3082,6 +3092,7 @@ impl<'a, C, A> AccountMethods<'a, C, A> { AccountCustombatchCall { hub: self.hub, _request: request, + _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3101,6 +3112,7 @@ impl<'a, C, A> AccountMethods<'a, C, A> { hub: self.hub, _request: request, _merchant_id: merchant_id.to_string(), + _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3165,6 +3177,7 @@ impl<'a, C, A> InventoryMethods<'a, C, A> { _merchant_id: merchant_id.to_string(), _store_code: store_code.to_string(), _product_id: product_id.to_string(), + _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3182,6 +3195,7 @@ impl<'a, C, A> InventoryMethods<'a, C, A> { InventoryCustombatchCall { hub: self.hub, _request: request, + _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3847,7 +3861,7 @@ impl<'a, C, A> AccounttaxCustombatchCall<'a, C, A> where C: BorrowMut AccounttaxPatchCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounttax().list("merchantId") -/// .page_token("justo") -/// .max_results(100) +/// .page_token("erat") +/// .max_results(66) /// .doit(); /// # } /// ``` @@ -5177,8 +5191,8 @@ impl<'a, C, A> DatafeedstatuseGetCall<'a, C, A> where C: BorrowMut DatafeedstatuseCustombatchCall<'a, C, A> where C: BorrowMut hub: &'a ShoppingContent, _request: DatafeedsCustomBatchRequest, + _dry_run: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -5702,8 +5718,11 @@ impl<'a, C, A> DatafeedCustombatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((3 + self._additional_params.len())); - for &field in ["alt"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["alt", "dryRun"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5822,6 +5841,13 @@ impl<'a, C, A> DatafeedCustombatchCall<'a, C, A> where C: BorrowMut DatafeedCustombatchCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -6153,6 +6179,7 @@ impl<'a, C, A> DatafeedGetCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.datafeeds().patch(req, "merchantId", "datafeedId") +/// .dry_run(true) /// .doit(); /// # } /// ``` @@ -6163,6 +6190,7 @@ pub struct DatafeedPatchCall<'a, C, A> _request: Datafeed, _merchant_id: String, _datafeed_id: String, + _dry_run: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -6184,10 +6212,13 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "content.datafeeds.patch", http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); params.push(("datafeedId", self._datafeed_id.to_string())); - for &field in ["alt", "merchantId", "datafeedId"].iter() { + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["alt", "merchantId", "datafeedId", "dryRun"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6345,6 +6376,13 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: self._datafeed_id = new_value.to_string(); self } + /// Flag to run the request in dry-run mode. + /// + /// Sets the *dry run* query property to the given value. + pub fn dry_run(mut self, new_value: bool) -> DatafeedPatchCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -6424,6 +6462,7 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.datafeeds().delete("merchantId", "datafeedId") +/// .dry_run(true) /// .doit(); /// # } /// ``` @@ -6433,6 +6472,7 @@ pub struct DatafeedDeleteCall<'a, C, A> hub: &'a ShoppingContent, _merchant_id: String, _datafeed_id: String, + _dry_run: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -6454,10 +6494,13 @@ impl<'a, C, A> DatafeedDeleteCall<'a, C, A> where C: BorrowMut, A }; dlg.begin(MethodInfo { id: "content.datafeeds.delete", http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); params.push(("datafeedId", self._datafeed_id.to_string())); - for &field in ["merchantId", "datafeedId"].iter() { + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["merchantId", "datafeedId", "dryRun"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6580,6 +6623,13 @@ impl<'a, C, A> DatafeedDeleteCall<'a, C, A> where C: BorrowMut, A self._datafeed_id = new_value.to_string(); self } + /// Flag to run the request in dry-run mode. + /// + /// Sets the *dry run* query property to the given value. + pub fn dry_run(mut self, new_value: bool) -> DatafeedDeleteCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -6665,6 +6715,7 @@ impl<'a, C, A> DatafeedDeleteCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.datafeeds().insert(req, "merchantId") +/// .dry_run(false) /// .doit(); /// # } /// ``` @@ -6674,6 +6725,7 @@ pub struct DatafeedInsertCall<'a, C, A> hub: &'a ShoppingContent, _request: Datafeed, _merchant_id: String, + _dry_run: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -6695,9 +6747,12 @@ impl<'a, C, A> DatafeedInsertCall<'a, C, A> where C: BorrowMut, A }; dlg.begin(MethodInfo { id: "content.datafeeds.insert", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); - for &field in ["alt", "merchantId"].iter() { + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["alt", "merchantId", "dryRun"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6846,6 +6901,13 @@ impl<'a, C, A> DatafeedInsertCall<'a, C, A> where C: BorrowMut, A self._merchant_id = new_value.to_string(); self } + /// Flag to run the request in dry-run mode. + /// + /// Sets the *dry run* query property to the given value. + pub fn dry_run(mut self, new_value: bool) -> DatafeedInsertCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -6925,8 +6987,8 @@ impl<'a, C, A> DatafeedInsertCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.datafeeds().list("merchantId") -/// .page_token("duo") -/// .max_results(69) +/// .page_token("sadipscing") +/// .max_results(53) /// .doit(); /// # } /// ``` @@ -7191,6 +7253,7 @@ impl<'a, C, A> DatafeedListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.datafeeds().update(req, "merchantId", "datafeedId") +/// .dry_run(false) /// .doit(); /// # } /// ``` @@ -7201,6 +7264,7 @@ pub struct DatafeedUpdateCall<'a, C, A> _request: Datafeed, _merchant_id: String, _datafeed_id: String, + _dry_run: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -7222,10 +7286,13 @@ impl<'a, C, A> DatafeedUpdateCall<'a, C, A> where C: BorrowMut, A }; dlg.begin(MethodInfo { id: "content.datafeeds.update", http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); params.push(("datafeedId", self._datafeed_id.to_string())); - for &field in ["alt", "merchantId", "datafeedId"].iter() { + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["alt", "merchantId", "datafeedId", "dryRun"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7383,6 +7450,13 @@ impl<'a, C, A> DatafeedUpdateCall<'a, C, A> where C: BorrowMut, A self._datafeed_id = new_value.to_string(); self } + /// Flag to run the request in dry-run mode. + /// + /// Sets the *dry run* query property to the given value. + pub fn dry_run(mut self, new_value: bool) -> DatafeedUpdateCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -7710,8 +7784,8 @@ impl<'a, C, A> ProductstatuseGetCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.productstatuses().list("merchantId") -/// .page_token("dolor") -/// .max_results(62) +/// .page_token("dolore") +/// .max_results(64) /// .doit(); /// # } /// ``` @@ -8413,6 +8487,7 @@ impl<'a, C, A> AccountAuthinfoCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounts().patch(req, "merchantId", "accountId") +/// .dry_run(false) /// .doit(); /// # } /// ``` @@ -8423,6 +8498,7 @@ pub struct AccountPatchCall<'a, C, A> _request: Account, _merchant_id: String, _account_id: String, + _dry_run: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -8444,10 +8520,13 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "content.accounts.patch", http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); params.push(("accountId", self._account_id.to_string())); - for &field in ["alt", "merchantId", "accountId"].iter() { + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["alt", "merchantId", "accountId", "dryRun"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8607,6 +8686,13 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: self._account_id = new_value.to_string(); self } + /// Flag to run the request in dry-run mode. + /// + /// Sets the *dry run* query property to the given value. + pub fn dry_run(mut self, new_value: bool) -> AccountPatchCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -8940,6 +9026,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounts().update(req, "merchantId", "accountId") +/// .dry_run(true) /// .doit(); /// # } /// ``` @@ -8950,6 +9037,7 @@ pub struct AccountUpdateCall<'a, C, A> _request: Account, _merchant_id: String, _account_id: String, + _dry_run: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -8971,10 +9059,13 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "content.accounts.update", http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); params.push(("accountId", self._account_id.to_string())); - for &field in ["alt", "merchantId", "accountId"].iter() { + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["alt", "merchantId", "accountId", "dryRun"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9134,6 +9225,13 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: self._account_id = new_value.to_string(); self } + /// Flag to run the request in dry-run mode. + /// + /// Sets the *dry run* query property to the given value. + pub fn dry_run(mut self, new_value: bool) -> AccountUpdateCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -9213,8 +9311,8 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounts().list("merchantId") -/// .page_token("aliquyam") -/// .max_results(28) +/// .page_token("et") +/// .max_results(55) /// .doit(); /// # } /// ``` @@ -9473,6 +9571,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounts().delete("merchantId", "accountId") +/// .dry_run(true) /// .doit(); /// # } /// ``` @@ -9482,6 +9581,7 @@ pub struct AccountDeleteCall<'a, C, A> hub: &'a ShoppingContent, _merchant_id: String, _account_id: String, + _dry_run: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -9503,10 +9603,13 @@ impl<'a, C, A> AccountDeleteCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "content.accounts.delete", http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); params.push(("accountId", self._account_id.to_string())); - for &field in ["merchantId", "accountId"].iter() { + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["merchantId", "accountId", "dryRun"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9631,6 +9734,13 @@ impl<'a, C, A> AccountDeleteCall<'a, C, A> where C: BorrowMut, A: self._account_id = new_value.to_string(); self } + /// Flag to run the request in dry-run mode. + /// + /// Sets the *dry run* query property to the given value. + pub fn dry_run(mut self, new_value: bool) -> AccountDeleteCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -9716,6 +9826,7 @@ impl<'a, C, A> AccountDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounts().custombatch(req) +/// .dry_run(true) /// .doit(); /// # } /// ``` @@ -9724,6 +9835,7 @@ pub struct AccountCustombatchCall<'a, C, A> hub: &'a ShoppingContent, _request: AccountsCustomBatchRequest, + _dry_run: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -9745,8 +9857,11 @@ impl<'a, C, A> AccountCustombatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((3 + self._additional_params.len())); - for &field in ["alt"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["alt", "dryRun"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9865,6 +9980,13 @@ impl<'a, C, A> AccountCustombatchCall<'a, C, A> where C: BorrowMut AccountCustombatchCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -9950,6 +10072,7 @@ impl<'a, C, A> AccountCustombatchCall<'a, C, A> where C: BorrowMut hub: &'a ShoppingContent, _request: Account, _merchant_id: String, + _dry_run: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -9980,9 +10104,12 @@ impl<'a, C, A> AccountInsertCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "content.accounts.insert", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); - for &field in ["alt", "merchantId"].iter() { + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["alt", "merchantId", "dryRun"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10132,6 +10259,13 @@ impl<'a, C, A> AccountInsertCall<'a, C, A> where C: BorrowMut, A: self._merchant_id = new_value.to_string(); self } + /// Flag to run the request in dry-run mode. + /// + /// Sets the *dry run* query property to the given value. + pub fn dry_run(mut self, new_value: bool) -> AccountInsertCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -10217,6 +10351,7 @@ impl<'a, C, A> AccountInsertCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.inventory().set(req, "merchantId", "storeCode", "productId") +/// .dry_run(false) /// .doit(); /// # } /// ``` @@ -10228,6 +10363,7 @@ pub struct InventorySetCall<'a, C, A> _merchant_id: String, _store_code: String, _product_id: String, + _dry_run: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -10249,11 +10385,14 @@ impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "content.inventory.set", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); params.push(("storeCode", self._store_code.to_string())); params.push(("productId", self._product_id.to_string())); - for &field in ["alt", "merchantId", "storeCode", "productId"].iter() { + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["alt", "merchantId", "storeCode", "productId", "dryRun"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10423,6 +10562,13 @@ impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: self._product_id = new_value.to_string(); self } + /// Flag to run the request in dry-run mode. + /// + /// Sets the *dry run* query property to the given value. + pub fn dry_run(mut self, new_value: bool) -> InventorySetCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -10508,6 +10654,7 @@ impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.inventory().custombatch(req) +/// .dry_run(false) /// .doit(); /// # } /// ``` @@ -10516,6 +10663,7 @@ pub struct InventoryCustombatchCall<'a, C, A> hub: &'a ShoppingContent, _request: InventoryCustomBatchRequest, + _dry_run: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -10537,8 +10685,11 @@ impl<'a, C, A> InventoryCustombatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((3 + self._additional_params.len())); - for &field in ["alt"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["alt", "dryRun"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10657,6 +10808,13 @@ impl<'a, C, A> InventoryCustombatchCall<'a, C, A> where C: BorrowMut InventoryCustombatchCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -10984,8 +11142,8 @@ impl<'a, C, A> AccountstatuseGetCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accountstatuses().list("merchantId") -/// .page_token("et") -/// .max_results(56) +/// .page_token("justo") +/// .max_results(49) /// .doit(); /// # } /// ``` @@ -11476,8 +11634,8 @@ impl<'a, C, A> AccountstatuseCustombatchCall<'a, C, A> where C: BorrowMut ProductCustombatchCall<'a, C, A> where C: BorrowMut ProductInsertCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accountshipping().list("merchantId") -/// .page_token("justo") -/// .max_results(49) +/// .page_token("Lorem") +/// .max_results(84) /// .doit(); /// # } /// ``` @@ -13315,7 +13473,7 @@ impl<'a, C, A> AccountshippingPatchCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with coordinate (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/coordinate1-cli" @@ -17,9 +17,10 @@ keywords = ["coordinate", "google", "cli"] name = "coordinate1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/coordinate1-cli/README.md b/gen/coordinate1-cli/README.md index 25ab261e6a..beea30b68f 100644 --- a/gen/coordinate1-cli/README.md +++ b/gen/coordinate1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *coordinate* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/coordinate1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/coordinate1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/coordinate1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/coordinate1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/coordinate1-cli). # Usage -This documentation was generated from the *coordinate* API at revision *20141215*. The CLI is at version *0.3.1*. +This documentation was generated from the *coordinate* API at revision *20141215*. The CLI is at version *0.3.2*. ```bash coordinate1 [options] diff --git a/gen/coordinate1-cli/mkdocs.yml b/gen/coordinate1-cli/mkdocs.yml index 7a2522a694..769c02c725 100644 --- a/gen/coordinate1-cli/mkdocs.yml +++ b/gen/coordinate1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: coordinate v0.3.1+20141215 +site_name: coordinate v0.3.2+20141215 site_url: http://byron.github.io/google-apis-rs/google-coordinate1-cli site_description: Write integrating applications with bcore diff --git a/gen/coordinate1-cli/src/cmn.rs b/gen/coordinate1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/coordinate1-cli/src/cmn.rs +++ b/gen/coordinate1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/coordinate1-cli/src/main.rs b/gen/coordinate1-cli/src/main.rs index 39ce08890b..3bb809850c 100644 --- a/gen/coordinate1-cli/src/main.rs +++ b/gen/coordinate1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1566,7 +1567,7 @@ fn main() { let mut app = App::new("coordinate1") .author("Sebastian Thiel ") - .version("0.3.1+20141215") + .version("0.3.2+20141215") .about("Lets you view and manage jobs in a Coordinate team.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_coordinate1_cli") .arg(Arg::with_name("url") @@ -1648,7 +1649,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/coordinate1/Cargo.toml b/gen/coordinate1/Cargo.toml index e2d0dbb11d..739cab2f20 100644 --- a/gen/coordinate1/Cargo.toml +++ b/gen/coordinate1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-coordinate1" -version = "0.1.8+20141215" +version = "0.1.9+20141215" authors = ["Sebastian Thiel "] description = "A complete library to interact with coordinate (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/coordinate1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/coordinate1/README.md b/gen/coordinate1/README.md index 50cbd2fda8..092308c8e7 100644 --- a/gen/coordinate1/README.md +++ b/gen/coordinate1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-coordinate1` library allows access to all features of the *Google coordinate* service. -This documentation was generated from *coordinate* crate version *0.1.8+20141215*, where *20141215* is the exact revision of the *coordinate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *coordinate* crate version *0.1.9+20141215*, where *20141215* is the exact revision of the *coordinate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *coordinate* *v1* API can be found at the [official documentation site](https://developers.google.com/coordinate/). diff --git a/gen/coordinate1/src/cmn.rs b/gen/coordinate1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/coordinate1/src/cmn.rs +++ b/gen/coordinate1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/coordinate1/src/lib.rs b/gen/coordinate1/src/lib.rs index 2cf84865de..f6cf6f3fe3 100644 --- a/gen/coordinate1/src/lib.rs +++ b/gen/coordinate1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *coordinate* crate version *0.1.8+20141215*, where *20141215* is the exact revision of the *coordinate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *coordinate* crate version *0.1.9+20141215*, where *20141215* is the exact revision of the *coordinate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *coordinate* *v1* API can be found at the //! [official documentation site](https://developers.google.com/coordinate/). diff --git a/gen/coordinate1/src/lib.rs.in b/gen/coordinate1/src/lib.rs.in index de3f84a03c..a0b8761271 100644 --- a/gen/coordinate1/src/lib.rs.in +++ b/gen/coordinate1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -145,7 +146,7 @@ impl<'a, C, A> Coordinate Coordinate { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -169,7 +170,7 @@ impl<'a, C, A> Coordinate } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/customsearch1-cli/Cargo.toml b/gen/customsearch1-cli/Cargo.toml index 9b72eb61d3..76d6acdc22 100644 --- a/gen/customsearch1-cli/Cargo.toml +++ b/gen/customsearch1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-customsearch1-cli" -version = "0.3.1+20131205" +version = "0.3.2+20131205" authors = ["Sebastian Thiel "] description = "A complete library to interact with customsearch (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/customsearch1-cli" @@ -17,9 +17,10 @@ keywords = ["customsearch", "google", "cli"] name = "customsearch1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/customsearch1-cli/README.md b/gen/customsearch1-cli/README.md index f763ecb17e..5ff16d5937 100644 --- a/gen/customsearch1-cli/README.md +++ b/gen/customsearch1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *customsearch* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/customsearch1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/customsearch1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/customsearch1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/customsearch1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/customsearch1-cli). # Usage -This documentation was generated from the *customsearch* API at revision *20131205*. The CLI is at version *0.3.1*. +This documentation was generated from the *customsearch* API at revision *20131205*. The CLI is at version *0.3.2*. ```bash customsearch1 [options] diff --git a/gen/customsearch1-cli/mkdocs.yml b/gen/customsearch1-cli/mkdocs.yml index 62fd444564..c2e393225c 100644 --- a/gen/customsearch1-cli/mkdocs.yml +++ b/gen/customsearch1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: customsearch v0.3.1+20131205 +site_name: customsearch v0.3.2+20131205 site_url: http://byron.github.io/google-apis-rs/google-customsearch1-cli site_description: Write integrating applications with bcore diff --git a/gen/customsearch1-cli/src/cmn.rs b/gen/customsearch1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/customsearch1-cli/src/cmn.rs +++ b/gen/customsearch1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/customsearch1-cli/src/main.rs b/gen/customsearch1-cli/src/main.rs index 02a37cb20a..50cbd84c54 100644 --- a/gen/customsearch1-cli/src/main.rs +++ b/gen/customsearch1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -314,7 +315,7 @@ fn main() { let mut app = App::new("customsearch1") .author("Sebastian Thiel ") - .version("0.3.1+20131205") + .version("0.3.2+20131205") .about("Lets you search over a website or collection of websites") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_customsearch1_cli") .arg(Arg::with_name("folder") @@ -391,7 +392,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/customsearch1/Cargo.toml b/gen/customsearch1/Cargo.toml index 29797ab2b5..067addf9d2 100644 --- a/gen/customsearch1/Cargo.toml +++ b/gen/customsearch1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-customsearch1" -version = "0.1.8+20131205" +version = "0.1.9+20131205" authors = ["Sebastian Thiel "] description = "A complete library to interact with customsearch (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/customsearch1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/customsearch1/README.md b/gen/customsearch1/README.md index eeb4fd5bee..96bdcbb516 100644 --- a/gen/customsearch1/README.md +++ b/gen/customsearch1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-customsearch1` library allows access to all features of the *Google customsearch* service. -This documentation was generated from *customsearch* crate version *0.1.8+20131205*, where *20131205* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *customsearch* crate version *0.1.9+20131205*, where *20131205* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *customsearch* *v1* API can be found at the [official documentation site](https://developers.google.com/custom-search/v1/using_rest). diff --git a/gen/customsearch1/src/cmn.rs b/gen/customsearch1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/customsearch1/src/cmn.rs +++ b/gen/customsearch1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/customsearch1/src/lib.rs b/gen/customsearch1/src/lib.rs index 0b0b5c4c62..f457c88135 100644 --- a/gen/customsearch1/src/lib.rs +++ b/gen/customsearch1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *customsearch* crate version *0.1.8+20131205*, where *20131205* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *customsearch* crate version *0.1.9+20131205*, where *20131205* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *customsearch* *v1* API can be found at the //! [official documentation site](https://developers.google.com/custom-search/v1/using_rest). diff --git a/gen/customsearch1/src/lib.rs.in b/gen/customsearch1/src/lib.rs.in index 0b2c200955..5f788e9bb0 100644 --- a/gen/customsearch1/src/lib.rs.in +++ b/gen/customsearch1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -134,7 +135,7 @@ impl<'a, C, A> Customsearch Customsearch { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -143,7 +144,7 @@ impl<'a, C, A> Customsearch } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/datastore1_beta2-cli/Cargo.toml b/gen/datastore1_beta2-cli/Cargo.toml index 5bc6ef1911..8b188973ed 100644 --- a/gen/datastore1_beta2-cli/Cargo.toml +++ b/gen/datastore1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-datastore1_beta2-cli" -version = "0.3.1+20150402" +version = "0.3.2+20150402" authors = ["Sebastian Thiel "] description = "A complete library to interact with datastore (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/datastore1_beta2-cli" @@ -17,9 +17,10 @@ keywords = ["datastore", "google", "cli"] name = "datastore1-beta2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/datastore1_beta2-cli/README.md b/gen/datastore1_beta2-cli/README.md index 78c762b452..e6b991b83f 100644 --- a/gen/datastore1_beta2-cli/README.md +++ b/gen/datastore1_beta2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *datastore* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/datastore1-beta2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/datastore1-beta2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/datastore1-beta2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/datastore1-beta2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/datastore1_beta2-cli). # Usage -This documentation was generated from the *datastore* API at revision *20150402*. The CLI is at version *0.3.1*. +This documentation was generated from the *datastore* API at revision *20150402*. The CLI is at version *0.3.2*. ```bash datastore1-beta2 [options] diff --git a/gen/datastore1_beta2-cli/mkdocs.yml b/gen/datastore1_beta2-cli/mkdocs.yml index 3cd829d64e..670b664240 100644 --- a/gen/datastore1_beta2-cli/mkdocs.yml +++ b/gen/datastore1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: datastore v0.3.1+20150402 +site_name: datastore v0.3.2+20150402 site_url: http://byron.github.io/google-apis-rs/google-datastore1_beta2-cli site_description: Write integrating applications with bcore diff --git a/gen/datastore1_beta2-cli/src/cmn.rs b/gen/datastore1_beta2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/datastore1_beta2-cli/src/cmn.rs +++ b/gen/datastore1_beta2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/datastore1_beta2-cli/src/main.rs b/gen/datastore1_beta2-cli/src/main.rs index f9358114fd..0530624e20 100644 --- a/gen/datastore1_beta2-cli/src/main.rs +++ b/gen/datastore1_beta2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -870,7 +871,7 @@ fn main() { let mut app = App::new("datastore1-beta2") .author("Sebastian Thiel ") - .version("0.3.1+20150402") + .version("0.3.2+20150402") .about("API for accessing Google Cloud Datastore.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_datastore1_beta2_cli") .arg(Arg::with_name("url") @@ -952,7 +953,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/datastore1_beta2/Cargo.toml b/gen/datastore1_beta2/Cargo.toml index a28a4f1eaf..f366718e18 100644 --- a/gen/datastore1_beta2/Cargo.toml +++ b/gen/datastore1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-datastore1_beta2" -version = "0.1.8+20150402" +version = "0.1.9+20150402" authors = ["Sebastian Thiel "] description = "A complete library to interact with datastore (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/datastore1_beta2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/datastore1_beta2/README.md b/gen/datastore1_beta2/README.md index af98bde5d5..ac3eb9bb8e 100644 --- a/gen/datastore1_beta2/README.md +++ b/gen/datastore1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-datastore1_beta2` library allows access to all features of the *Google datastore* service. -This documentation was generated from *datastore* crate version *0.1.8+20150402*, where *20150402* is the exact revision of the *datastore:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *datastore* crate version *0.1.9+20150402*, where *20150402* is the exact revision of the *datastore:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *datastore* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/datastore/). diff --git a/gen/datastore1_beta2/src/cmn.rs b/gen/datastore1_beta2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/datastore1_beta2/src/cmn.rs +++ b/gen/datastore1_beta2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/datastore1_beta2/src/lib.rs b/gen/datastore1_beta2/src/lib.rs index 6eca788129..95fca490f6 100644 --- a/gen/datastore1_beta2/src/lib.rs +++ b/gen/datastore1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *datastore* crate version *0.1.8+20150402*, where *20150402* is the exact revision of the *datastore:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *datastore* crate version *0.1.9+20150402*, where *20150402* is the exact revision of the *datastore:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *datastore* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/datastore/). diff --git a/gen/datastore1_beta2/src/lib.rs.in b/gen/datastore1_beta2/src/lib.rs.in index fa9cbef64b..8fc1da4f23 100644 --- a/gen/datastore1_beta2/src/lib.rs.in +++ b/gen/datastore1_beta2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -139,7 +140,7 @@ impl<'a, C, A> Datastore Datastore { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -148,7 +149,7 @@ impl<'a, C, A> Datastore } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/deploymentmanager2_beta2-cli/Cargo.toml b/gen/deploymentmanager2_beta2-cli/Cargo.toml index 25ccf18ffa..74fd063191 100644 --- a/gen/deploymentmanager2_beta2-cli/Cargo.toml +++ b/gen/deploymentmanager2_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-deploymentmanager2_beta2-cli" -version = "0.3.1+20150616" +version = "0.3.2+20150715" authors = ["Sebastian Thiel "] description = "A complete library to interact with Deployment Manager (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2_beta2-cli" @@ -17,9 +17,10 @@ keywords = ["deploymentmanager", "google", "cli"] name = "deploymentmanager2-beta2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/deploymentmanager2_beta2-cli/README.md b/gen/deploymentmanager2_beta2-cli/README.md index 7570a98d70..faefc6112b 100644 --- a/gen/deploymentmanager2_beta2-cli/README.md +++ b/gen/deploymentmanager2_beta2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *Deployment Manager* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/deploymentmanager2-beta2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/deploymentmanager2-beta2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/deploymentmanager2-beta2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/deploymentmanager2-beta2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2_beta2-cli). # Usage -This documentation was generated from the *Deployment Manager* API at revision *20150616*. The CLI is at version *0.3.1*. +This documentation was generated from the *Deployment Manager* API at revision *20150715*. The CLI is at version *0.3.2*. ```bash deploymentmanager2-beta2 [options] diff --git a/gen/deploymentmanager2_beta2-cli/mkdocs.yml b/gen/deploymentmanager2_beta2-cli/mkdocs.yml index b7e967ff0a..ece76265c2 100644 --- a/gen/deploymentmanager2_beta2-cli/mkdocs.yml +++ b/gen/deploymentmanager2_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Deployment Manager v0.3.1+20150616 +site_name: Deployment Manager v0.3.2+20150715 site_url: http://byron.github.io/google-apis-rs/google-deploymentmanager2_beta2-cli site_description: Write integrating applications with bcore diff --git a/gen/deploymentmanager2_beta2-cli/src/cmn.rs b/gen/deploymentmanager2_beta2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/deploymentmanager2_beta2-cli/src/cmn.rs +++ b/gen/deploymentmanager2_beta2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/deploymentmanager2_beta2-cli/src/main.rs b/gen/deploymentmanager2_beta2-cli/src/main.rs index 2ec9d7d033..e51806072a 100644 --- a/gen/deploymentmanager2_beta2-cli/src/main.rs +++ b/gen/deploymentmanager2_beta2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1477,7 +1478,7 @@ fn main() { let mut app = App::new("deploymentmanager2-beta2") .author("Sebastian Thiel ") - .version("0.3.1+20150616") + .version("0.3.2+20150715") .about("The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli") .arg(Arg::with_name("url") @@ -1559,7 +1560,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/deploymentmanager2_beta2/Cargo.toml b/gen/deploymentmanager2_beta2/Cargo.toml index 505cd06382..459e886fec 100644 --- a/gen/deploymentmanager2_beta2/Cargo.toml +++ b/gen/deploymentmanager2_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-deploymentmanager2_beta2" -version = "0.1.8+20150616" +version = "0.1.9+20150715" authors = ["Sebastian Thiel "] description = "A complete library to interact with Deployment Manager (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2_beta2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/deploymentmanager2_beta2/README.md b/gen/deploymentmanager2_beta2/README.md index 1dbfda2248..0dbb0fdb14 100644 --- a/gen/deploymentmanager2_beta2/README.md +++ b/gen/deploymentmanager2_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-deploymentmanager2_beta2` library allows access to all features of the *Google Deployment Manager* service. -This documentation was generated from *Deployment Manager* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *deploymentmanager:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Deployment Manager* crate version *0.1.9+20150715*, where *20150715* is the exact revision of the *deploymentmanager:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *Deployment Manager* *v2_beta2* API can be found at the [official documentation site](https://developers.google.com/deployment-manager/). diff --git a/gen/deploymentmanager2_beta2/src/cmn.rs b/gen/deploymentmanager2_beta2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/deploymentmanager2_beta2/src/cmn.rs +++ b/gen/deploymentmanager2_beta2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/deploymentmanager2_beta2/src/lib.rs b/gen/deploymentmanager2_beta2/src/lib.rs index 52f328b147..5892c6ab4f 100644 --- a/gen/deploymentmanager2_beta2/src/lib.rs +++ b/gen/deploymentmanager2_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Deployment Manager* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *deploymentmanager:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Deployment Manager* crate version *0.1.9+20150715*, where *20150715* is the exact revision of the *deploymentmanager:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *Deployment Manager* *v2_beta2* API can be found at the //! [official documentation site](https://developers.google.com/deployment-manager/). diff --git a/gen/deploymentmanager2_beta2/src/lib.rs.in b/gen/deploymentmanager2_beta2/src/lib.rs.in index b21eb1d82f..7d07ef2f84 100644 --- a/gen/deploymentmanager2_beta2/src/lib.rs.in +++ b/gen/deploymentmanager2_beta2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -142,7 +143,7 @@ impl<'a, C, A> DeploymentManager DeploymentManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -163,7 +164,7 @@ impl<'a, C, A> DeploymentManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -223,7 +224,7 @@ pub struct ResourceType { /// [Output Only] Timestamp when the resource was created or acquired, in RFC3339 text format . #[serde(rename="insertTime")] pub insert_time: Option, - /// [Output Only] The type of the resource, for example ?compute.v1.instance?, or ?replicaPools.v1beta2.instanceGroupManager? + /// [Output Only] The type of the resource, for example compute.v1.instance, or replicaPools.v1beta2.instanceGroupManager. #[serde(rename="type")] pub type_: Option, /// [Output Only] Unique identifier for the resource; defined by the server. @@ -469,7 +470,7 @@ pub struct Deployment { pub update_time: Option, /// An optional user-provided description of the deployment. pub description: Option, - /// The name of the deployment, which must be unique within the project. + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. pub name: Option, /// [Output Only] If Deployment Manager is currently updating or previewing an update to this deployment, the updated configuration appears here. pub update: Option, @@ -488,9 +489,7 @@ pub struct Deployment { /// [Output Only] Timestamp when the deployment was created, in RFC3339 text format . #[serde(rename="insertTime")] pub insert_time: Option, - /// Specifies a fingerprint for update() requests. A fingerprint is a randomly generated value that must be provided in update() requests to perform optimistic locking. This ensures optimistic concurrency so that only one update can be performed at a time. - /// - /// The fingerprint is initially generated by Deployment Manager and changes after every request to modify data. To get the latest fingerprint value, perform a get() request to a deployment. + /// Specifies a fingerprint for update() requests. A fingerprint is a randomly generated value that must be provided in update() requests to perform optimistic locking. This ensures optimistic concurrency so that only one update can be performed at a time. The fingerprint is initially generated by Deployment Manager and changes after every request to modify data. To get the latest fingerprint value, perform a get() request to a deployment. pub fingerprint: Option, /// [Output Only] Unique identifier for the resource; defined by the server. pub id: Option, @@ -524,7 +523,7 @@ pub struct OperationsListResponse { impl ResponseResult for OperationsListResponse {} -/// An operation resource, used to manage asynchronous API requests. +/// An Operation resource, used to manage asynchronous API requests. /// /// # Activities /// @@ -558,7 +557,7 @@ pub struct Operation { /// [Output Only] The time that this operation was started by the server. This is in RFC3339 text format. #[serde(rename="startTime")] pub start_time: Option, - /// [Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project. + /// [Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project. #[serde(rename="clientOperationId")] pub client_operation_id: Option, /// [Output Only] Creation timestamp in RFC3339 text format. @@ -1580,7 +1579,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: self._project = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> OperationListCall<'a, C, A> { @@ -1594,7 +1593,14 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> OperationListCall<'a, C, A> { @@ -1864,7 +1870,7 @@ impl<'a, C, A> ManifestListCall<'a, C, A> where C: BorrowMut, A: self._deployment = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ManifestListCall<'a, C, A> { @@ -1878,7 +1884,14 @@ impl<'a, C, A> ManifestListCall<'a, C, A> where C: BorrowMut, A: self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ManifestListCall<'a, C, A> { @@ -2668,7 +2681,7 @@ impl<'a, C, A> ResourceListCall<'a, C, A> where C: BorrowMut, A: self._deployment = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ResourceListCall<'a, C, A> { @@ -2682,7 +2695,14 @@ impl<'a, C, A> ResourceListCall<'a, C, A> where C: BorrowMut, A: self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ResourceListCall<'a, C, A> { @@ -2940,7 +2960,7 @@ impl<'a, C, A> TypeListCall<'a, C, A> where C: BorrowMut, A: oaut self._project = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> TypeListCall<'a, C, A> { @@ -2954,7 +2974,14 @@ impl<'a, C, A> TypeListCall<'a, C, A> where C: BorrowMut, A: oaut self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TypeListCall<'a, C, A> { @@ -4042,7 +4069,7 @@ impl<'a, C, A> DeploymentListCall<'a, C, A> where C: BorrowMut, A self._project = new_value.to_string(); self } - /// Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request. + /// Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> DeploymentListCall<'a, C, A> { @@ -4056,7 +4083,14 @@ impl<'a, C, A> DeploymentListCall<'a, C, A> where C: BorrowMut, A self._max_results = Some(new_value); self } - /// Filter expression for filtering listed resources. + /// Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following: + /// FIELD_NAME COMPARISON_STRING LITERAL_STRING + /// + /// - FIELD_NAME: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported. + /// - COMPARISON_STRING: The comparison string, either eq (equals) or ne (not equals). + /// - LITERAL_STRING: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, you can filter by the name of a resource: + /// filter=name ne example-instance + /// The above filter returns only results whose name field does not equal example-instance. You can also enclose your literal string in single, double, or no quotes. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> DeploymentListCall<'a, C, A> { diff --git a/gen/dfareporting2d1-cli/Cargo.toml b/gen/dfareporting2d1-cli/Cargo.toml index 91fb627cf1..7f7d5d0cb8 100644 --- a/gen/dfareporting2d1-cli/Cargo.toml +++ b/gen/dfareporting2d1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dfareporting2d1-cli" -version = "0.3.1+20150326" +version = "0.3.2+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v2.1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d1-cli" @@ -17,9 +17,10 @@ keywords = ["dfareporting", "google", "cli"] name = "dfareporting2d1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/dfareporting2d1-cli/README.md b/gen/dfareporting2d1-cli/README.md index aece67712b..e6b9ddcd24 100644 --- a/gen/dfareporting2d1-cli/README.md +++ b/gen/dfareporting2d1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *dfareporting* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/dfareporting2d1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/dfareporting2d1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/dfareporting2d1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/dfareporting2d1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d1-cli). # Usage -This documentation was generated from the *dfareporting* API at revision *20150326*. The CLI is at version *0.3.1*. +This documentation was generated from the *dfareporting* API at revision *20150326*. The CLI is at version *0.3.2*. ```bash dfareporting2d1 [options] diff --git a/gen/dfareporting2d1-cli/mkdocs.yml b/gen/dfareporting2d1-cli/mkdocs.yml index 7475e66936..6a1c08c425 100644 --- a/gen/dfareporting2d1-cli/mkdocs.yml +++ b/gen/dfareporting2d1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dfareporting v0.3.1+20150326 +site_name: dfareporting v0.3.2+20150326 site_url: http://byron.github.io/google-apis-rs/google-dfareporting2d1-cli site_description: Write integrating applications with bcore diff --git a/gen/dfareporting2d1-cli/src/cmn.rs b/gen/dfareporting2d1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/dfareporting2d1-cli/src/cmn.rs +++ b/gen/dfareporting2d1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/dfareporting2d1-cli/src/main.rs b/gen/dfareporting2d1-cli/src/main.rs index 892966ca29..0b6af48271 100644 --- a/gen/dfareporting2d1-cli/src/main.rs +++ b/gen/dfareporting2d1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -22313,7 +22314,7 @@ fn main() { let mut app = App::new("dfareporting2d1") .author("Sebastian Thiel ") - .version("0.3.1+20150326") + .version("0.3.2+20150326") .about("Manage your DoubleClick Campaign Manager ad campaigns and reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dfareporting2d1_cli") .arg(Arg::with_name("url") @@ -22406,7 +22407,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/dfareporting2d1/Cargo.toml b/gen/dfareporting2d1/Cargo.toml index c952d38260..8dd45153e3 100644 --- a/gen/dfareporting2d1/Cargo.toml +++ b/gen/dfareporting2d1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dfareporting2d1" -version = "0.1.8+20150326" +version = "0.1.9+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v2.1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/dfareporting2d1/README.md b/gen/dfareporting2d1/README.md index fd83bf9338..dd9d064fb9 100644 --- a/gen/dfareporting2d1/README.md +++ b/gen/dfareporting2d1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-dfareporting2d1` library allows access to all features of the *Google dfareporting* service. -This documentation was generated from *dfareporting* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *dfareporting:v2.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *dfareporting* crate version *0.1.9+20150326*, where *20150326* is the exact revision of the *dfareporting:v2.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *dfareporting* *v2d1* API can be found at the [official documentation site](https://developers.google.com/doubleclick-advertisers/reporting/). diff --git a/gen/dfareporting2d1/src/cmn.rs b/gen/dfareporting2d1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/dfareporting2d1/src/cmn.rs +++ b/gen/dfareporting2d1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/dfareporting2d1/src/lib.rs b/gen/dfareporting2d1/src/lib.rs index 352893c52c..cb49836814 100644 --- a/gen/dfareporting2d1/src/lib.rs +++ b/gen/dfareporting2d1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *dfareporting* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *dfareporting:v2.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *dfareporting* crate version *0.1.9+20150326*, where *20150326* is the exact revision of the *dfareporting:v2.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *dfareporting* *v2d1* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-advertisers/reporting/). diff --git a/gen/dfareporting2d1/src/lib.rs.in b/gen/dfareporting2d1/src/lib.rs.in index 3f8b5c66e2..ff9be0bfc3 100644 --- a/gen/dfareporting2d1/src/lib.rs.in +++ b/gen/dfareporting2d1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -134,7 +135,7 @@ impl<'a, C, A> Dfareporting Dfareporting { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -305,7 +306,7 @@ impl<'a, C, A> Dfareporting } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/discovery1-cli/Cargo.toml b/gen/discovery1-cli/Cargo.toml index e2772cea30..2db4ded1f4 100644 --- a/gen/discovery1-cli/Cargo.toml +++ b/gen/discovery1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-discovery1-cli" -version = "0.3.1+00000000" +version = "0.3.2+00000000" authors = ["Sebastian Thiel "] description = "A complete library to interact with discovery (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/discovery1-cli" @@ -17,9 +17,10 @@ keywords = ["discovery", "google", "cli"] name = "discovery1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/discovery1-cli/README.md b/gen/discovery1-cli/README.md index 2a204c26e8..5882f55b33 100644 --- a/gen/discovery1-cli/README.md +++ b/gen/discovery1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *discovery* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/discovery1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/discovery1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/discovery1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/discovery1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/discovery1-cli). # Usage -This documentation was generated from the *discovery* API at revision *00000000*. The CLI is at version *0.3.1*. +This documentation was generated from the *discovery* API at revision *00000000*. The CLI is at version *0.3.2*. ```bash discovery1 [options] diff --git a/gen/discovery1-cli/mkdocs.yml b/gen/discovery1-cli/mkdocs.yml index 092881b932..982e04fa3c 100644 --- a/gen/discovery1-cli/mkdocs.yml +++ b/gen/discovery1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: discovery v0.3.1+00000000 +site_name: discovery v0.3.2+00000000 site_url: http://byron.github.io/google-apis-rs/google-discovery1-cli site_description: Write integrating applications with bcore diff --git a/gen/discovery1-cli/src/cmn.rs b/gen/discovery1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/discovery1-cli/src/cmn.rs +++ b/gen/discovery1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/discovery1-cli/src/main.rs b/gen/discovery1-cli/src/main.rs index fdd82b9598..895cadd16c 100644 --- a/gen/discovery1-cli/src/main.rs +++ b/gen/discovery1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -301,7 +302,7 @@ fn main() { let mut app = App::new("discovery1") .author("Sebastian Thiel ") - .version("0.3.1+00000000") + .version("0.3.2+00000000") .about("Lets you discover information about other Google APIs, such as what APIs are available, the resource and method details for each API.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_discovery1_cli") .arg(Arg::with_name("folder") @@ -378,7 +379,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/discovery1/Cargo.toml b/gen/discovery1/Cargo.toml index a6b9578e27..fd16d9a09e 100644 --- a/gen/discovery1/Cargo.toml +++ b/gen/discovery1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-discovery1" -version = "0.1.8+00000000" +version = "0.1.9+00000000" authors = ["Sebastian Thiel "] description = "A complete library to interact with discovery (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/discovery1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/discovery1/README.md b/gen/discovery1/README.md index 5fef5a3f5d..acdd81955b 100644 --- a/gen/discovery1/README.md +++ b/gen/discovery1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-discovery1` library allows access to all features of the *Google discovery* service. -This documentation was generated from *discovery* crate version *0.1.8+00000000*, where *00000000* is the exact revision of the *discovery:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *discovery* crate version *0.1.9+00000000*, where *00000000* is the exact revision of the *discovery:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *discovery* *v1* API can be found at the [official documentation site](https://developers.google.com/discovery/). diff --git a/gen/discovery1/src/cmn.rs b/gen/discovery1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/discovery1/src/cmn.rs +++ b/gen/discovery1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/discovery1/src/lib.rs b/gen/discovery1/src/lib.rs index 587b38ba84..526eb2af25 100644 --- a/gen/discovery1/src/lib.rs +++ b/gen/discovery1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *discovery* crate version *0.1.8+00000000*, where *00000000* is the exact revision of the *discovery:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *discovery* crate version *0.1.9+00000000*, where *00000000* is the exact revision of the *discovery:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *discovery* *v1* API can be found at the //! [official documentation site](https://developers.google.com/discovery/). diff --git a/gen/discovery1/src/lib.rs.in b/gen/discovery1/src/lib.rs.in index 22e4f9b169..c1b93baa70 100644 --- a/gen/discovery1/src/lib.rs.in +++ b/gen/discovery1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -103,7 +104,7 @@ impl<'a, C, A> Discovery Discovery { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -112,7 +113,7 @@ impl<'a, C, A> Discovery } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -321,14 +322,12 @@ pub struct RestDescription { /// Indicates how the API name should be capitalized and split into various parts. Useful for generating pretty class names. #[serde(rename="canonicalName")] pub canonical_name: Option, - /// The name of the owner of this API. See ownerDomain. - #[serde(rename="ownerName")] - pub owner_name: Option, /// A link to human readable documentation for the API. #[serde(rename="documentationLink")] pub documentation_link: Option, - /// Authentication information. - pub auth: Option, + /// The name of the owner of this API. See ownerDomain. + #[serde(rename="ownerName")] + pub owner_name: Option, /// The package of the owner of this API. See ownerDomain. #[serde(rename="packagePath")] pub package_path: Option, @@ -355,21 +354,26 @@ pub struct RestDescription { pub description: Option, /// The title of this API. pub title: Option, + /// Enable exponential backoff for suitable methods in the generated clients. + #[serde(rename="exponentialBackoffDefault")] + pub exponential_backoff_default: Option, /// [DEPRECATED] The base URL for REST requests. #[serde(rename="baseUrl")] pub base_url: Option, - /// The ETag for this response. - pub etag: Option, /// The version of this API. pub version: Option, - /// The base path for all REST requests. - #[serde(rename="servicePath")] - pub service_path: Option, /// Indicate the version of the Discovery API used to generate this doc. #[serde(rename="discoveryVersion")] pub discovery_version: Option, + /// The base path for all REST requests. + #[serde(rename="servicePath")] + pub service_path: Option, + /// The ETag for this response. + pub etag: Option, /// The schemas for this API. pub schemas: Option>, + /// Authentication information. + pub auth: Option, /// [DEPRECATED] The base path for REST requests. #[serde(rename="basePath")] pub base_path: Option, diff --git a/gen/dns1-cli/Cargo.toml b/gen/dns1-cli/Cargo.toml index 0abe11edf1..84c46785b3 100644 --- a/gen/dns1-cli/Cargo.toml +++ b/gen/dns1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dns1-cli" -version = "0.3.1+20150218" +version = "0.3.2+20150624" authors = ["Sebastian Thiel "] description = "A complete library to interact with dns (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dns1-cli" @@ -17,9 +17,10 @@ keywords = ["dns", "google", "cli"] name = "dns1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/dns1-cli/README.md b/gen/dns1-cli/README.md index 17c8758662..9a99fa7a44 100644 --- a/gen/dns1-cli/README.md +++ b/gen/dns1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *dns* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/dns1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/dns1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/dns1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/dns1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/dns1-cli). # Usage -This documentation was generated from the *dns* API at revision *20150218*. The CLI is at version *0.3.1*. +This documentation was generated from the *dns* API at revision *20150624*. The CLI is at version *0.3.2*. ```bash dns1 [options] diff --git a/gen/dns1-cli/mkdocs.yml b/gen/dns1-cli/mkdocs.yml index 1d469d7474..d53161188b 100644 --- a/gen/dns1-cli/mkdocs.yml +++ b/gen/dns1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dns v0.3.1+20150218 +site_name: dns v0.3.2+20150624 site_url: http://byron.github.io/google-apis-rs/google-dns1-cli site_description: Write integrating applications with bcore diff --git a/gen/dns1-cli/src/cmn.rs b/gen/dns1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/dns1-cli/src/cmn.rs +++ b/gen/dns1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/dns1-cli/src/main.rs b/gen/dns1-cli/src/main.rs index 59fd0aa051..4169078677 100644 --- a/gen/dns1-cli/src/main.rs +++ b/gen/dns1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -449,6 +450,9 @@ impl<'n, 'a> Engine<'n, 'a> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "dns-name" => { + call = call.dns_name(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -462,7 +466,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["page-token", "max-results"].iter().map(|v|*v)); + v.extend(["page-token", "dns-name", "max-results"].iter().map(|v|*v)); v } )); } } @@ -1021,7 +1025,7 @@ fn main() { let mut app = App::new("dns1") .author("Sebastian Thiel ") - .version("0.3.1+20150218") + .version("0.3.2+20150624") .about("The Google Cloud DNS API provides services for configuring and serving authoritative DNS records.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dns1_cli") .arg(Arg::with_name("url") @@ -1103,7 +1107,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/dns1/Cargo.toml b/gen/dns1/Cargo.toml index db8190962c..6c3b324e8b 100644 --- a/gen/dns1/Cargo.toml +++ b/gen/dns1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dns1" -version = "0.1.8+20150218" +version = "0.1.9+20150624" authors = ["Sebastian Thiel "] description = "A complete library to interact with dns (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dns1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/dns1/README.md b/gen/dns1/README.md index 448a43ba0e..2eead3eac8 100644 --- a/gen/dns1/README.md +++ b/gen/dns1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-dns1` library allows access to all features of the *Google dns* service. -This documentation was generated from *dns* crate version *0.1.8+20150218*, where *20150218* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *dns* crate version *0.1.9+20150624*, where *20150624* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *dns* *v1* API can be found at the [official documentation site](https://developers.google.com/cloud-dns). @@ -104,6 +104,7 @@ let mut hub = Dns::new(hyper::Client::new(), auth); let result = hub.managed_zones().list("project") .page_token("sit") .max_results(-65) + .dns_name("sed") .doit(); match result { diff --git a/gen/dns1/src/cmn.rs b/gen/dns1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/dns1/src/cmn.rs +++ b/gen/dns1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/dns1/src/lib.rs b/gen/dns1/src/lib.rs index a2f7c4f376..9b225f187c 100644 --- a/gen/dns1/src/lib.rs +++ b/gen/dns1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *dns* crate version *0.1.8+20150218*, where *20150218* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *dns* crate version *0.1.9+20150624*, where *20150624* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *dns* *v1* API can be found at the //! [official documentation site](https://developers.google.com/cloud-dns). @@ -103,8 +103,9 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.managed_zones().list("project") -//! .page_token("eos") -//! .max_results(-81) +//! .page_token("dolor") +//! .max_results(-39) +//! .dns_name("elitr") //! .doit(); //! //! match result { diff --git a/gen/dns1/src/lib.rs.in b/gen/dns1/src/lib.rs.in index a99bc349d3..46e3b19f09 100644 --- a/gen/dns1/src/lib.rs.in +++ b/gen/dns1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -98,8 +99,9 @@ impl Default for Scope { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.managed_zones().list("project") -/// .page_token("et") -/// .max_results(-18) +/// .page_token("dolores") +/// .max_results(-63) +/// .dns_name("accusam") /// .doit(); /// /// match result { @@ -135,7 +137,7 @@ impl<'a, C, A> Dns Dns { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -153,7 +155,7 @@ impl<'a, C, A> Dns } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -619,6 +621,7 @@ impl<'a, C, A> ManagedZoneMethods<'a, C, A> { _project: project.to_string(), _page_token: Default::default(), _max_results: Default::default(), + _dns_name: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1062,10 +1065,10 @@ impl<'a, C, A> ChangeCreateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.changes().list("project", "managedZone") -/// .sort_order("amet.") -/// .sort_by("erat") -/// .page_token("labore") -/// .max_results(-9) +/// .sort_order("labore") +/// .sort_by("sea") +/// .page_token("nonumy") +/// .max_results(-19) /// .doit(); /// # } /// ``` @@ -2370,8 +2373,9 @@ impl<'a, C, A> ManagedZoneGetCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.managed_zones().list("project") -/// .page_token("et") -/// .max_results(-17) +/// .page_token("diam") +/// .max_results(-55) +/// .dns_name("Lorem") /// .doit(); /// # } /// ``` @@ -2382,6 +2386,7 @@ pub struct ManagedZoneListCall<'a, C, A> _project: String, _page_token: Option, _max_results: Option, + _dns_name: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -2403,7 +2408,7 @@ impl<'a, C, A> ManagedZoneListCall<'a, C, A> where C: BorrowMut, }; dlg.begin(MethodInfo { id: "dns.managedZones.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -2411,7 +2416,10 @@ impl<'a, C, A> ManagedZoneListCall<'a, C, A> where C: BorrowMut, if let Some(value) = self._max_results { params.push(("maxResults", value.to_string())); } - for &field in ["alt", "project", "pageToken", "maxResults"].iter() { + if let Some(value) = self._dns_name { + params.push(("dnsName", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "maxResults", "dnsName"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2551,6 +2559,13 @@ impl<'a, C, A> ManagedZoneListCall<'a, C, A> where C: BorrowMut, self._max_results = Some(new_value); self } + /// Restricts the list to return only zones with this domain name. + /// + /// Sets the *dns name* query property to the given value. + pub fn dns_name(mut self, new_value: &str) -> ManagedZoneListCall<'a, C, A> { + self._dns_name = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -2630,10 +2645,10 @@ impl<'a, C, A> ManagedZoneListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.resource_record_sets().list("project", "managedZone") -/// .type_("Lorem") -/// .page_token("et") -/// .name("duo") -/// .max_results(-32) +/// .type_("aliquyam") +/// .page_token("sea") +/// .name("Lorem") +/// .max_results(-75) /// .doit(); /// # } /// ``` diff --git a/gen/doubleclickbidmanager1-cli/Cargo.toml b/gen/doubleclickbidmanager1-cli/Cargo.toml index 468e161cfc..29542cadc7 100644 --- a/gen/doubleclickbidmanager1-cli/Cargo.toml +++ b/gen/doubleclickbidmanager1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-doubleclickbidmanager1-cli" -version = "0.3.1+20150326" +version = "0.3.2+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with DoubleClick Bid Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclickbidmanager1-cli" @@ -17,9 +17,10 @@ keywords = ["doubleclickbidmanage", "google", "cli"] name = "doubleclickbidmanager1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/doubleclickbidmanager1-cli/README.md b/gen/doubleclickbidmanager1-cli/README.md index 972e63b11b..731ffbbaa0 100644 --- a/gen/doubleclickbidmanager1-cli/README.md +++ b/gen/doubleclickbidmanager1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *DoubleClick Bid Manager* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/doubleclickbidmanager1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/doubleclickbidmanager1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/doubleclickbidmanager1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/doubleclickbidmanager1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclickbidmanager1-cli). # Usage -This documentation was generated from the *DoubleClick Bid Manager* API at revision *20150326*. The CLI is at version *0.3.1*. +This documentation was generated from the *DoubleClick Bid Manager* API at revision *20150326*. The CLI is at version *0.3.2*. ```bash doubleclickbidmanager1 [options] diff --git a/gen/doubleclickbidmanager1-cli/mkdocs.yml b/gen/doubleclickbidmanager1-cli/mkdocs.yml index b8bee5257c..822d67604c 100644 --- a/gen/doubleclickbidmanager1-cli/mkdocs.yml +++ b/gen/doubleclickbidmanager1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: DoubleClick Bid Manager v0.3.1+20150326 +site_name: DoubleClick Bid Manager v0.3.2+20150326 site_url: http://byron.github.io/google-apis-rs/google-doubleclickbidmanager1-cli site_description: Write integrating applications with bcore diff --git a/gen/doubleclickbidmanager1-cli/src/cmn.rs b/gen/doubleclickbidmanager1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/doubleclickbidmanager1-cli/src/cmn.rs +++ b/gen/doubleclickbidmanager1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/doubleclickbidmanager1-cli/src/main.rs b/gen/doubleclickbidmanager1-cli/src/main.rs index 146551d7bd..71607218f8 100644 --- a/gen/doubleclickbidmanager1-cli/src/main.rs +++ b/gen/doubleclickbidmanager1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -894,7 +895,7 @@ fn main() { let mut app = App::new("doubleclickbidmanager1") .author("Sebastian Thiel ") - .version("0.3.1+20150326") + .version("0.3.2+20150326") .about("API for viewing and managing your reports in DoubleClick Bid Manager.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_doubleclickbidmanager1_cli") .arg(Arg::with_name("folder") @@ -971,7 +972,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/doubleclickbidmanager1/Cargo.toml b/gen/doubleclickbidmanager1/Cargo.toml index a8d8c71373..4f7300b8db 100644 --- a/gen/doubleclickbidmanager1/Cargo.toml +++ b/gen/doubleclickbidmanager1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-doubleclickbidmanager1" -version = "0.1.8+20150326" +version = "0.1.9+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with DoubleClick Bid Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclickbidmanager1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/doubleclickbidmanager1/README.md b/gen/doubleclickbidmanager1/README.md index d8fe89015c..5811cc7a69 100644 --- a/gen/doubleclickbidmanager1/README.md +++ b/gen/doubleclickbidmanager1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-doubleclickbidmanager1` library allows access to all features of the *Google DoubleClick Bid Manager* service. -This documentation was generated from *DoubleClick Bid Manager* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *DoubleClick Bid Manager* crate version *0.1.9+20150326*, where *20150326* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *DoubleClick Bid Manager* *v1* API can be found at the [official documentation site](https://developers.google.com/bid-manager/). diff --git a/gen/doubleclickbidmanager1/src/cmn.rs b/gen/doubleclickbidmanager1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/doubleclickbidmanager1/src/cmn.rs +++ b/gen/doubleclickbidmanager1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/doubleclickbidmanager1/src/lib.rs b/gen/doubleclickbidmanager1/src/lib.rs index 079a6677d6..2e3c35830a 100644 --- a/gen/doubleclickbidmanager1/src/lib.rs +++ b/gen/doubleclickbidmanager1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *DoubleClick Bid Manager* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *DoubleClick Bid Manager* crate version *0.1.9+20150326*, where *20150326* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *DoubleClick Bid Manager* *v1* API can be found at the //! [official documentation site](https://developers.google.com/bid-manager/). diff --git a/gen/doubleclickbidmanager1/src/lib.rs.in b/gen/doubleclickbidmanager1/src/lib.rs.in index 2765bc8885..7bbc53834e 100644 --- a/gen/doubleclickbidmanager1/src/lib.rs.in +++ b/gen/doubleclickbidmanager1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -103,7 +104,7 @@ impl<'a, C, A> DoubleClickBidManager DoubleClickBidManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -118,7 +119,7 @@ impl<'a, C, A> DoubleClickBidManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/doubleclicksearch2-cli/Cargo.toml b/gen/doubleclicksearch2-cli/Cargo.toml index 90d9a068b0..e3399c5012 100644 --- a/gen/doubleclicksearch2-cli/Cargo.toml +++ b/gen/doubleclicksearch2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-doubleclicksearch2-cli" -version = "0.3.1+20150526" +version = "0.3.2+20150708" authors = ["Sebastian Thiel "] description = "A complete library to interact with doubleclicksearch (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclicksearch2-cli" @@ -17,9 +17,10 @@ keywords = ["doubleclicksearch", "google", "cli"] name = "doubleclicksearch2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/doubleclicksearch2-cli/README.md b/gen/doubleclicksearch2-cli/README.md index 47f40a5f12..2b4d198b6a 100644 --- a/gen/doubleclicksearch2-cli/README.md +++ b/gen/doubleclicksearch2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *doubleclicksearch* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/doubleclicksearch2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/doubleclicksearch2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/doubleclicksearch2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/doubleclicksearch2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclicksearch2-cli). # Usage -This documentation was generated from the *doubleclicksearch* API at revision *20150526*. The CLI is at version *0.3.1*. +This documentation was generated from the *doubleclicksearch* API at revision *20150708*. The CLI is at version *0.3.2*. ```bash doubleclicksearch2 [options] diff --git a/gen/doubleclicksearch2-cli/mkdocs.yml b/gen/doubleclicksearch2-cli/mkdocs.yml index f376982623..3db939f300 100644 --- a/gen/doubleclicksearch2-cli/mkdocs.yml +++ b/gen/doubleclicksearch2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: doubleclicksearch v0.3.1+20150526 +site_name: doubleclicksearch v0.3.2+20150708 site_url: http://byron.github.io/google-apis-rs/google-doubleclicksearch2-cli site_description: Write integrating applications with bcore diff --git a/gen/doubleclicksearch2-cli/src/cmn.rs b/gen/doubleclicksearch2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/doubleclicksearch2-cli/src/cmn.rs +++ b/gen/doubleclicksearch2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/doubleclicksearch2-cli/src/main.rs b/gen/doubleclicksearch2-cli/src/main.rs index fcfe21cd53..dcba0ed8af 100644 --- a/gen/doubleclicksearch2-cli/src/main.rs +++ b/gen/doubleclicksearch2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1290,7 +1291,7 @@ fn main() { let mut app = App::new("doubleclicksearch2") .author("Sebastian Thiel ") - .version("0.3.1+20150526") + .version("0.3.2+20150708") .about("Report and modify your advertising data in DoubleClick Search (for example, campaigns, ad groups, keywords, and conversions).") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_doubleclicksearch2_cli") .arg(Arg::with_name("url") @@ -1372,7 +1373,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/doubleclicksearch2/Cargo.toml b/gen/doubleclicksearch2/Cargo.toml index 5e52e2c497..aed73a9954 100644 --- a/gen/doubleclicksearch2/Cargo.toml +++ b/gen/doubleclicksearch2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-doubleclicksearch2" -version = "0.1.8+20150526" +version = "0.1.9+20150708" authors = ["Sebastian Thiel "] description = "A complete library to interact with doubleclicksearch (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclicksearch2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/doubleclicksearch2/README.md b/gen/doubleclicksearch2/README.md index 1c49d17166..f4027dc475 100644 --- a/gen/doubleclicksearch2/README.md +++ b/gen/doubleclicksearch2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-doubleclicksearch2` library allows access to all features of the *Google doubleclicksearch* service. -This documentation was generated from *doubleclicksearch* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *doubleclicksearch* crate version *0.1.9+20150708*, where *20150708* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *doubleclicksearch* *v2* API can be found at the [official documentation site](https://developers.google.com/doubleclick-search/). diff --git a/gen/doubleclicksearch2/src/cmn.rs b/gen/doubleclicksearch2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/doubleclicksearch2/src/cmn.rs +++ b/gen/doubleclicksearch2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/doubleclicksearch2/src/lib.rs b/gen/doubleclicksearch2/src/lib.rs index e7b708dcab..864ac687ca 100644 --- a/gen/doubleclicksearch2/src/lib.rs +++ b/gen/doubleclicksearch2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *doubleclicksearch* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *doubleclicksearch* crate version *0.1.9+20150708*, where *20150708* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *doubleclicksearch* *v2* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-search/). diff --git a/gen/doubleclicksearch2/src/lib.rs.in b/gen/doubleclicksearch2/src/lib.rs.in index 2123ab5e81..3f9d5e59e2 100644 --- a/gen/doubleclicksearch2/src/lib.rs.in +++ b/gen/doubleclicksearch2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -125,7 +126,7 @@ impl<'a, C, A> Doubleclicksearch Doubleclicksearch { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -140,7 +141,7 @@ impl<'a, C, A> Doubleclicksearch } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/drive2-cli/Cargo.toml b/gen/drive2-cli/Cargo.toml index ba30d89963..bae8d6693f 100644 --- a/gen/drive2-cli/Cargo.toml +++ b/gen/drive2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-drive2-cli" -version = "0.3.1+20150305" +version = "0.3.2+20150709" authors = ["Sebastian Thiel "] description = "A complete library to interact with drive (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/drive2-cli" @@ -17,9 +17,10 @@ keywords = ["drive", "google", "cli"] name = "drive2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/drive2-cli/README.md b/gen/drive2-cli/README.md index 4fcabff410..690eececd8 100644 --- a/gen/drive2-cli/README.md +++ b/gen/drive2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *drive* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/drive2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/drive2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/drive2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/drive2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/drive2-cli). # Usage -This documentation was generated from the *drive* API at revision *20150305*. The CLI is at version *0.3.1*. +This documentation was generated from the *drive* API at revision *20150709*. The CLI is at version *0.3.2*. ```bash drive2 [options] diff --git a/gen/drive2-cli/mkdocs.yml b/gen/drive2-cli/mkdocs.yml index 586aa9a648..c2a3518fe4 100644 --- a/gen/drive2-cli/mkdocs.yml +++ b/gen/drive2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: drive v0.3.1+20150305 +site_name: drive v0.3.2+20150709 site_url: http://byron.github.io/google-apis-rs/google-drive2-cli site_description: Write integrating applications with bcore diff --git a/gen/drive2-cli/src/cmn.rs b/gen/drive2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/drive2-cli/src/cmn.rs +++ b/gen/drive2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/drive2-cli/src/main.rs b/gen/drive2-cli/src/main.rs index f8fd075246..d6d3fa510e 100644 --- a/gen/drive2-cli/src/main.rs +++ b/gen/drive2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1302,6 +1303,7 @@ impl<'n, 'a> Engine<'n, 'a> { "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modifying-user-name" => Some(("lastModifyingUserName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writers-can-share" => Some(("writersCanShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "owned-by-me" => Some(("ownedByMe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.picture.url" => Some(("sharingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.kind" => Some(("sharingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1354,11 +1356,12 @@ impl<'n, 'a> Engine<'n, 'a> { "image-media-metadata.camera-model" => Some(("imageMediaMetadata.cameraModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-content-link" => Some(("webContentLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "editable" => Some(("editable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "editable" => Some(("editable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "can-comment" => Some(("canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-date" => Some(("createdDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "md5-checksum" => Some(("md5Checksum", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "icon-link" => Some(("iconLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1383,13 +1386,14 @@ impl<'n, 'a> Engine<'n, 'a> { "user-permission.additional-roles" => Some(("userPermission.additionalRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-permission.self-link" => Some(("userPermission.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "shareable" => Some(("shareable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-comment", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1670,6 +1674,7 @@ impl<'n, 'a> Engine<'n, 'a> { "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modifying-user-name" => Some(("lastModifyingUserName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writers-can-share" => Some(("writersCanShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "owned-by-me" => Some(("ownedByMe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.picture.url" => Some(("sharingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.kind" => Some(("sharingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1722,11 +1727,12 @@ impl<'n, 'a> Engine<'n, 'a> { "image-media-metadata.camera-model" => Some(("imageMediaMetadata.cameraModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-content-link" => Some(("webContentLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "editable" => Some(("editable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "editable" => Some(("editable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "can-comment" => Some(("canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-date" => Some(("createdDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "md5-checksum" => Some(("md5Checksum", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "icon-link" => Some(("iconLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1751,13 +1757,14 @@ impl<'n, 'a> Engine<'n, 'a> { "user-permission.additional-roles" => Some(("userPermission.additionalRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-permission.self-link" => Some(("userPermission.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "shareable" => Some(("shareable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-comment", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1954,6 +1961,7 @@ impl<'n, 'a> Engine<'n, 'a> { "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modifying-user-name" => Some(("lastModifyingUserName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writers-can-share" => Some(("writersCanShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "owned-by-me" => Some(("ownedByMe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.picture.url" => Some(("sharingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.kind" => Some(("sharingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2006,11 +2014,12 @@ impl<'n, 'a> Engine<'n, 'a> { "image-media-metadata.camera-model" => Some(("imageMediaMetadata.cameraModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-content-link" => Some(("webContentLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "editable" => Some(("editable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "editable" => Some(("editable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "can-comment" => Some(("canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-date" => Some(("createdDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "md5-checksum" => Some(("md5Checksum", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "icon-link" => Some(("iconLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2035,13 +2044,14 @@ impl<'n, 'a> Engine<'n, 'a> { "user-permission.additional-roles" => Some(("userPermission.additionalRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-permission.self-link" => Some(("userPermission.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "shareable" => Some(("shareable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-comment", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2085,6 +2095,9 @@ impl<'n, 'a> Engine<'n, 'a> { "new-revision" => { call = call.new_revision(arg_from_str(value.unwrap_or("false"), err, "new-revision", "boolean")); }, + "modified-date-behavior" => { + call = call.modified_date_behavior(value.unwrap_or("")); + }, "convert" => { call = call.convert(arg_from_str(value.unwrap_or("false"), err, "convert", "boolean")); }, @@ -2104,7 +2117,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["add-parents", "convert", "ocr", "set-modified-date", "use-content-as-indexable-text", "ocr-language", "new-revision", "pinned", "remove-parents", "update-viewed-date", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); + v.extend(["add-parents", "convert", "ocr", "set-modified-date", "modified-date-behavior", "use-content-as-indexable-text", "ocr-language", "new-revision", "pinned", "remove-parents", "update-viewed-date", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); v } )); } } @@ -2331,6 +2344,7 @@ impl<'n, 'a> Engine<'n, 'a> { "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modifying-user-name" => Some(("lastModifyingUserName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writers-can-share" => Some(("writersCanShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "owned-by-me" => Some(("ownedByMe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.picture.url" => Some(("sharingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.kind" => Some(("sharingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2383,11 +2397,12 @@ impl<'n, 'a> Engine<'n, 'a> { "image-media-metadata.camera-model" => Some(("imageMediaMetadata.cameraModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-content-link" => Some(("webContentLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "editable" => Some(("editable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "editable" => Some(("editable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "can-comment" => Some(("canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-date" => Some(("createdDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "md5-checksum" => Some(("md5Checksum", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "icon-link" => Some(("iconLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2412,13 +2427,14 @@ impl<'n, 'a> Engine<'n, 'a> { "user-permission.additional-roles" => Some(("userPermission.additionalRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-permission.self-link" => Some(("userPermission.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "shareable" => Some(("shareable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-comment", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2462,6 +2478,9 @@ impl<'n, 'a> Engine<'n, 'a> { "new-revision" => { call = call.new_revision(arg_from_str(value.unwrap_or("false"), err, "new-revision", "boolean")); }, + "modified-date-behavior" => { + call = call.modified_date_behavior(value.unwrap_or("")); + }, "convert" => { call = call.convert(arg_from_str(value.unwrap_or("false"), err, "convert", "boolean")); }, @@ -2481,7 +2500,7 @@ impl<'n, 'a> Engine<'n, 'a> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["add-parents", "convert", "ocr", "set-modified-date", "use-content-as-indexable-text", "ocr-language", "new-revision", "pinned", "remove-parents", "update-viewed-date", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); + v.extend(["add-parents", "convert", "ocr", "set-modified-date", "modified-date-behavior", "use-content-as-indexable-text", "ocr-language", "new-revision", "pinned", "remove-parents", "update-viewed-date", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); v } )); } } @@ -6678,7 +6697,7 @@ fn main() { let mut app = App::new("drive2") .author("Sebastian Thiel ") - .version("0.3.1+20150305") + .version("0.3.2+20150709") .about("The API to interact with Drive.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_drive2_cli") .arg(Arg::with_name("url") @@ -6771,7 +6790,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/drive2/Cargo.toml b/gen/drive2/Cargo.toml index 701308db45..ed0e08e921 100644 --- a/gen/drive2/Cargo.toml +++ b/gen/drive2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-drive2" -version = "0.1.8+20150305" +version = "0.1.9+20150709" authors = ["Sebastian Thiel "] description = "A complete library to interact with drive (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/drive2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/drive2/README.md b/gen/drive2/README.md index 85f45fed42..33c75ada88 100644 --- a/gen/drive2/README.md +++ b/gen/drive2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-drive2` library allows access to all features of the *Google drive* service. -This documentation was generated from *drive* crate version *0.1.8+20150305*, where *20150305* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *drive* crate version *0.1.9+20150709*, where *20150709* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *drive* *v2* API can be found at the [official documentation site](https://developers.google.com/drive/). @@ -164,8 +164,9 @@ let result = hub.files().patch(req, "fileId") .ocr_language("takimata") .ocr(false) .new_revision(true) - .convert(false) - .add_parents("labore") + .modified_date_behavior("erat") + .convert(true) + .add_parents("sea") .doit(); match result { diff --git a/gen/drive2/src/cmn.rs b/gen/drive2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/drive2/src/cmn.rs +++ b/gen/drive2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/drive2/src/lib.rs b/gen/drive2/src/lib.rs index d69609f9bd..e29006e1bc 100644 --- a/gen/drive2/src/lib.rs +++ b/gen/drive2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *drive* crate version *0.1.8+20150305*, where *20150305* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *drive* crate version *0.1.9+20150709*, where *20150709* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *drive* *v2* API can be found at the //! [official documentation site](https://developers.google.com/drive/). @@ -155,18 +155,19 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.files().patch(req, "fileId") -//! .use_content_as_indexable_text(false) +//! .use_content_as_indexable_text(true) //! .update_viewed_date(false) -//! .timed_text_track_name("accusam") -//! .timed_text_language("dolores") +//! .timed_text_track_name("aliquyam") +//! .timed_text_language("elitr") //! .set_modified_date(true) -//! .remove_parents("dolor") +//! .remove_parents("et") //! .pinned(false) -//! .ocr_language("elitr") -//! .ocr(true) +//! .ocr_language("sed") +//! .ocr(false) //! .new_revision(true) -//! .convert(false) -//! .add_parents("sed") +//! .modified_date_behavior("dolore") +//! .convert(true) +//! .add_parents("consetetur") //! .doit(); //! //! match result { diff --git a/gen/drive2/src/lib.rs.in b/gen/drive2/src/lib.rs.in index 4533562e4c..074f492185 100644 --- a/gen/drive2/src/lib.rs.in +++ b/gen/drive2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -124,18 +125,19 @@ impl Default for Scope { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().patch(req, "fileId") -/// .use_content_as_indexable_text(false) -/// .update_viewed_date(true) -/// .timed_text_track_name("gubergren") -/// .timed_text_language("sadipscing") -/// .set_modified_date(true) -/// .remove_parents("ea") -/// .pinned(false) +/// .use_content_as_indexable_text(true) +/// .update_viewed_date(false) +/// .timed_text_track_name("sadipscing") +/// .timed_text_language("aliquyam") +/// .set_modified_date(false) +/// .remove_parents("no") +/// .pinned(true) /// .ocr_language("justo") /// .ocr(true) /// .new_revision(true) -/// .convert(true) -/// .add_parents("diam") +/// .modified_date_behavior("diam") +/// .convert(false) +/// .add_parents("Lorem") /// .doit(); /// /// match result { @@ -171,7 +173,7 @@ impl<'a, C, A> Drive Drive { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -216,7 +218,7 @@ impl<'a, C, A> Drive } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -468,7 +470,7 @@ pub struct File { /// Indexable text attributes for the file (can only be written) #[serde(rename="indexableText")] pub indexable_text: Option, - /// Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed. + /// Whether this file has been explicitly trashed, as opposed to recursively trashed. #[serde(rename="explicitlyTrashed")] pub explicitly_trashed: Option, /// ETag of the file. @@ -479,6 +481,9 @@ pub struct File { /// Whether writers can share the document with other users. #[serde(rename="writersCanShare")] pub writers_can_share: Option, + /// Whether the file is owned by the current user. + #[serde(rename="ownedByMe")] + pub owned_by_me: Option, /// Time at which this file was shared with the user (formatted RFC 3339 timestamp). #[serde(rename="sharedWithMeDate")] pub shared_with_me_date: Option, @@ -534,18 +539,21 @@ pub struct File { pub web_content_link: Option, /// Whether the file can be edited by the current user. pub editable: Option, - /// A link for embedding the file. - #[serde(rename="embedLink")] - pub embed_link: Option, /// Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp). #[serde(rename="markedViewedByMeDate")] pub marked_viewed_by_me_date: Option, + /// A link for embedding the file. + #[serde(rename="embedLink")] + pub embed_link: Option, + /// Whether the current user can comment on the file. + #[serde(rename="canComment")] + pub can_comment: Option, /// The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive. #[serde(rename="fileExtension")] pub file_extension: Option, - /// The size of the file in bytes. This is only populated for files with content stored in Drive. - #[serde(rename="fileSize")] - pub file_size: Option, + /// Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set. + #[serde(rename="modifiedDate")] + pub modified_date: Option, /// Create time for this file (formatted RFC 3339 timestamp). #[serde(rename="createdDate")] pub created_date: Option, @@ -569,7 +577,7 @@ pub struct File { /// Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. #[serde(rename="modifiedByMeDate")] pub modified_by_me_date: Option, - /// Short lived download URL for the file. This is only populated for files with content stored in Drive. + /// no description provided #[serde(rename="downloadUrl")] pub download_url: Option, /// The permissions for the authenticated user on this file. @@ -577,6 +585,8 @@ pub struct File { pub user_permission: Option, /// The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'. pub spaces: Option>, + /// Whether the file's sharing settings can be modified by the current user. + pub shareable: Option, /// The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive. #[serde(rename="originalFilename")] pub original_filename: Option, @@ -589,9 +599,9 @@ pub struct File { /// A link back to this file. #[serde(rename="selfLink")] pub self_link: Option, - /// Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set. - #[serde(rename="modifiedDate")] - pub modified_date: Option, + /// The size of the file in bytes. This is only populated for files with content stored in Drive. + #[serde(rename="fileSize")] + pub file_size: Option, } impl RequestValue for File {} @@ -1873,6 +1883,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _ocr_language: Default::default(), _ocr: Default::default(), _new_revision: Default::default(), + _modified_date_behavior: Default::default(), _convert: Default::default(), _add_parents: Default::default(), _delegate: Default::default(), @@ -1921,6 +1932,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _ocr_language: Default::default(), _ocr: Default::default(), _new_revision: Default::default(), + _modified_date_behavior: Default::default(), _convert: Default::default(), _add_parents: Default::default(), _delegate: Default::default(), @@ -3405,10 +3417,10 @@ impl<'a, C, A> RevisionMethods<'a, C, A> { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().watch(req, "fileId") -/// .update_viewed_date(true) -/// .revision_id("et") -/// .projection("duo") -/// .acknowledge_abuse(true) +/// .update_viewed_date(false) +/// .revision_id("aliquyam") +/// .projection("sea") +/// .acknowledge_abuse(false) /// .doit(); /// # } /// ``` @@ -3737,14 +3749,14 @@ impl<'a, C, A> FileWatchCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().insert(req) -/// .visibility("sea") +/// .visibility("eos") /// .use_content_as_indexable_text(false) -/// .timed_text_track_name("eos") -/// .timed_text_language("erat") -/// .pinned(false) -/// .ocr_language("dolor") -/// .ocr(true) -/// .convert(true) +/// .timed_text_track_name("sadipscing") +/// .timed_text_language("dolor") +/// .pinned(true) +/// .ocr_language("elitr") +/// .ocr(false) +/// .convert(false) /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -4416,13 +4428,13 @@ impl<'a, C, A> FileUntrashCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().copy(req, "fileId") -/// .visibility("labore") -/// .timed_text_track_name("eirmod") -/// .timed_text_language("dolore") -/// .pinned(true) -/// .ocr_language("aliquyam") -/// .ocr(false) -/// .convert(false) +/// .visibility("dolore") +/// .timed_text_track_name("invidunt") +/// .timed_text_language("aliquyam") +/// .pinned(false) +/// .ocr_language("Lorem") +/// .ocr(true) +/// .convert(true) /// .doit(); /// # } /// ``` @@ -5190,10 +5202,10 @@ impl<'a, C, A> FileEmptyTrashCall<'a, C, A> where C: BorrowMut, A /// // Values shown here are possibly random and not representative ! /// let result = hub.files().list() /// .spaces("et") -/// .q("duo") -/// .projection("et") -/// .page_token("eirmod") -/// .max_results(-58) +/// .q("eirmod") +/// .projection("sanctus") +/// .page_token("et") +/// .max_results(-46) /// .corpus("et") /// .doit(); /// # } @@ -5708,17 +5720,18 @@ impl<'a, C, A> FileTouchCall<'a, C, A> where C: BorrowMut, A: oau /// // Values shown here are possibly random and not representative ! /// let result = hub.files().update(req, "fileId") /// .use_content_as_indexable_text(true) -/// .update_viewed_date(true) -/// .timed_text_track_name("ea") -/// .timed_text_language("sed") +/// .update_viewed_date(false) +/// .timed_text_track_name("dolor") +/// .timed_text_language("dolor") /// .set_modified_date(true) -/// .remove_parents("dolor") -/// .pinned(true) -/// .ocr_language("et") -/// .ocr(false) +/// .remove_parents("et") +/// .pinned(false) +/// .ocr_language("amet.") +/// .ocr(true) /// .new_revision(false) +/// .modified_date_behavior("gubergren") /// .convert(true) -/// .add_parents("Lorem") +/// .add_parents("sit") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -5738,6 +5751,7 @@ pub struct FileUpdateCall<'a, C, A> _ocr_language: Option, _ocr: Option, _new_revision: Option, + _modified_date_behavior: Option, _convert: Option, _add_parents: Option, _delegate: Option<&'a mut Delegate>, @@ -5762,7 +5776,7 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "drive.files.update", http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((16 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((17 + self._additional_params.len())); params.push(("fileId", self._file_id.to_string())); if let Some(value) = self._use_content_as_indexable_text { params.push(("useContentAsIndexableText", value.to_string())); @@ -5794,13 +5808,16 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._new_revision { params.push(("newRevision", value.to_string())); } + if let Some(value) = self._modified_date_behavior { + params.push(("modifiedDateBehavior", value.to_string())); + } if let Some(value) = self._convert { params.push(("convert", value.to_string())); } if let Some(value) = self._add_parents { params.push(("addParents", value.to_string())); } - for &field in ["alt", "fileId", "useContentAsIndexableText", "updateViewedDate", "timedTextTrackName", "timedTextLanguage", "setModifiedDate", "removeParents", "pinned", "ocrLanguage", "ocr", "newRevision", "convert", "addParents"].iter() { + for &field in ["alt", "fileId", "useContentAsIndexableText", "updateViewedDate", "timedTextTrackName", "timedTextLanguage", "setModifiedDate", "removeParents", "pinned", "ocrLanguage", "ocr", "newRevision", "modifiedDateBehavior", "convert", "addParents"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6132,6 +6149,13 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa self._new_revision = Some(new_value); self } + /// How the modifiedDate field should be updated. This overrides setModifiedDate. + /// + /// Sets the *modified date behavior* query property to the given value. + pub fn modified_date_behavior(mut self, new_value: &str) -> FileUpdateCall<'a, C, A> { + self._modified_date_behavior = Some(new_value.to_string()); + self + } /// Whether to convert this file to the corresponding Google Docs format. /// /// Sets the *convert* query property to the given value. @@ -6458,16 +6482,17 @@ impl<'a, C, A> FileDeleteCall<'a, C, A> where C: BorrowMut, A: oa /// let result = hub.files().patch(req, "fileId") /// .use_content_as_indexable_text(false) /// .update_viewed_date(true) -/// .timed_text_track_name("diam") -/// .timed_text_language("rebum.") -/// .set_modified_date(true) -/// .remove_parents("sadipscing") +/// .timed_text_track_name("sadipscing") +/// .timed_text_language("vero") +/// .set_modified_date(false) +/// .remove_parents("invidunt") /// .pinned(false) -/// .ocr_language("sadipscing") -/// .ocr(false) +/// .ocr_language("dolore") +/// .ocr(true) /// .new_revision(false) -/// .convert(false) -/// .add_parents("duo") +/// .modified_date_behavior("Lorem") +/// .convert(true) +/// .add_parents("clita") /// .doit(); /// # } /// ``` @@ -6487,6 +6512,7 @@ pub struct FilePatchCall<'a, C, A> _ocr_language: Option, _ocr: Option, _new_revision: Option, + _modified_date_behavior: Option, _convert: Option, _add_parents: Option, _delegate: Option<&'a mut Delegate>, @@ -6510,7 +6536,7 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau }; dlg.begin(MethodInfo { id: "drive.files.patch", http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((16 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((17 + self._additional_params.len())); params.push(("fileId", self._file_id.to_string())); if let Some(value) = self._use_content_as_indexable_text { params.push(("useContentAsIndexableText", value.to_string())); @@ -6542,13 +6568,16 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau if let Some(value) = self._new_revision { params.push(("newRevision", value.to_string())); } + if let Some(value) = self._modified_date_behavior { + params.push(("modifiedDateBehavior", value.to_string())); + } if let Some(value) = self._convert { params.push(("convert", value.to_string())); } if let Some(value) = self._add_parents { params.push(("addParents", value.to_string())); } - for &field in ["alt", "fileId", "useContentAsIndexableText", "updateViewedDate", "timedTextTrackName", "timedTextLanguage", "setModifiedDate", "removeParents", "pinned", "ocrLanguage", "ocr", "newRevision", "convert", "addParents"].iter() { + for &field in ["alt", "fileId", "useContentAsIndexableText", "updateViewedDate", "timedTextTrackName", "timedTextLanguage", "setModifiedDate", "removeParents", "pinned", "ocrLanguage", "ocr", "newRevision", "modifiedDateBehavior", "convert", "addParents"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6768,6 +6797,13 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau self._new_revision = Some(new_value); self } + /// How the modifiedDate field should be updated. This overrides setModifiedDate. + /// + /// Sets the *modified date behavior* query property to the given value. + pub fn modified_date_behavior(mut self, new_value: &str) -> FilePatchCall<'a, C, A> { + self._modified_date_behavior = Some(new_value.to_string()); + self + } /// Whether to convert this file to the corresponding Google Docs format. /// /// Sets the *convert* query property to the given value. @@ -6866,9 +6902,9 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().get("fileId") -/// .update_viewed_date(true) -/// .revision_id("et") -/// .projection("clita") +/// .update_viewed_date(false) +/// .revision_id("nonumy") +/// .projection("kasd") /// .acknowledge_abuse(true) /// .doit(); /// # } @@ -7167,8 +7203,8 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth /// // Values shown here are possibly random and not representative ! /// let result = hub.about().get() /// .start_change_id("takimata") -/// .max_change_id_count(-40) -/// .include_subscribed(true) +/// .max_change_id_count(-27) +/// .include_subscribed(false) /// .doit(); /// # } /// ``` @@ -7406,7 +7442,7 @@ impl<'a, C, A> AboutGetCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.realtime().update("fileId") -/// .base_revision("takimata") +/// .base_revision("ea") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -7754,7 +7790,7 @@ impl<'a, C, A> RealtimeUpdateCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.realtime().get("fileId") -/// .revision(-86) +/// .revision(-66) /// .doit(); /// # } /// ``` @@ -8227,9 +8263,9 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.apps().list() -/// .language_code("ea") -/// .app_filter_mime_types("sadipscing") -/// .app_filter_extensions("rebum.") +/// .language_code("nonumy") +/// .app_filter_mime_types("sed") +/// .app_filter_extensions("aliquyam") /// .doit(); /// # } /// ``` @@ -8703,7 +8739,7 @@ impl<'a, C, A> CommentDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().get("fileId", "commentId") -/// .include_deleted(false) +/// .include_deleted(true) /// .doit(); /// # } /// ``` @@ -9788,9 +9824,9 @@ impl<'a, C, A> CommentUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().list("fileId") -/// .updated_min("aliquyam") -/// .page_token("eos") -/// .max_results(-38) +/// .updated_min("labore") +/// .page_token("ipsum") +/// .max_results(-31) /// .include_deleted(false) /// .doit(); /// # } @@ -10072,9 +10108,9 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.children().list("folderId") -/// .q("ipsum") -/// .page_token("aliquyam") -/// .max_results(-69) +/// .q("diam") +/// .page_token("ut") +/// .max_results(-70) /// .doit(); /// # } /// ``` @@ -12598,8 +12634,8 @@ impl<'a, C, A> ReplyPatchCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.replies().list("fileId", "commentId") -/// .page_token("voluptua.") -/// .max_results(-19) +/// .page_token("ea") +/// .max_results(-17) /// .include_deleted(false) /// .doit(); /// # } @@ -14217,7 +14253,7 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().insert(req, "fileId") /// .send_notification_emails(true) -/// .email_message("sed") +/// .email_message("nonumy") /// .doit(); /// # } /// ``` @@ -15809,12 +15845,12 @@ impl<'a, C, A> PermissionGetIdForEmailCall<'a, C, A> where C: BorrowMut ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.changes().list() -/// .start_change_id("eirmod") -/// .spaces("sanctus") -/// .page_token("voluptua.") -/// .max_results(-99) +/// .start_change_id("et") +/// .spaces("et") +/// .page_token("vero") +/// .max_results(-36) /// .include_subscribed(true) -/// .include_deleted(false) +/// .include_deleted(true) /// .doit(); /// # } /// ``` @@ -16626,7 +16662,7 @@ impl<'a, C, A> ChangeGetCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().patch(req, "fileId", "propertyKey") -/// .visibility("et") +/// .visibility("vero") /// .doit(); /// # } /// ``` @@ -16911,7 +16947,7 @@ impl<'a, C, A> PropertyPatchCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().delete("fileId", "propertyKey") -/// .visibility("dolore") +/// .visibility("et") /// .doit(); /// # } /// ``` @@ -17669,7 +17705,7 @@ impl<'a, C, A> PropertyListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().update(req, "fileId", "propertyKey") -/// .visibility("nonumy") +/// .visibility("invidunt") /// .doit(); /// # } /// ``` @@ -17954,7 +17990,7 @@ impl<'a, C, A> PropertyUpdateCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().get("fileId", "propertyKey") -/// .visibility("no") +/// .visibility("aliquyam") /// .doit(); /// # } /// ``` diff --git a/gen/fitness1-cli/Cargo.toml b/gen/fitness1-cli/Cargo.toml index 0741d84bbe..2ba25eb8b1 100644 --- a/gen/fitness1-cli/Cargo.toml +++ b/gen/fitness1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-fitness1-cli" -version = "0.3.1+20150527" +version = "0.3.2+20150720" authors = ["Sebastian Thiel "] description = "A complete library to interact with fitness (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fitness1-cli" @@ -17,9 +17,10 @@ keywords = ["fitness", "google", "cli"] name = "fitness1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/fitness1-cli/README.md b/gen/fitness1-cli/README.md index 81bab41144..a3234950ba 100644 --- a/gen/fitness1-cli/README.md +++ b/gen/fitness1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *fitness* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/fitness1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/fitness1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/fitness1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/fitness1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/fitness1-cli). # Usage -This documentation was generated from the *fitness* API at revision *20150527*. The CLI is at version *0.3.1*. +This documentation was generated from the *fitness* API at revision *20150720*. The CLI is at version *0.3.2*. ```bash fitness1 [options] diff --git a/gen/fitness1-cli/mkdocs.yml b/gen/fitness1-cli/mkdocs.yml index f0981f1eb2..5b8c1674f9 100644 --- a/gen/fitness1-cli/mkdocs.yml +++ b/gen/fitness1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: fitness v0.3.1+20150527 +site_name: fitness v0.3.2+20150720 site_url: http://byron.github.io/google-apis-rs/google-fitness1-cli site_description: Write integrating applications with bcore diff --git a/gen/fitness1-cli/src/cmn.rs b/gen/fitness1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/fitness1-cli/src/cmn.rs +++ b/gen/fitness1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/fitness1-cli/src/main.rs b/gen/fitness1-cli/src/main.rs index d9a2da5e23..83e7c901d6 100644 --- a/gen/fitness1-cli/src/main.rs +++ b/gen/fitness1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -769,6 +770,9 @@ impl<'n, 'a> Engine<'n, 'a> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), @@ -1418,12 +1422,12 @@ fn main() { Some(false)), ]), ("dataset-aggregate", - None, + Some(r##"Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple sources can be aggreated into exactly one bucket type per request."##), "Details at http://byron.github.io/google-apis-rs/google_fitness1_cli/users_dataset-aggregate", vec![ (Some(r##"user-id"##), None, - None, + Some(r##"Aggregate data for the person identified. Use me to indicate the authenticated user. Only me is supported at this time."##), Some(true), Some(false)), @@ -1529,7 +1533,7 @@ fn main() { let mut app = App::new("fitness1") .author("Sebastian Thiel ") - .version("0.3.1+20150527") + .version("0.3.2+20150720") .about("Google Fit API") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_fitness1_cli") .arg(Arg::with_name("url") @@ -1611,7 +1615,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/fitness1/Cargo.toml b/gen/fitness1/Cargo.toml index 1033f18b1b..57f95210a6 100644 --- a/gen/fitness1/Cargo.toml +++ b/gen/fitness1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-fitness1" -version = "0.1.8+20150527" +version = "0.1.9+20150720" authors = ["Sebastian Thiel "] description = "A complete library to interact with fitness (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fitness1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/fitness1/README.md b/gen/fitness1/README.md index 2555ab9fae..227af2e7bf 100644 --- a/gen/fitness1/README.md +++ b/gen/fitness1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-fitness1` library allows access to all features of the *Google fitness* service. -This documentation was generated from *fitness* crate version *0.1.8+20150527*, where *20150527* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *fitness* crate version *0.1.9+20150720*, where *20150720* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *fitness* *v1* API can be found at the [official documentation site](https://developers.google.com/fit/rest/). diff --git a/gen/fitness1/src/cmn.rs b/gen/fitness1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/fitness1/src/cmn.rs +++ b/gen/fitness1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/fitness1/src/lib.rs b/gen/fitness1/src/lib.rs index a3864a1abf..0e2f0a3c4e 100644 --- a/gen/fitness1/src/lib.rs +++ b/gen/fitness1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *fitness* crate version *0.1.8+20150527*, where *20150527* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *fitness* crate version *0.1.9+20150720*, where *20150720* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *fitness* *v1* API can be found at the //! [official documentation site](https://developers.google.com/fit/rest/). diff --git a/gen/fitness1/src/lib.rs.in b/gen/fitness1/src/lib.rs.in index acb709f89a..1da64109f2 100644 --- a/gen/fitness1/src/lib.rs.in +++ b/gen/fitness1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -151,7 +152,7 @@ impl<'a, C, A> Fitness Fitness { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -160,7 +161,7 @@ impl<'a, C, A> Fitness } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -174,24 +175,18 @@ impl<'a, C, A> Fitness // ############ // SCHEMAS ### // ########## -/// There is no detailed description. +/// The specification of which data to aggregate. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AggregateBy { - /// no description provided - #[serde(rename="outputDataTypeName")] - pub output_data_type_name: Option, - /// no description provided + /// A data source ID to aggregate. Mutually exclusive of dataTypeName. Only data from the specified data source ID will be included in the aggregation. The dataset in the response will have the same data source ID. #[serde(rename="dataSourceId")] pub data_source_id: Option, - /// by dataype or by datasource + /// The data type to aggregate. All data sources providing this data type will contribute data to the aggregation. The response will contain a single dataset for this data type name. The dataset will have a data source ID of derived:com.google.:com.google.android.gms:aggregated #[serde(rename="dataTypeName")] pub data_type_name: Option, - /// no description provided - #[serde(rename="outputDataSourceId")] - pub output_data_source_id: Option, } impl Part for AggregateBy {} @@ -199,26 +194,42 @@ impl Part for AggregateBy {} /// There is no detailed description. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [sessions list users](struct.UserSessionListCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListSessionsResponse { - /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// If includeDeleted is set to true in the request, this list will contain sessions deleted with original end times that are within the startTime and endTime frame. - #[serde(rename="deletedSession")] - pub deleted_session: Option>, - /// Sessions with an end time that is between startTime and endTime of the request. - pub session: Option>, +pub struct ValueMapValEntry { + /// no description provided + pub key: Option, + /// no description provided + pub value: Option, } -impl ResponseResult for ListSessionsResponse {} +impl Part for ValueMapValEntry {} + + +/// Holder object for the value of a single field in a data point. +/// +/// A field value has a particular format and is only ever set to one of an integer or a floating point value. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Value { + /// Map value. The valid key space and units for the corresponding value of each entry should be documented as part of the data type definition. Keys should be kept small whenever possible. Data streams with large keys and high data frequency may be down sampled. + #[serde(rename="mapVal")] + pub map_val: Option>, + /// Floating point value. When this is set, other values must not be set. + #[serde(rename="fpVal")] + pub fp_val: Option, + /// Integer value. When this is set, other values must not be set. + #[serde(rename="intVal")] + pub int_val: Option, + /// String value. When this is set, other values must not be set. Strings should be kept small whenever possible. Data streams with large string values and high data frequency may be down sampled. + #[serde(rename="stringVal")] + pub string_val: Option, +} + +impl Part for Value {} /// There is no detailed description. @@ -301,23 +312,28 @@ pub struct DataPoint { impl Part for DataPoint {} -/// Holder object for the value of a single field in a data point. +/// There is no detailed description. /// -/// A field value has a particular format and is only ever set to one of an integer or a floating point value. +/// # Activities /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [sessions list users](struct.UserSessionListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Value { - /// Floating point value. When this is set, intVal must not be set. - #[serde(rename="fpVal")] - pub fp_val: Option, - /// Integer value. When this is set, fpVal must not be set. - #[serde(rename="intVal")] - pub int_val: Option, +pub struct ListSessionsResponse { + /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// If includeDeleted is set to true in the request, this list will contain sessions deleted with original end times that are within the startTime and endTime frame. + #[serde(rename="deletedSession")] + pub deleted_session: Option>, + /// Sessions with an end time that is between startTime and endTime of the request. + pub session: Option>, } -impl Part for Value {} +impl ResponseResult for ListSessionsResponse {} /// There is no detailed description. @@ -326,20 +342,20 @@ impl Part for Value {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AggregateBucket { - /// available for Bucket.Type.SESSION + /// Available for Bucket.Type.SESSION pub session: Option, - /// no description provided + /// The end time for the aggregated data, in milliseconds since epoch, inclusive. #[serde(rename="endTimeMillis")] pub end_time_millis: Option, - /// available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT + /// Available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT pub activity: Option, - /// no description provided + /// The start time for the aggregated data, in milliseconds since epoch, inclusive. #[serde(rename="startTimeMillis")] pub start_time_millis: Option, /// The type of a bucket signifies how the data aggregation is performed in the bucket. #[serde(rename="type")] pub type_: Option, - /// There will be one dataset per datatype/datasource + /// There will be one dataset per AggregateBy in the request. pub dataset: Option>, } @@ -352,10 +368,10 @@ impl Part for AggregateBucket {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BucketByActivity { - /// default activity stream will be used if not specified + /// The default activity stream will be used if a specific activityDataSourceId is not specified. #[serde(rename="activityDataSourceId")] pub activity_data_source_id: Option, - /// Only activity segments of duration longer than this is used + /// Specifies that only activity segments of duration longer than minDurationMillis are considered and used as a container for aggregated data. #[serde(rename="minDurationMillis")] pub min_duration_millis: Option, } @@ -374,25 +390,25 @@ impl Part for BucketByActivity {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AggregateRequest { - /// no description provided + /// The specification of data to be aggregated. At least one aggregateBy spec must be provided. All data that is specified will be aggregated using the same bucketing criteria. There will be one dataset in the response for every aggregateBy spec. #[serde(rename="aggregateBy")] pub aggregate_by: Option>, - /// no description provided + /// Specifies that data be aggregated each activity segment recored for a user. Similar to bucketByActivitySegment, but bucketing is done for each activity segment rather than all segments of the same type. Mutually exclusive of other bucketing specifications. #[serde(rename="bucketByActivitySegment")] pub bucket_by_activity_segment: Option, - /// no description provided + /// The end of a window of time. Data that intersects with this time window will be aggregated. The time is in milliseconds since epoch, inclusive. #[serde(rename="endTimeMillis")] pub end_time_millis: Option, - /// no description provided + /// Specifies that data be aggregated by user sessions. Data that does not fall within the time range of a session will not be included in the response. Mutually exclusive of other bucketing specifications. #[serde(rename="bucketBySession")] pub bucket_by_session: Option, - /// no description provided + /// Specifies that data be aggregated by the type of activity being performed when the data was recorded. All data that was recorded during a certain activity type (for the given time range) will be aggregated into the same bucket. Data that was recorded while the user was not active will not be included in the response. Mutually exclusive of other bucketing specifications. #[serde(rename="bucketByActivityType")] pub bucket_by_activity_type: Option, - /// required time range + /// The start of a window of time. Data that intersects with this time window will be aggregated. The time is in milliseconds since epoch, inclusive. #[serde(rename="startTimeMillis")] pub start_time_millis: Option, - /// apparently oneof is not supported by reduced_nano_proto + /// Specifies that data be aggregated by a single time interval. Mutually exclusive of other bucketing specifications. #[serde(rename="bucketByTime")] pub bucket_by_time: Option, } @@ -458,7 +474,7 @@ impl ResponseResult for Dataset {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AggregateResponse { - /// no description provided + /// A list of buckets containing the aggregated data. pub bucket: Option>, } @@ -511,7 +527,7 @@ impl ResponseResult for Session {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BucketBySession { - /// Only sessions of duration longer than this is used + /// Specifies that only sessions of duration longer than minDurationMillis are considered and used as a container for aggregated data. #[serde(rename="minDurationMillis")] pub min_duration_millis: Option, } @@ -519,6 +535,83 @@ pub struct BucketBySession { impl Part for BucketBySession {} +/// Holder object for the value of an entry in a map field of a data point. +/// +/// A map value supports a subset of the formats that the regular Value supports. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MapValue { + /// Floating point value. + #[serde(rename="fpVal")] + pub fp_val: Option, +} + +impl Part for MapValue {} + + +/// Representation of an integrated device (such as a phone or a wearable) that can hold sensors. Each sensor is exposed as a data source. +/// +/// The main purpose of the device information contained in this class is to identify the hardware of a particular data source. This can be useful in different ways, including: +/// - Distinguishing two similar sensors on different devices (the step counter on two nexus 5 phones, for instance) +/// - Display the source of data to the user (by using the device make / model) +/// - Treat data differently depending on sensor type (accelerometers on a watch may give different patterns than those on a phone) +/// - Build different analysis models for each device/version. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Device { + /// End-user visible model name for the device. + pub model: Option, + /// Version string for the device hardware/software. + pub version: Option, + /// A constant representing the type of the device. + #[serde(rename="type")] + pub type_: Option, + /// The serial number or other unique ID for the hardware. This field is obfuscated when read by any REST or Android client that did not create the data source. Only the data source creator will see the uid field in clear and normal form. + pub uid: Option, + /// Manufacturer of the product/hardware. + pub manufacturer: Option, +} + +impl Part for Device {} + + +/// In case of multi-dimensional data (such as an accelerometer with x, y, and z axes) each field represents one dimension. Each data type field has a unique name which identifies it. The field also defines the format of the data (int, float, etc.). +/// +/// This message is only instantiated in code and not used for wire comms or stored in any way. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DataTypeField { + /// no description provided + pub optional: Option, + /// Defines the name and format of data. Unlike data type names, field names are not namespaced, and only need to be unique within the data type. + pub name: Option, + /// The different supported formats for each field in a data type. + pub format: Option, +} + +impl Part for DataTypeField {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BucketByTime { + /// Specifies that result buckets aggregate data by exactly durationMillis time frames. Time frames that contain no data will be included in the response with an empty dataset. + #[serde(rename="durationMillis")] + pub duration_millis: Option, +} + +impl Part for BucketByTime {} + + /// Definition of a unique source of sensor data. Data sources can expose raw data coming from hardware sensors on local or companion devices. They can also expose derived data, created by transforming or merging other data sources. Multiple data sources can exist for the same data type. Every data point inserted into or read from this service has an associated data source. /// /// The data source contains enough information to uniquely identify its data, including the hardware device and the application that collected and/or transformed the data. It also holds useful metadata, such as the hardware and application versions, and the device type. @@ -576,67 +669,6 @@ impl RequestValue for DataSource {} impl ResponseResult for DataSource {} -/// Representation of an integrated device (such as a phone or a wearable) that can hold sensors. Each sensor is exposed as a data source. -/// -/// The main purpose of the device information contained in this class is to identify the hardware of a particular data source. This can be useful in different ways, including: -/// - Distinguishing two similar sensors on different devices (the step counter on two nexus 5 phones, for instance) -/// - Display the source of data to the user (by using the device make / model) -/// - Treat data differently depending on sensor type (accelerometers on a watch may give different patterns than those on a phone) -/// - Build different analysis models for each device/version. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Device { - /// End-user visible model name for the device. - pub model: Option, - /// Version string for the device hardware/software. - pub version: Option, - /// A constant representing the type of the device. - #[serde(rename="type")] - pub type_: Option, - /// The serial number or other unique ID for the hardware. This field is obfuscated when read by any REST or Android client that did not create the data source. Only the data source creator will see the uid field in clear and normal form. - pub uid: Option, - /// Manufacturer of the product/hardware. - pub manufacturer: Option, -} - -impl Part for Device {} - - -/// In case of multi-dimensional data (such as an accelerometer with x, y, and z axes) each field represents one dimension. Each data type field has a unique name which identifies it. The field also defines the format of the data (int, float, etc.). -/// -/// This message is only instantiated in code and not used for wire comms or stored in any way. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DataTypeField { - /// no description provided - pub optional: Option, - /// Defines the name and format of data. Unlike data type names, field names are not namespaced, and only need to be unique within the data type. - pub name: Option, - /// The different supported formats for each field in a data type. - pub format: Option, -} - -impl Part for DataTypeField {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BucketByTime { - /// no description provided - #[serde(rename="durationMillis")] - pub duration_millis: Option, -} - -impl Part for BucketByTime {} - - // ################### // MethodBuilders ### @@ -680,17 +712,21 @@ impl<'a, C, A> MethodsBuilder for UserMethods<'a, C, A> {} impl<'a, C, A> UserMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple sources can be aggreated into exactly one bucket type per request. /// /// # Arguments /// /// * `request` - No description provided. - /// * `userId` - No description provided. + /// * `userId` - Aggregate data for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. pub fn dataset_aggregate(&self, request: AggregateRequest, user_id: &str) -> UserDatasetAggregateCall<'a, C, A> { UserDatasetAggregateCall { hub: self.hub, _request: request, _user_id: user_id.to_string(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -958,6 +994,8 @@ impl<'a, C, A> UserMethods<'a, C, A> { // CallBuilders ### // ################# +/// Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple sources can be aggreated into exactly one bucket type per request. +/// /// A builder for the *dataset.aggregate* method supported by a *user* resource. /// It is not used directly, but through a `UserMethods` instance. /// @@ -1000,6 +1038,7 @@ pub struct UserDatasetAggregateCall<'a, C, A> _user_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for UserDatasetAggregateCall<'a, C, A> {} @@ -1033,17 +1072,8 @@ impl<'a, C, A> UserDatasetAggregateCall<'a, C, A> where C: BorrowMut params.push(("key", value)), - None => { - dlg.finished(false); - return Err(Error::MissingAPIKey) - } + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ActivityWrite.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{userId}", "userId")].iter() { @@ -1087,11 +1117,26 @@ impl<'a, C, A> UserDatasetAggregateCall<'a, C, A> where C: BorrowMut token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) .header(ContentLength(request_size as u64)) .body(&mut request_value_reader); @@ -1154,6 +1199,7 @@ impl<'a, C, A> UserDatasetAggregateCall<'a, C, A> where C: BorrowMut UserDatasetAggregateCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> UserDatasetAggregateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } } diff --git a/gen/freebase1-cli/Cargo.toml b/gen/freebase1-cli/Cargo.toml index c4f30f6820..03cabc6361 100644 --- a/gen/freebase1-cli/Cargo.toml +++ b/gen/freebase1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-freebase1-cli" -version = "0.3.1+20150330" +version = "0.3.2+20150715" authors = ["Sebastian Thiel "] description = "A complete library to interact with freebase (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/freebase1-cli" @@ -17,9 +17,10 @@ keywords = ["freebase", "google", "cli"] name = "freebase1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/freebase1-cli/README.md b/gen/freebase1-cli/README.md index 9a57554c0a..81cb7dcf52 100644 --- a/gen/freebase1-cli/README.md +++ b/gen/freebase1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *freebase* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/freebase1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/freebase1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/freebase1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/freebase1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/freebase1-cli). # Usage -This documentation was generated from the *freebase* API at revision *20150330*. The CLI is at version *0.3.1*. +This documentation was generated from the *freebase* API at revision *20150715*. The CLI is at version *0.3.2*. ```bash freebase1 [options] diff --git a/gen/freebase1-cli/mkdocs.yml b/gen/freebase1-cli/mkdocs.yml index c589c797eb..e605e20f82 100644 --- a/gen/freebase1-cli/mkdocs.yml +++ b/gen/freebase1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: freebase v0.3.1+20150330 +site_name: freebase v0.3.2+20150715 site_url: http://byron.github.io/google-apis-rs/google-freebase1-cli site_description: Write integrating applications with bcore diff --git a/gen/freebase1-cli/src/cmn.rs b/gen/freebase1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/freebase1-cli/src/cmn.rs +++ b/gen/freebase1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/freebase1-cli/src/main.rs b/gen/freebase1-cli/src/main.rs index e95875d74d..480a5ffeff 100644 --- a/gen/freebase1-cli/src/main.rs +++ b/gen/freebase1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -376,7 +377,7 @@ fn main() { let mut app = App::new("freebase1") .author("Sebastian Thiel ") - .version("0.3.1+20150330") + .version("0.3.2+20150715") .about("Find Freebase entities using textual queries and other constraints.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_freebase1_cli") .arg(Arg::with_name("folder") @@ -453,7 +454,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/freebase1/Cargo.toml b/gen/freebase1/Cargo.toml index 00157bee9c..d7966faa60 100644 --- a/gen/freebase1/Cargo.toml +++ b/gen/freebase1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-freebase1" -version = "0.1.8+20150330" +version = "0.1.9+20150715" authors = ["Sebastian Thiel "] description = "A complete library to interact with freebase (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/freebase1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/freebase1/README.md b/gen/freebase1/README.md index 82c8a307b3..9b10fb01fd 100644 --- a/gen/freebase1/README.md +++ b/gen/freebase1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-freebase1` library allows access to all features of the *Google freebase* service. -This documentation was generated from *freebase* crate version *0.1.8+20150330*, where *20150330* is the exact revision of the *freebase:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *freebase* crate version *0.1.9+20150715*, where *20150715* is the exact revision of the *freebase:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *freebase* *v1* API can be found at the [official documentation site](https://developers.google.com/freebase/). diff --git a/gen/freebase1/src/cmn.rs b/gen/freebase1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/freebase1/src/cmn.rs +++ b/gen/freebase1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/freebase1/src/lib.rs b/gen/freebase1/src/lib.rs index d04a001a30..06c23be498 100644 --- a/gen/freebase1/src/lib.rs +++ b/gen/freebase1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *freebase* crate version *0.1.8+20150330*, where *20150330* is the exact revision of the *freebase:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *freebase* crate version *0.1.9+20150715*, where *20150715* is the exact revision of the *freebase:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *freebase* *v1* API can be found at the //! [official documentation site](https://developers.google.com/freebase/). diff --git a/gen/freebase1/src/lib.rs.in b/gen/freebase1/src/lib.rs.in index f24fc5100c..555bbad601 100644 --- a/gen/freebase1/src/lib.rs.in +++ b/gen/freebase1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -109,7 +110,7 @@ impl<'a, C, A> Freebase Freebase { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -118,7 +119,7 @@ impl<'a, C, A> Freebase } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/freebase1_sandbox-cli/Cargo.toml b/gen/freebase1_sandbox-cli/Cargo.toml index a8115daebf..e96f38d24a 100644 --- a/gen/freebase1_sandbox-cli/Cargo.toml +++ b/gen/freebase1_sandbox-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-freebase1_sandbox-cli" -version = "0.3.1+20150330" +version = "0.3.2+20150715" authors = ["Sebastian Thiel "] description = "A complete library to interact with freebase (protocol v1sandbox)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/freebase1_sandbox-cli" @@ -17,9 +17,10 @@ keywords = ["freebase", "google", "cli"] name = "freebase1-sandbox" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/freebase1_sandbox-cli/README.md b/gen/freebase1_sandbox-cli/README.md index e30f9aec11..ba81c25c27 100644 --- a/gen/freebase1_sandbox-cli/README.md +++ b/gen/freebase1_sandbox-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *freebase* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/freebase1-sandbox.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/freebase1-sandbox.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/freebase1-sandbox.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/freebase1-sandbox.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/freebase1_sandbox-cli). # Usage -This documentation was generated from the *freebase* API at revision *20150330*. The CLI is at version *0.3.1*. +This documentation was generated from the *freebase* API at revision *20150715*. The CLI is at version *0.3.2*. ```bash freebase1-sandbox [options] diff --git a/gen/freebase1_sandbox-cli/mkdocs.yml b/gen/freebase1_sandbox-cli/mkdocs.yml index 4925deba01..b5dd72c756 100644 --- a/gen/freebase1_sandbox-cli/mkdocs.yml +++ b/gen/freebase1_sandbox-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: freebase v0.3.1+20150330 +site_name: freebase v0.3.2+20150715 site_url: http://byron.github.io/google-apis-rs/google-freebase1_sandbox-cli site_description: Write integrating applications with bcore diff --git a/gen/freebase1_sandbox-cli/src/cmn.rs b/gen/freebase1_sandbox-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/freebase1_sandbox-cli/src/cmn.rs +++ b/gen/freebase1_sandbox-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/freebase1_sandbox-cli/src/main.rs b/gen/freebase1_sandbox-cli/src/main.rs index 49ecbb92e3..e1bddde1a3 100644 --- a/gen/freebase1_sandbox-cli/src/main.rs +++ b/gen/freebase1_sandbox-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -376,7 +377,7 @@ fn main() { let mut app = App::new("freebase1-sandbox") .author("Sebastian Thiel ") - .version("0.3.1+20150330") + .version("0.3.2+20150715") .about("Find Freebase entities using textual queries and other constraints.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_freebase1_sandbox_cli") .arg(Arg::with_name("folder") @@ -453,7 +454,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/freebase1_sandbox/Cargo.toml b/gen/freebase1_sandbox/Cargo.toml index 3ccf942d36..66e6c3c076 100644 --- a/gen/freebase1_sandbox/Cargo.toml +++ b/gen/freebase1_sandbox/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-freebase1_sandbox" -version = "0.1.8+20150330" +version = "0.1.9+20150715" authors = ["Sebastian Thiel "] description = "A complete library to interact with freebase (protocol v1sandbox)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/freebase1_sandbox" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/freebase1_sandbox/README.md b/gen/freebase1_sandbox/README.md index ce5ae65216..0dee08134b 100644 --- a/gen/freebase1_sandbox/README.md +++ b/gen/freebase1_sandbox/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-freebase1_sandbox` library allows access to all features of the *Google freebase* service. -This documentation was generated from *freebase* crate version *0.1.8+20150330*, where *20150330* is the exact revision of the *freebase:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *freebase* crate version *0.1.9+20150715*, where *20150715* is the exact revision of the *freebase:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *freebase* *v1_sandbox* API can be found at the [official documentation site](https://developers.google.com/freebase/). diff --git a/gen/freebase1_sandbox/src/cmn.rs b/gen/freebase1_sandbox/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/freebase1_sandbox/src/cmn.rs +++ b/gen/freebase1_sandbox/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/freebase1_sandbox/src/lib.rs b/gen/freebase1_sandbox/src/lib.rs index 496dfa6a02..dbbd3435eb 100644 --- a/gen/freebase1_sandbox/src/lib.rs +++ b/gen/freebase1_sandbox/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *freebase* crate version *0.1.8+20150330*, where *20150330* is the exact revision of the *freebase:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *freebase* crate version *0.1.9+20150715*, where *20150715* is the exact revision of the *freebase:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *freebase* *v1_sandbox* API can be found at the //! [official documentation site](https://developers.google.com/freebase/). diff --git a/gen/freebase1_sandbox/src/lib.rs.in b/gen/freebase1_sandbox/src/lib.rs.in index 72b7cefe05..c9eda7c540 100644 --- a/gen/freebase1_sandbox/src/lib.rs.in +++ b/gen/freebase1_sandbox/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -109,7 +110,7 @@ impl<'a, C, A> Freebase Freebase { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -118,7 +119,7 @@ impl<'a, C, A> Freebase } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/fusiontables2-cli/Cargo.toml b/gen/fusiontables2-cli/Cargo.toml index 5f382a8f53..593b24b090 100644 --- a/gen/fusiontables2-cli/Cargo.toml +++ b/gen/fusiontables2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-fusiontables2-cli" -version = "0.3.1+20150326" +version = "0.3.2+20150618" authors = ["Sebastian Thiel "] description = "A complete library to interact with fusiontables (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fusiontables2-cli" @@ -17,9 +17,10 @@ keywords = ["fusiontables", "google", "cli"] name = "fusiontables2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/fusiontables2-cli/README.md b/gen/fusiontables2-cli/README.md index 3677c09fed..5c680353af 100644 --- a/gen/fusiontables2-cli/README.md +++ b/gen/fusiontables2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *fusiontables* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/fusiontables2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/fusiontables2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/fusiontables2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/fusiontables2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/fusiontables2-cli). # Usage -This documentation was generated from the *fusiontables* API at revision *20150326*. The CLI is at version *0.3.1*. +This documentation was generated from the *fusiontables* API at revision *20150618*. The CLI is at version *0.3.2*. ```bash fusiontables2 [options] diff --git a/gen/fusiontables2-cli/mkdocs.yml b/gen/fusiontables2-cli/mkdocs.yml index f58f9cada6..e5c56a7cad 100644 --- a/gen/fusiontables2-cli/mkdocs.yml +++ b/gen/fusiontables2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: fusiontables v0.3.1+20150326 +site_name: fusiontables v0.3.2+20150618 site_url: http://byron.github.io/google-apis-rs/google-fusiontables2-cli site_description: Write integrating applications with bcore diff --git a/gen/fusiontables2-cli/src/cmn.rs b/gen/fusiontables2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/fusiontables2-cli/src/cmn.rs +++ b/gen/fusiontables2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/fusiontables2-cli/src/main.rs b/gen/fusiontables2-cli/src/main.rs index 7105bb779d..d747d3da95 100644 --- a/gen/fusiontables2-cli/src/main.rs +++ b/gen/fusiontables2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -3584,7 +3585,7 @@ fn main() { let mut app = App::new("fusiontables2") .author("Sebastian Thiel ") - .version("0.3.1+20150326") + .version("0.3.2+20150618") .about("API for working with Fusion Tables data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_fusiontables2_cli") .arg(Arg::with_name("url") @@ -3677,7 +3678,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/fusiontables2/Cargo.toml b/gen/fusiontables2/Cargo.toml index 875ad8a2d5..42ebecdd31 100644 --- a/gen/fusiontables2/Cargo.toml +++ b/gen/fusiontables2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-fusiontables2" -version = "0.1.8+20150326" +version = "0.1.9+20150618" authors = ["Sebastian Thiel "] description = "A complete library to interact with fusiontables (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fusiontables2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/fusiontables2/README.md b/gen/fusiontables2/README.md index 88324d5468..f9e35c9ae8 100644 --- a/gen/fusiontables2/README.md +++ b/gen/fusiontables2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-fusiontables2` library allows access to all features of the *Google fusiontables* service. -This documentation was generated from *fusiontables* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *fusiontables* crate version *0.1.9+20150618*, where *20150618* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *fusiontables* *v2* API can be found at the [official documentation site](https://developers.google.com/fusiontables). diff --git a/gen/fusiontables2/src/cmn.rs b/gen/fusiontables2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/fusiontables2/src/cmn.rs +++ b/gen/fusiontables2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/fusiontables2/src/lib.rs b/gen/fusiontables2/src/lib.rs index a367b71cf2..c69e705ff0 100644 --- a/gen/fusiontables2/src/lib.rs +++ b/gen/fusiontables2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *fusiontables* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *fusiontables* crate version *0.1.9+20150618*, where *20150618* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *fusiontables* *v2* API can be found at the //! [official documentation site](https://developers.google.com/fusiontables). diff --git a/gen/fusiontables2/src/lib.rs.in b/gen/fusiontables2/src/lib.rs.in index 311620267f..32da8acde4 100644 --- a/gen/fusiontables2/src/lib.rs.in +++ b/gen/fusiontables2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -132,7 +133,7 @@ impl<'a, C, A> Fusiontables Fusiontables { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -156,7 +157,7 @@ impl<'a, C, A> Fusiontables } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/games1-cli/Cargo.toml b/gen/games1-cli/Cargo.toml index fed99164b0..de404e4d20 100644 --- a/gen/games1-cli/Cargo.toml +++ b/gen/games1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-games1-cli" -version = "0.3.1+20150601" +version = "0.3.2+20150717" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/games1-cli" @@ -17,9 +17,10 @@ keywords = ["games", "google", "cli"] name = "games1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/games1-cli/README.md b/gen/games1-cli/README.md index e5f45b47cf..1127201c4e 100644 --- a/gen/games1-cli/README.md +++ b/gen/games1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *Games* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/games1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/games1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/games1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/games1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/games1-cli). # Usage -This documentation was generated from the *Games* API at revision *20150601*. The CLI is at version *0.3.1*. +This documentation was generated from the *Games* API at revision *20150717*. The CLI is at version *0.3.2*. ```bash games1 [options] diff --git a/gen/games1-cli/mkdocs.yml b/gen/games1-cli/mkdocs.yml index 6285bd687b..cd5fe0f0b4 100644 --- a/gen/games1-cli/mkdocs.yml +++ b/gen/games1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Games v0.3.1+20150601 +site_name: Games v0.3.2+20150717 site_url: http://byron.github.io/google-apis-rs/google-games1-cli site_description: Write integrating applications with bcore diff --git a/gen/games1-cli/src/cmn.rs b/gen/games1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/games1-cli/src/cmn.rs +++ b/gen/games1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/games1-cli/src/main.rs b/gen/games1-cli/src/main.rs index febf4cbc40..a5d49f1e53 100644 --- a/gen/games1-cli/src/main.rs +++ b/gen/games1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -5008,7 +5009,7 @@ fn main() { let mut app = App::new("games1") .author("Sebastian Thiel ") - .version("0.3.1+20150601") + .version("0.3.2+20150717") .about("The API for Google Play Game Services.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_games1_cli") .arg(Arg::with_name("url") @@ -5090,7 +5091,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/games1/Cargo.toml b/gen/games1/Cargo.toml index a3abe8a1ac..a7d1704e71 100644 --- a/gen/games1/Cargo.toml +++ b/gen/games1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-games1" -version = "0.1.8+20150601" +version = "0.1.9+20150717" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/games1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/games1/README.md b/gen/games1/README.md index d122dada68..92ecdbf91c 100644 --- a/gen/games1/README.md +++ b/gen/games1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-games1` library allows access to all features of the *Google Games* service. -This documentation was generated from *Games* crate version *0.1.8+20150601*, where *20150601* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Games* crate version *0.1.9+20150717*, where *20150717* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *Games* *v1* API can be found at the [official documentation site](https://developers.google.com/games/services/). diff --git a/gen/games1/src/cmn.rs b/gen/games1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/games1/src/cmn.rs +++ b/gen/games1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/games1/src/lib.rs b/gen/games1/src/lib.rs index b0db4d16fc..3342304edd 100644 --- a/gen/games1/src/lib.rs +++ b/gen/games1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Games* crate version *0.1.8+20150601*, where *20150601* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Games* crate version *0.1.9+20150717*, where *20150717* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *Games* *v1* API can be found at the //! [official documentation site](https://developers.google.com/games/services/). diff --git a/gen/games1/src/lib.rs.in b/gen/games1/src/lib.rs.in index 2b62cb54dd..bb5b09c326 100644 --- a/gen/games1/src/lib.rs.in +++ b/gen/games1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -135,7 +136,7 @@ impl<'a, C, A> Games Games { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -186,7 +187,7 @@ impl<'a, C, A> Games } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/gamesconfiguration1_configuration-cli/Cargo.toml b/gen/gamesconfiguration1_configuration-cli/Cargo.toml index 90235f1e9f..740404a8cc 100644 --- a/gen/gamesconfiguration1_configuration-cli/Cargo.toml +++ b/gen/gamesconfiguration1_configuration-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gamesconfiguration1_configuration-cli" -version = "0.3.1+20150601" +version = "0.3.2+20150717" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games Configuration (protocol v1configuration)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gamesconfiguration1_configuration-cli" @@ -17,9 +17,10 @@ keywords = ["gamesConfiguration", "google", "cli"] name = "gamesconfiguration1-configuration" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/gamesconfiguration1_configuration-cli/README.md b/gen/gamesconfiguration1_configuration-cli/README.md index 07736f3c44..51cf19984d 100644 --- a/gen/gamesconfiguration1_configuration-cli/README.md +++ b/gen/gamesconfiguration1_configuration-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *Games Configuration* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/gamesconfiguration1-configuration.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/gamesconfiguration1-configuration.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/gamesconfiguration1-configuration.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/gamesconfiguration1-configuration.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/gamesconfiguration1_configuration-cli). # Usage -This documentation was generated from the *Games Configuration* API at revision *20150601*. The CLI is at version *0.3.1*. +This documentation was generated from the *Games Configuration* API at revision *20150717*. The CLI is at version *0.3.2*. ```bash gamesconfiguration1-configuration [options] diff --git a/gen/gamesconfiguration1_configuration-cli/mkdocs.yml b/gen/gamesconfiguration1_configuration-cli/mkdocs.yml index c719940df0..e3ec10881b 100644 --- a/gen/gamesconfiguration1_configuration-cli/mkdocs.yml +++ b/gen/gamesconfiguration1_configuration-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Games Configuration v0.3.1+20150601 +site_name: Games Configuration v0.3.2+20150717 site_url: http://byron.github.io/google-apis-rs/google-gamesconfiguration1_configuration-cli site_description: Write integrating applications with bcore diff --git a/gen/gamesconfiguration1_configuration-cli/src/cmn.rs b/gen/gamesconfiguration1_configuration-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/gamesconfiguration1_configuration-cli/src/cmn.rs +++ b/gen/gamesconfiguration1_configuration-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/gamesconfiguration1_configuration-cli/src/main.rs b/gen/gamesconfiguration1_configuration-cli/src/main.rs index 39f1fdb65b..7bc45ee4a5 100644 --- a/gen/gamesconfiguration1_configuration-cli/src/main.rs +++ b/gen/gamesconfiguration1_configuration-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1550,7 +1551,7 @@ fn main() { let mut app = App::new("gamesconfiguration1-configuration") .author("Sebastian Thiel ") - .version("0.3.1+20150601") + .version("0.3.2+20150717") .about("The Publishing API for Google Play Game Services.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_gamesconfiguration1_configuration_cli") .arg(Arg::with_name("url") @@ -1643,7 +1644,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/gamesconfiguration1_configuration/Cargo.toml b/gen/gamesconfiguration1_configuration/Cargo.toml index 789babb82f..14c1eac944 100644 --- a/gen/gamesconfiguration1_configuration/Cargo.toml +++ b/gen/gamesconfiguration1_configuration/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gamesconfiguration1_configuration" -version = "0.1.8+20150601" +version = "0.1.9+20150717" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games Configuration (protocol v1configuration)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gamesconfiguration1_configuration" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/gamesconfiguration1_configuration/README.md b/gen/gamesconfiguration1_configuration/README.md index 7a8dfa8f38..2017bfb4cf 100644 --- a/gen/gamesconfiguration1_configuration/README.md +++ b/gen/gamesconfiguration1_configuration/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-gamesconfiguration1_configuration` library allows access to all features of the *Google Games Configuration* service. -This documentation was generated from *Games Configuration* crate version *0.1.8+20150601*, where *20150601* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Games Configuration* crate version *0.1.9+20150717*, where *20150717* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *Games Configuration* *v1_configuration* API can be found at the [official documentation site](https://developers.google.com/games/services). diff --git a/gen/gamesconfiguration1_configuration/src/cmn.rs b/gen/gamesconfiguration1_configuration/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/gamesconfiguration1_configuration/src/cmn.rs +++ b/gen/gamesconfiguration1_configuration/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/gamesconfiguration1_configuration/src/lib.rs b/gen/gamesconfiguration1_configuration/src/lib.rs index e5aa67fb48..b11caf5c94 100644 --- a/gen/gamesconfiguration1_configuration/src/lib.rs +++ b/gen/gamesconfiguration1_configuration/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Games Configuration* crate version *0.1.8+20150601*, where *20150601* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Games Configuration* crate version *0.1.9+20150717*, where *20150717* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *Games Configuration* *v1_configuration* API can be found at the //! [official documentation site](https://developers.google.com/games/services). diff --git a/gen/gamesconfiguration1_configuration/src/lib.rs.in b/gen/gamesconfiguration1_configuration/src/lib.rs.in index d87e6cd8a1..5ff6c6f25d 100644 --- a/gen/gamesconfiguration1_configuration/src/lib.rs.in +++ b/gen/gamesconfiguration1_configuration/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -127,7 +128,7 @@ impl<'a, C, A> GamesConfiguration GamesConfiguration { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -142,7 +143,7 @@ impl<'a, C, A> GamesConfiguration } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/gamesmanagement1_management-cli/Cargo.toml b/gen/gamesmanagement1_management-cli/Cargo.toml index 727e927512..df1a186a28 100644 --- a/gen/gamesmanagement1_management-cli/Cargo.toml +++ b/gen/gamesmanagement1_management-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gamesmanagement1_management-cli" -version = "0.3.1+20150601" +version = "0.3.2+20150717" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games Management (protocol v1management)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gamesmanagement1_management-cli" @@ -17,9 +17,10 @@ keywords = ["gamesManagement", "google", "cli"] name = "gamesmanagement1-management" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/gamesmanagement1_management-cli/README.md b/gen/gamesmanagement1_management-cli/README.md index d6757af9f0..25f5df3d87 100644 --- a/gen/gamesmanagement1_management-cli/README.md +++ b/gen/gamesmanagement1_management-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *Games Management* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/gamesmanagement1-management.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/gamesmanagement1-management.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/gamesmanagement1-management.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/gamesmanagement1-management.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/gamesmanagement1_management-cli). # Usage -This documentation was generated from the *Games Management* API at revision *20150601*. The CLI is at version *0.3.1*. +This documentation was generated from the *Games Management* API at revision *20150717*. The CLI is at version *0.3.2*. ```bash gamesmanagement1-management [options] diff --git a/gen/gamesmanagement1_management-cli/mkdocs.yml b/gen/gamesmanagement1_management-cli/mkdocs.yml index 16eb3b1b77..4aed280f25 100644 --- a/gen/gamesmanagement1_management-cli/mkdocs.yml +++ b/gen/gamesmanagement1_management-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Games Management v0.3.1+20150601 +site_name: Games Management v0.3.2+20150717 site_url: http://byron.github.io/google-apis-rs/google-gamesmanagement1_management-cli site_description: Write integrating applications with bcore diff --git a/gen/gamesmanagement1_management-cli/src/cmn.rs b/gen/gamesmanagement1_management-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/gamesmanagement1_management-cli/src/cmn.rs +++ b/gen/gamesmanagement1_management-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/gamesmanagement1_management-cli/src/main.rs b/gen/gamesmanagement1_management-cli/src/main.rs index 2de99f1384..9182e7f0c9 100644 --- a/gen/gamesmanagement1_management-cli/src/main.rs +++ b/gen/gamesmanagement1_management-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -2077,7 +2078,7 @@ fn main() { let mut app = App::new("gamesmanagement1-management") .author("Sebastian Thiel ") - .version("0.3.1+20150601") + .version("0.3.2+20150717") .about("The Management API for Google Play Game Services.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_gamesmanagement1_management_cli") .arg(Arg::with_name("url") @@ -2159,7 +2160,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/gamesmanagement1_management/Cargo.toml b/gen/gamesmanagement1_management/Cargo.toml index 49a141f0b3..7720e49537 100644 --- a/gen/gamesmanagement1_management/Cargo.toml +++ b/gen/gamesmanagement1_management/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gamesmanagement1_management" -version = "0.1.8+20150601" +version = "0.1.9+20150717" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games Management (protocol v1management)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gamesmanagement1_management" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/gamesmanagement1_management/README.md b/gen/gamesmanagement1_management/README.md index 8c6945e475..03d42b4bdf 100644 --- a/gen/gamesmanagement1_management/README.md +++ b/gen/gamesmanagement1_management/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-gamesmanagement1_management` library allows access to all features of the *Google Games Management* service. -This documentation was generated from *Games Management* crate version *0.1.8+20150601*, where *20150601* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Games Management* crate version *0.1.9+20150717*, where *20150717* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *Games Management* *v1_management* API can be found at the [official documentation site](https://developers.google.com/games/services). diff --git a/gen/gamesmanagement1_management/src/cmn.rs b/gen/gamesmanagement1_management/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/gamesmanagement1_management/src/cmn.rs +++ b/gen/gamesmanagement1_management/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/gamesmanagement1_management/src/lib.rs b/gen/gamesmanagement1_management/src/lib.rs index d2adf0cf9b..7151b8b795 100644 --- a/gen/gamesmanagement1_management/src/lib.rs +++ b/gen/gamesmanagement1_management/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Games Management* crate version *0.1.8+20150601*, where *20150601* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Games Management* crate version *0.1.9+20150717*, where *20150717* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *Games Management* *v1_management* API can be found at the //! [official documentation site](https://developers.google.com/games/services). diff --git a/gen/gamesmanagement1_management/src/lib.rs.in b/gen/gamesmanagement1_management/src/lib.rs.in index c6547e5cab..3adeb460b9 100644 --- a/gen/gamesmanagement1_management/src/lib.rs.in +++ b/gen/gamesmanagement1_management/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -129,7 +130,7 @@ impl<'a, C, A> GamesManagement GamesManagement { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -159,7 +160,7 @@ impl<'a, C, A> GamesManagement } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/gan1_beta1-cli/Cargo.toml b/gen/gan1_beta1-cli/Cargo.toml index 871261053e..495343f692 100644 --- a/gen/gan1_beta1-cli/Cargo.toml +++ b/gen/gan1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gan1_beta1-cli" -version = "0.3.1+20130205" +version = "0.3.2+20130205" authors = ["Sebastian Thiel "] description = "A complete library to interact with gan (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gan1_beta1-cli" @@ -17,9 +17,10 @@ keywords = ["gan", "google", "cli"] name = "gan1-beta1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/gan1_beta1-cli/README.md b/gen/gan1_beta1-cli/README.md index 81ed938eb4..c53b45a74e 100644 --- a/gen/gan1_beta1-cli/README.md +++ b/gen/gan1_beta1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *gan* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/gan1-beta1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/gan1-beta1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/gan1-beta1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/gan1-beta1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/gan1_beta1-cli). # Usage -This documentation was generated from the *gan* API at revision *20130205*. The CLI is at version *0.3.1*. +This documentation was generated from the *gan* API at revision *20130205*. The CLI is at version *0.3.2*. ```bash gan1-beta1 [options] diff --git a/gen/gan1_beta1-cli/mkdocs.yml b/gen/gan1_beta1-cli/mkdocs.yml index 293d44322d..3e92511233 100644 --- a/gen/gan1_beta1-cli/mkdocs.yml +++ b/gen/gan1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: gan v0.3.1+20130205 +site_name: gan v0.3.2+20130205 site_url: http://byron.github.io/google-apis-rs/google-gan1_beta1-cli site_description: Write integrating applications with bcore diff --git a/gen/gan1_beta1-cli/src/cmn.rs b/gen/gan1_beta1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/gan1_beta1-cli/src/cmn.rs +++ b/gen/gan1_beta1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/gan1_beta1-cli/src/main.rs b/gen/gan1_beta1-cli/src/main.rs index 2aa584f945..5b8622521a 100644 --- a/gen/gan1_beta1-cli/src/main.rs +++ b/gen/gan1_beta1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1261,7 +1262,7 @@ fn main() { let mut app = App::new("gan1-beta1") .author("Sebastian Thiel ") - .version("0.3.1+20130205") + .version("0.3.2+20130205") .about("Lets you have programmatic access to your Google Affiliate Network data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_gan1_beta1_cli") .arg(Arg::with_name("folder") @@ -1338,7 +1339,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/gan1_beta1/Cargo.toml b/gen/gan1_beta1/Cargo.toml index 47fa7eedc4..c181715216 100644 --- a/gen/gan1_beta1/Cargo.toml +++ b/gen/gan1_beta1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gan1_beta1" -version = "0.1.8+20130205" +version = "0.1.9+20130205" authors = ["Sebastian Thiel "] description = "A complete library to interact with gan (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gan1_beta1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/gan1_beta1/README.md b/gen/gan1_beta1/README.md index 17066e3345..8be5d5f62e 100644 --- a/gen/gan1_beta1/README.md +++ b/gen/gan1_beta1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-gan1_beta1` library allows access to all features of the *Google gan* service. -This documentation was generated from *gan* crate version *0.1.8+20130205*, where *20130205* is the exact revision of the *gan:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *gan* crate version *0.1.9+20130205*, where *20130205* is the exact revision of the *gan:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *gan* *v1_beta1* API can be found at the [official documentation site](https://developers.google.com/affiliate-network/). diff --git a/gen/gan1_beta1/src/cmn.rs b/gen/gan1_beta1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/gan1_beta1/src/cmn.rs +++ b/gen/gan1_beta1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/gan1_beta1/src/lib.rs b/gen/gan1_beta1/src/lib.rs index e092dd9163..730183b523 100644 --- a/gen/gan1_beta1/src/lib.rs +++ b/gen/gan1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *gan* crate version *0.1.8+20130205*, where *20130205* is the exact revision of the *gan:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *gan* crate version *0.1.9+20130205*, where *20130205* is the exact revision of the *gan:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *gan* *v1_beta1* API can be found at the //! [official documentation site](https://developers.google.com/affiliate-network/). diff --git a/gen/gan1_beta1/src/lib.rs.in b/gen/gan1_beta1/src/lib.rs.in index 68aa309bb4..4ff6f55f7e 100644 --- a/gen/gan1_beta1/src/lib.rs.in +++ b/gen/gan1_beta1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -116,7 +117,7 @@ impl<'a, C, A> Gan Gan { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -140,7 +141,7 @@ impl<'a, C, A> Gan } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/genomics1-cli/Cargo.toml b/gen/genomics1-cli/Cargo.toml index 0d1ea05e76..d2c5b22145 100644 --- a/gen/genomics1-cli/Cargo.toml +++ b/gen/genomics1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-genomics1-cli" -version = "0.3.1+20150716" +version = "0.3.2+20150716" authors = ["Sebastian Thiel "] description = "A complete library to interact with genomics (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/genomics1-cli" @@ -16,9 +16,10 @@ keywords = ["genomics", "google", "cli"] name = "genomics1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/genomics1-cli/README.md b/gen/genomics1-cli/README.md index e1d1bad14f..1b10b0395e 100644 --- a/gen/genomics1-cli/README.md +++ b/gen/genomics1-cli/README.md @@ -14,14 +14,14 @@ If data-structures are requested, these will be returned as pretty-printed JSON, You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/genomics1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/genomics1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/genomics1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/genomics1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/genomics1-cli). # Usage -This documentation was generated from the *genomics* API at revision *20150716*. The CLI is at version *0.3.1*. +This documentation was generated from the *genomics* API at revision *20150716*. The CLI is at version *0.3.2*. ```bash genomics1 [options] diff --git a/gen/genomics1-cli/mkdocs.yml b/gen/genomics1-cli/mkdocs.yml index c09ee09738..4e14268a30 100644 --- a/gen/genomics1-cli/mkdocs.yml +++ b/gen/genomics1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: genomics v0.3.1+20150716 +site_name: genomics v0.3.2+20150716 site_url: http://byron.github.io/google-apis-rs/google-genomics1-cli site_description: Write integrating applications with bcore diff --git a/gen/genomics1-cli/src/cmn.rs b/gen/genomics1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/genomics1-cli/src/cmn.rs +++ b/gen/genomics1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/genomics1-cli/src/main.rs b/gen/genomics1-cli/src/main.rs index 9f47f24c84..fe2f3d313b 100644 --- a/gen/genomics1-cli/src/main.rs +++ b/gen/genomics1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -4354,7 +4355,7 @@ fn main() { let mut app = App::new("genomics1") .author("Sebastian Thiel ") - .version("0.3.1+20150716") + .version("0.3.2+20150716") .about("An API to store, process, explore, and share DNA sequence reads, reference-based alignments, and variant calls.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_genomics1_cli") .arg(Arg::with_name("url") diff --git a/gen/genomics1/Cargo.toml b/gen/genomics1/Cargo.toml index 178f0cf509..79cf25324e 100644 --- a/gen/genomics1/Cargo.toml +++ b/gen/genomics1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-genomics1" -version = "0.1.8+20150716" +version = "0.1.9+20150716" authors = ["Sebastian Thiel "] description = "A complete library to interact with genomics (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/genomics1" @@ -15,9 +15,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/genomics1/README.md b/gen/genomics1/README.md index 76952bb453..04779dc270 100644 --- a/gen/genomics1/README.md +++ b/gen/genomics1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-genomics1` library allows access to all features of the *Google genomics* service. -This documentation was generated from *genomics* crate version *0.1.8+20150716*, where *20150716* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *genomics* crate version *0.1.9+20150716*, where *20150716* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. # Features Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_genomics1/struct.Genomics.html) ... diff --git a/gen/genomics1/src/cmn.rs b/gen/genomics1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/genomics1/src/cmn.rs +++ b/gen/genomics1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/genomics1/src/lib.rs b/gen/genomics1/src/lib.rs index 1182c53add..a65175bc14 100644 --- a/gen/genomics1/src/lib.rs +++ b/gen/genomics1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *genomics* crate version *0.1.8+20150716*, where *20150716* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *genomics* crate version *0.1.9+20150716*, where *20150716* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/genomics1). //! # Features //! diff --git a/gen/genomics1/src/lib.rs.in b/gen/genomics1/src/lib.rs.in index 24d2c05270..e01d46dc9f 100644 --- a/gen/genomics1/src/lib.rs.in +++ b/gen/genomics1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -144,7 +145,7 @@ impl<'a, C, A> Genomics Genomics { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -177,7 +178,7 @@ impl<'a, C, A> Genomics } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/gmail1-cli/Cargo.toml b/gen/gmail1-cli/Cargo.toml index 027be1e571..b5674c8b03 100644 --- a/gen/gmail1-cli/Cargo.toml +++ b/gen/gmail1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gmail1-cli" -version = "0.3.1+20150526" +version = "0.3.2+20150526" authors = ["Sebastian Thiel "] description = "A complete library to interact with gmail (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gmail1-cli" @@ -17,9 +17,10 @@ keywords = ["gmail", "google", "cli"] name = "gmail1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/gmail1-cli/README.md b/gen/gmail1-cli/README.md index 088507d469..3a0e8a7cbd 100644 --- a/gen/gmail1-cli/README.md +++ b/gen/gmail1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *gmail* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/gmail1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/gmail1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/gmail1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/gmail1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/gmail1-cli). # Usage -This documentation was generated from the *gmail* API at revision *20150526*. The CLI is at version *0.3.1*. +This documentation was generated from the *gmail* API at revision *20150526*. The CLI is at version *0.3.2*. ```bash gmail1 [options] diff --git a/gen/gmail1-cli/mkdocs.yml b/gen/gmail1-cli/mkdocs.yml index 4949f4ffca..bf63eb9ecb 100644 --- a/gen/gmail1-cli/mkdocs.yml +++ b/gen/gmail1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: gmail v0.3.1+20150526 +site_name: gmail v0.3.2+20150526 site_url: http://byron.github.io/google-apis-rs/google-gmail1-cli site_description: Write integrating applications with bcore diff --git a/gen/gmail1-cli/src/cmn.rs b/gen/gmail1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/gmail1-cli/src/cmn.rs +++ b/gen/gmail1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/gmail1-cli/src/main.rs b/gen/gmail1-cli/src/main.rs index 43de254949..e96da8d471 100644 --- a/gen/gmail1-cli/src/main.rs +++ b/gen/gmail1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -3382,7 +3383,7 @@ fn main() { let mut app = App::new("gmail1") .author("Sebastian Thiel ") - .version("0.3.1+20150526") + .version("0.3.2+20150526") .about("The Gmail REST API.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_gmail1_cli") .arg(Arg::with_name("url") @@ -3475,7 +3476,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/gmail1/Cargo.toml b/gen/gmail1/Cargo.toml index 8a4551d3f8..a4a825bf16 100644 --- a/gen/gmail1/Cargo.toml +++ b/gen/gmail1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gmail1" -version = "0.1.8+20150526" +version = "0.1.9+20150526" authors = ["Sebastian Thiel "] description = "A complete library to interact with gmail (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gmail1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/gmail1/README.md b/gen/gmail1/README.md index c80b98d9bf..0f7608e021 100644 --- a/gen/gmail1/README.md +++ b/gen/gmail1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-gmail1` library allows access to all features of the *Google gmail* service. -This documentation was generated from *gmail* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *gmail* crate version *0.1.9+20150526*, where *20150526* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *gmail* *v1* API can be found at the [official documentation site](https://developers.google.com/gmail/api/). diff --git a/gen/gmail1/src/cmn.rs b/gen/gmail1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/gmail1/src/cmn.rs +++ b/gen/gmail1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/gmail1/src/lib.rs b/gen/gmail1/src/lib.rs index 48861a00b2..284f80223f 100644 --- a/gen/gmail1/src/lib.rs +++ b/gen/gmail1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *gmail* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *gmail* crate version *0.1.9+20150526*, where *20150526* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *gmail* *v1* API can be found at the //! [official documentation site](https://developers.google.com/gmail/api/). diff --git a/gen/gmail1/src/lib.rs.in b/gen/gmail1/src/lib.rs.in index 571bf1b066..904fd24bc4 100644 --- a/gen/gmail1/src/lib.rs.in +++ b/gen/gmail1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -156,7 +157,7 @@ impl<'a, C, A> Gmail Gmail { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -165,7 +166,7 @@ impl<'a, C, A> Gmail } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/groupsmigration1-cli/Cargo.toml b/gen/groupsmigration1-cli/Cargo.toml index 00f0fd8f09..6e856dcf51 100644 --- a/gen/groupsmigration1-cli/Cargo.toml +++ b/gen/groupsmigration1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-groupsmigration1-cli" -version = "0.3.1+20140416" +version = "0.3.2+20140416" authors = ["Sebastian Thiel "] description = "A complete library to interact with Groups Migration (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/groupsmigration1-cli" @@ -17,9 +17,10 @@ keywords = ["groupsmigration", "google", "cli"] name = "groupsmigration1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/groupsmigration1-cli/README.md b/gen/groupsmigration1-cli/README.md index fc55fa6548..bf82c873cf 100644 --- a/gen/groupsmigration1-cli/README.md +++ b/gen/groupsmigration1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *Groups Migration* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/groupsmigration1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/groupsmigration1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/groupsmigration1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/groupsmigration1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/groupsmigration1-cli). # Usage -This documentation was generated from the *Groups Migration* API at revision *20140416*. The CLI is at version *0.3.1*. +This documentation was generated from the *Groups Migration* API at revision *20140416*. The CLI is at version *0.3.2*. ```bash groupsmigration1 [options] diff --git a/gen/groupsmigration1-cli/mkdocs.yml b/gen/groupsmigration1-cli/mkdocs.yml index bd694d209e..9446a66b95 100644 --- a/gen/groupsmigration1-cli/mkdocs.yml +++ b/gen/groupsmigration1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Groups Migration v0.3.1+20140416 +site_name: Groups Migration v0.3.2+20140416 site_url: http://byron.github.io/google-apis-rs/google-groupsmigration1-cli site_description: Write integrating applications with bcore diff --git a/gen/groupsmigration1-cli/src/cmn.rs b/gen/groupsmigration1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/groupsmigration1-cli/src/cmn.rs +++ b/gen/groupsmigration1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/groupsmigration1-cli/src/main.rs b/gen/groupsmigration1-cli/src/main.rs index d40935b2f7..5cc00274cc 100644 --- a/gen/groupsmigration1-cli/src/main.rs +++ b/gen/groupsmigration1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -234,7 +235,7 @@ fn main() { let mut app = App::new("groupsmigration1") .author("Sebastian Thiel ") - .version("0.3.1+20140416") + .version("0.3.2+20140416") .about("Groups Migration Api.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_groupsmigration1_cli") .arg(Arg::with_name("url") @@ -327,7 +328,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/groupsmigration1/Cargo.toml b/gen/groupsmigration1/Cargo.toml index 85a61c7f8f..f166730f3d 100644 --- a/gen/groupsmigration1/Cargo.toml +++ b/gen/groupsmigration1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-groupsmigration1" -version = "0.1.8+20140416" +version = "0.1.9+20140416" authors = ["Sebastian Thiel "] description = "A complete library to interact with Groups Migration (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/groupsmigration1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/groupsmigration1/README.md b/gen/groupsmigration1/README.md index f2bc46d459..24130127de 100644 --- a/gen/groupsmigration1/README.md +++ b/gen/groupsmigration1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-groupsmigration1` library allows access to all features of the *Google Groups Migration* service. -This documentation was generated from *Groups Migration* crate version *0.1.8+20140416*, where *20140416* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Groups Migration* crate version *0.1.9+20140416*, where *20140416* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *Groups Migration* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/groups-migration/). diff --git a/gen/groupsmigration1/src/cmn.rs b/gen/groupsmigration1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/groupsmigration1/src/cmn.rs +++ b/gen/groupsmigration1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/groupsmigration1/src/lib.rs b/gen/groupsmigration1/src/lib.rs index 0f209f3c20..8d2881ec9b 100644 --- a/gen/groupsmigration1/src/lib.rs +++ b/gen/groupsmigration1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Groups Migration* crate version *0.1.8+20140416*, where *20140416* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Groups Migration* crate version *0.1.9+20140416*, where *20140416* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *Groups Migration* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/groups-migration/). diff --git a/gen/groupsmigration1/src/lib.rs.in b/gen/groupsmigration1/src/lib.rs.in index ff07df8c91..368c64587f 100644 --- a/gen/groupsmigration1/src/lib.rs.in +++ b/gen/groupsmigration1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -126,7 +127,7 @@ impl<'a, C, A> GroupsMigration GroupsMigration { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -135,7 +136,7 @@ impl<'a, C, A> GroupsMigration } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/groupssettings1-cli/Cargo.toml b/gen/groupssettings1-cli/Cargo.toml index a9ced59493..a88fc91c15 100644 --- a/gen/groupssettings1-cli/Cargo.toml +++ b/gen/groupssettings1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-groupssettings1-cli" -version = "0.3.1+20140428" +version = "0.3.2+20140428" authors = ["Sebastian Thiel "] description = "A complete library to interact with groupssettings (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/groupssettings1-cli" @@ -17,9 +17,10 @@ keywords = ["groupssettings", "google", "cli"] name = "groupssettings1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/groupssettings1-cli/README.md b/gen/groupssettings1-cli/README.md index fa90f5491b..ad9b9d3cea 100644 --- a/gen/groupssettings1-cli/README.md +++ b/gen/groupssettings1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *groupssettings* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/groupssettings1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/groupssettings1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/groupssettings1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/groupssettings1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/groupssettings1-cli). # Usage -This documentation was generated from the *groupssettings* API at revision *20140428*. The CLI is at version *0.3.1*. +This documentation was generated from the *groupssettings* API at revision *20140428*. The CLI is at version *0.3.2*. ```bash groupssettings1 [options] diff --git a/gen/groupssettings1-cli/mkdocs.yml b/gen/groupssettings1-cli/mkdocs.yml index 3755433abb..9f3c23a751 100644 --- a/gen/groupssettings1-cli/mkdocs.yml +++ b/gen/groupssettings1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: groupssettings v0.3.1+20140428 +site_name: groupssettings v0.3.2+20140428 site_url: http://byron.github.io/google-apis-rs/google-groupssettings1-cli site_description: Write integrating applications with bcore diff --git a/gen/groupssettings1-cli/src/cmn.rs b/gen/groupssettings1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/groupssettings1-cli/src/cmn.rs +++ b/gen/groupssettings1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/groupssettings1-cli/src/main.rs b/gen/groupssettings1-cli/src/main.rs index babf9cd0df..1ba743ecda 100644 --- a/gen/groupssettings1-cli/src/main.rs +++ b/gen/groupssettings1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -509,7 +510,7 @@ fn main() { let mut app = App::new("groupssettings1") .author("Sebastian Thiel ") - .version("0.3.1+20140428") + .version("0.3.2+20140428") .about("Lets you manage permission levels and related settings of a group.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_groupssettings1_cli") .arg(Arg::with_name("url") @@ -591,7 +592,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/groupssettings1/Cargo.toml b/gen/groupssettings1/Cargo.toml index dcd8f621ae..4b2d1915e9 100644 --- a/gen/groupssettings1/Cargo.toml +++ b/gen/groupssettings1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-groupssettings1" -version = "0.1.8+20140428" +version = "0.1.9+20140428" authors = ["Sebastian Thiel "] description = "A complete library to interact with groupssettings (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/groupssettings1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/groupssettings1/README.md b/gen/groupssettings1/README.md index 4483883c6c..a88554304d 100644 --- a/gen/groupssettings1/README.md +++ b/gen/groupssettings1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-groupssettings1` library allows access to all features of the *Google groupssettings* service. -This documentation was generated from *groupssettings* crate version *0.1.8+20140428*, where *20140428* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *groupssettings* crate version *0.1.9+20140428*, where *20140428* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *groupssettings* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/groups-settings/get_started). diff --git a/gen/groupssettings1/src/cmn.rs b/gen/groupssettings1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/groupssettings1/src/cmn.rs +++ b/gen/groupssettings1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/groupssettings1/src/lib.rs b/gen/groupssettings1/src/lib.rs index 3fe0c8c4c3..fe2ccb808e 100644 --- a/gen/groupssettings1/src/lib.rs +++ b/gen/groupssettings1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *groupssettings* crate version *0.1.8+20140428*, where *20140428* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *groupssettings* crate version *0.1.9+20140428*, where *20140428* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *groupssettings* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/groups-settings/get_started). diff --git a/gen/groupssettings1/src/lib.rs.in b/gen/groupssettings1/src/lib.rs.in index 6e41f1e7e6..83348beb22 100644 --- a/gen/groupssettings1/src/lib.rs.in +++ b/gen/groupssettings1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -131,7 +132,7 @@ impl<'a, C, A> Groupssettings Groupssettings { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -140,7 +141,7 @@ impl<'a, C, A> Groupssettings } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/identitytoolkit3-cli/Cargo.toml b/gen/identitytoolkit3-cli/Cargo.toml index 7bb3624a7f..cb454d6305 100644 --- a/gen/identitytoolkit3-cli/Cargo.toml +++ b/gen/identitytoolkit3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-identitytoolkit3-cli" -version = "0.3.1+20150513" +version = "0.3.2+20150710" authors = ["Sebastian Thiel "] description = "A complete library to interact with Identity Toolkit (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/identitytoolkit3-cli" @@ -17,9 +17,10 @@ keywords = ["identitytoolkit", "google", "cli"] name = "identitytoolkit3" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/identitytoolkit3-cli/README.md b/gen/identitytoolkit3-cli/README.md index 025177fd4c..f5109023c7 100644 --- a/gen/identitytoolkit3-cli/README.md +++ b/gen/identitytoolkit3-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *Identity Toolkit* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/identitytoolkit3.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/identitytoolkit3.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/identitytoolkit3.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/identitytoolkit3.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/identitytoolkit3-cli). # Usage -This documentation was generated from the *Identity Toolkit* API at revision *20150513*. The CLI is at version *0.3.1*. +This documentation was generated from the *Identity Toolkit* API at revision *20150710*. The CLI is at version *0.3.2*. ```bash identitytoolkit3 [options] diff --git a/gen/identitytoolkit3-cli/mkdocs.yml b/gen/identitytoolkit3-cli/mkdocs.yml index 19032c30d4..be27c14160 100644 --- a/gen/identitytoolkit3-cli/mkdocs.yml +++ b/gen/identitytoolkit3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Identity Toolkit v0.3.1+20150513 +site_name: Identity Toolkit v0.3.2+20150710 site_url: http://byron.github.io/google-apis-rs/google-identitytoolkit3-cli site_description: Write integrating applications with bcore diff --git a/gen/identitytoolkit3-cli/src/cmn.rs b/gen/identitytoolkit3-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/identitytoolkit3-cli/src/cmn.rs +++ b/gen/identitytoolkit3-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/identitytoolkit3-cli/src/main.rs b/gen/identitytoolkit3-cli/src/main.rs index fb18098776..b365b8bdc4 100644 --- a/gen/identitytoolkit3-cli/src/main.rs +++ b/gen/identitytoolkit3-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1397,7 +1398,7 @@ fn main() { let mut app = App::new("identitytoolkit3") .author("Sebastian Thiel ") - .version("0.3.1+20150513") + .version("0.3.2+20150710") .about("Help the third party sites to implement federated login.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_identitytoolkit3_cli") .arg(Arg::with_name("folder") @@ -1474,7 +1475,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/identitytoolkit3/Cargo.toml b/gen/identitytoolkit3/Cargo.toml index 668d9a11e2..495d62f9a7 100644 --- a/gen/identitytoolkit3/Cargo.toml +++ b/gen/identitytoolkit3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-identitytoolkit3" -version = "0.1.8+20150513" +version = "0.1.9+20150710" authors = ["Sebastian Thiel "] description = "A complete library to interact with Identity Toolkit (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/identitytoolkit3" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/identitytoolkit3/README.md b/gen/identitytoolkit3/README.md index fbf90f3302..a387abb434 100644 --- a/gen/identitytoolkit3/README.md +++ b/gen/identitytoolkit3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-identitytoolkit3` library allows access to all features of the *Google Identity Toolkit* service. -This documentation was generated from *Identity Toolkit* crate version *0.1.8+20150513*, where *20150513* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Identity Toolkit* crate version *0.1.9+20150710*, where *20150710* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *Identity Toolkit* *v3* API can be found at the [official documentation site](https://developers.google.com/identity-toolkit/v3/). diff --git a/gen/identitytoolkit3/src/cmn.rs b/gen/identitytoolkit3/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/identitytoolkit3/src/cmn.rs +++ b/gen/identitytoolkit3/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/identitytoolkit3/src/lib.rs b/gen/identitytoolkit3/src/lib.rs index ff38503fed..576d724379 100644 --- a/gen/identitytoolkit3/src/lib.rs +++ b/gen/identitytoolkit3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Identity Toolkit* crate version *0.1.8+20150513*, where *20150513* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Identity Toolkit* crate version *0.1.9+20150710*, where *20150710* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *Identity Toolkit* *v3* API can be found at the //! [official documentation site](https://developers.google.com/identity-toolkit/v3/). diff --git a/gen/identitytoolkit3/src/lib.rs.in b/gen/identitytoolkit3/src/lib.rs.in index eddcd044e8..ab62c1b985 100644 --- a/gen/identitytoolkit3/src/lib.rs.in +++ b/gen/identitytoolkit3/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -109,7 +110,7 @@ impl<'a, C, A> IdentityToolkit IdentityToolkit { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -118,7 +119,7 @@ impl<'a, C, A> IdentityToolkit } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/licensing1-cli/Cargo.toml b/gen/licensing1-cli/Cargo.toml index cc2252ee69..a7d55c82f7 100644 --- a/gen/licensing1-cli/Cargo.toml +++ b/gen/licensing1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-licensing1-cli" -version = "0.3.1+20150525" +version = "0.3.2+20150525" authors = ["Sebastian Thiel "] description = "A complete library to interact with licensing (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/licensing1-cli" @@ -17,9 +17,10 @@ keywords = ["licensing", "google", "cli"] name = "licensing1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/licensing1-cli/README.md b/gen/licensing1-cli/README.md index 705b56617e..6a1028980c 100644 --- a/gen/licensing1-cli/README.md +++ b/gen/licensing1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *licensing* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/licensing1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/licensing1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/licensing1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/licensing1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/licensing1-cli). # Usage -This documentation was generated from the *licensing* API at revision *20150525*. The CLI is at version *0.3.1*. +This documentation was generated from the *licensing* API at revision *20150525*. The CLI is at version *0.3.2*. ```bash licensing1 [options] diff --git a/gen/licensing1-cli/mkdocs.yml b/gen/licensing1-cli/mkdocs.yml index c3d1058324..39ccd2fc51 100644 --- a/gen/licensing1-cli/mkdocs.yml +++ b/gen/licensing1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: licensing v0.3.1+20150525 +site_name: licensing v0.3.2+20150525 site_url: http://byron.github.io/google-apis-rs/google-licensing1-cli site_description: Write integrating applications with bcore diff --git a/gen/licensing1-cli/src/cmn.rs b/gen/licensing1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/licensing1-cli/src/cmn.rs +++ b/gen/licensing1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/licensing1-cli/src/main.rs b/gen/licensing1-cli/src/main.rs index 436723f9db..e2bbb065d6 100644 --- a/gen/licensing1-cli/src/main.rs +++ b/gen/licensing1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -884,7 +885,7 @@ fn main() { let mut app = App::new("licensing1") .author("Sebastian Thiel ") - .version("0.3.1+20150525") + .version("0.3.2+20150525") .about("Licensing API to view and manage license for your domain.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_licensing1_cli") .arg(Arg::with_name("url") @@ -966,7 +967,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/licensing1/Cargo.toml b/gen/licensing1/Cargo.toml index d6cb3191b4..b6d5a40377 100644 --- a/gen/licensing1/Cargo.toml +++ b/gen/licensing1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-licensing1" -version = "0.1.8+20150525" +version = "0.1.9+20150525" authors = ["Sebastian Thiel "] description = "A complete library to interact with licensing (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/licensing1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/licensing1/README.md b/gen/licensing1/README.md index c00207c9b3..62558d4390 100644 --- a/gen/licensing1/README.md +++ b/gen/licensing1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-licensing1` library allows access to all features of the *Google licensing* service. -This documentation was generated from *licensing* crate version *0.1.8+20150525*, where *20150525* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *licensing* crate version *0.1.9+20150525*, where *20150525* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *licensing* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/licensing/). diff --git a/gen/licensing1/src/cmn.rs b/gen/licensing1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/licensing1/src/cmn.rs +++ b/gen/licensing1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/licensing1/src/lib.rs b/gen/licensing1/src/lib.rs index f429e7cdf6..ff44b56615 100644 --- a/gen/licensing1/src/lib.rs +++ b/gen/licensing1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *licensing* crate version *0.1.8+20150525*, where *20150525* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *licensing* crate version *0.1.9+20150525*, where *20150525* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *licensing* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/licensing/). diff --git a/gen/licensing1/src/lib.rs.in b/gen/licensing1/src/lib.rs.in index c52393ac1c..d98982ae5a 100644 --- a/gen/licensing1/src/lib.rs.in +++ b/gen/licensing1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -127,7 +128,7 @@ impl<'a, C, A> Licensing Licensing { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -136,7 +137,7 @@ impl<'a, C, A> Licensing } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/logging1_beta3-cli/Cargo.toml b/gen/logging1_beta3-cli/Cargo.toml index f8850ac65a..66bdfa27a9 100644 --- a/gen/logging1_beta3-cli/Cargo.toml +++ b/gen/logging1_beta3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-logging1_beta3-cli" -version = "0.3.1+20150326" +version = "0.3.2+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with logging (protocol v1beta3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/logging1_beta3-cli" @@ -16,9 +16,10 @@ keywords = ["logging", "google", "cli"] name = "logging1-beta3" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/logging1_beta3-cli/README.md b/gen/logging1_beta3-cli/README.md index c043360143..fdd338aa33 100644 --- a/gen/logging1_beta3-cli/README.md +++ b/gen/logging1_beta3-cli/README.md @@ -14,14 +14,14 @@ If data-structures are requested, these will be returned as pretty-printed JSON, You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/logging1-beta3.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/logging1-beta3.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/logging1-beta3.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/logging1-beta3.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/logging1_beta3-cli). # Usage -This documentation was generated from the *logging* API at revision *20150326*. The CLI is at version *0.3.1*. +This documentation was generated from the *logging* API at revision *20150326*. The CLI is at version *0.3.2*. ```bash logging1-beta3 [options] diff --git a/gen/logging1_beta3-cli/mkdocs.yml b/gen/logging1_beta3-cli/mkdocs.yml index f9d044dd02..46f273f91c 100644 --- a/gen/logging1_beta3-cli/mkdocs.yml +++ b/gen/logging1_beta3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: logging v0.3.1+20150326 +site_name: logging v0.3.2+20150326 site_url: http://byron.github.io/google-apis-rs/google-logging1_beta3-cli site_description: Write integrating applications with bcore diff --git a/gen/logging1_beta3-cli/src/cmn.rs b/gen/logging1_beta3-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/logging1_beta3-cli/src/cmn.rs +++ b/gen/logging1_beta3-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/logging1_beta3-cli/src/main.rs b/gen/logging1_beta3-cli/src/main.rs index 43f8d4aa1a..5a699c6e18 100644 --- a/gen/logging1_beta3-cli/src/main.rs +++ b/gen/logging1_beta3-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1655,7 +1656,7 @@ fn main() { let mut app = App::new("logging1-beta3") .author("Sebastian Thiel ") - .version("0.3.1+20150326") + .version("0.3.2+20150326") .about("Google Cloud Logging API lets you create logs, ingest log entries, and manage log sinks.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_logging1_beta3_cli") .arg(Arg::with_name("url") @@ -1737,7 +1738,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/logging1_beta3/Cargo.toml b/gen/logging1_beta3/Cargo.toml index 8ea4ad2d46..1cf5555dff 100644 --- a/gen/logging1_beta3/Cargo.toml +++ b/gen/logging1_beta3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-logging1_beta3" -version = "0.1.8+20150326" +version = "0.1.9+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with logging (protocol v1beta3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/logging1_beta3" @@ -15,9 +15,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/logging1_beta3/README.md b/gen/logging1_beta3/README.md index 3ac4f7b4a8..24f35b0933 100644 --- a/gen/logging1_beta3/README.md +++ b/gen/logging1_beta3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-logging1_beta3` library allows access to all features of the *Google logging* service. -This documentation was generated from *logging* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *logging:v1beta3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *logging* crate version *0.1.9+20150326*, where *20150326* is the exact revision of the *logging:v1beta3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. # Features Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_logging1_beta3/struct.Logging.html) ... diff --git a/gen/logging1_beta3/src/cmn.rs b/gen/logging1_beta3/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/logging1_beta3/src/cmn.rs +++ b/gen/logging1_beta3/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/logging1_beta3/src/lib.rs b/gen/logging1_beta3/src/lib.rs index baed46162a..bc4af56048 100644 --- a/gen/logging1_beta3/src/lib.rs +++ b/gen/logging1_beta3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *logging* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *logging:v1beta3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *logging* crate version *0.1.9+20150326*, where *20150326* is the exact revision of the *logging:v1beta3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/logging1_beta3). //! # Features //! diff --git a/gen/logging1_beta3/src/lib.rs.in b/gen/logging1_beta3/src/lib.rs.in index 699ee9c84a..5eff017479 100644 --- a/gen/logging1_beta3/src/lib.rs.in +++ b/gen/logging1_beta3/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -131,7 +132,7 @@ impl<'a, C, A> Logging Logging { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -140,7 +141,7 @@ impl<'a, C, A> Logging } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/manager1_beta2-cli/Cargo.toml b/gen/manager1_beta2-cli/Cargo.toml index fbba1f2144..01a7b94790 100644 --- a/gen/manager1_beta2-cli/Cargo.toml +++ b/gen/manager1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-manager1_beta2-cli" -version = "0.3.1+20140915" +version = "0.3.2+20140915" authors = ["Sebastian Thiel "] description = "A complete library to interact with manager (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/manager1_beta2-cli" @@ -17,9 +17,10 @@ keywords = ["manager", "google", "cli"] name = "manager1-beta2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/manager1_beta2-cli/README.md b/gen/manager1_beta2-cli/README.md index b2aba1c736..f5f0340796 100644 --- a/gen/manager1_beta2-cli/README.md +++ b/gen/manager1_beta2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *manager* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/manager1-beta2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/manager1-beta2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/manager1-beta2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/manager1-beta2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/manager1_beta2-cli). # Usage -This documentation was generated from the *manager* API at revision *20140915*. The CLI is at version *0.3.1*. +This documentation was generated from the *manager* API at revision *20140915*. The CLI is at version *0.3.2*. ```bash manager1-beta2 [options] diff --git a/gen/manager1_beta2-cli/mkdocs.yml b/gen/manager1_beta2-cli/mkdocs.yml index 1158f68d0b..c682da503b 100644 --- a/gen/manager1_beta2-cli/mkdocs.yml +++ b/gen/manager1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: manager v0.3.1+20140915 +site_name: manager v0.3.2+20140915 site_url: http://byron.github.io/google-apis-rs/google-manager1_beta2-cli site_description: Write integrating applications with bcore diff --git a/gen/manager1_beta2-cli/src/cmn.rs b/gen/manager1_beta2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/manager1_beta2-cli/src/cmn.rs +++ b/gen/manager1_beta2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/manager1_beta2-cli/src/main.rs b/gen/manager1_beta2-cli/src/main.rs index 52d6bf8efd..b9db33f363 100644 --- a/gen/manager1_beta2-cli/src/main.rs +++ b/gen/manager1_beta2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -891,7 +892,7 @@ fn main() { let mut app = App::new("manager1-beta2") .author("Sebastian Thiel ") - .version("0.3.1+20140915") + .version("0.3.2+20140915") .about("The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_manager1_beta2_cli") .arg(Arg::with_name("url") @@ -973,7 +974,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/manager1_beta2/Cargo.toml b/gen/manager1_beta2/Cargo.toml index cd13b31a94..5bcd3e4411 100644 --- a/gen/manager1_beta2/Cargo.toml +++ b/gen/manager1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-manager1_beta2" -version = "0.1.8+20140915" +version = "0.1.9+20140915" authors = ["Sebastian Thiel "] description = "A complete library to interact with manager (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/manager1_beta2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/manager1_beta2/README.md b/gen/manager1_beta2/README.md index 0c692b1117..eec72f4098 100644 --- a/gen/manager1_beta2/README.md +++ b/gen/manager1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-manager1_beta2` library allows access to all features of the *Google manager* service. -This documentation was generated from *manager* crate version *0.1.8+20140915*, where *20140915* is the exact revision of the *manager:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *manager* crate version *0.1.9+20140915*, where *20140915* is the exact revision of the *manager:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *manager* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/deployment-manager/). diff --git a/gen/manager1_beta2/src/cmn.rs b/gen/manager1_beta2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/manager1_beta2/src/cmn.rs +++ b/gen/manager1_beta2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/manager1_beta2/src/lib.rs b/gen/manager1_beta2/src/lib.rs index 7c8558aa91..3ea2d42b78 100644 --- a/gen/manager1_beta2/src/lib.rs +++ b/gen/manager1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *manager* crate version *0.1.8+20140915*, where *20140915* is the exact revision of the *manager:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *manager* crate version *0.1.9+20140915*, where *20140915* is the exact revision of the *manager:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *manager* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/deployment-manager/). diff --git a/gen/manager1_beta2/src/lib.rs.in b/gen/manager1_beta2/src/lib.rs.in index 4f794c8af5..7f18037eff 100644 --- a/gen/manager1_beta2/src/lib.rs.in +++ b/gen/manager1_beta2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -147,7 +148,7 @@ impl<'a, C, A> Manager Manager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -159,7 +160,7 @@ impl<'a, C, A> Manager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/mapsengine1-cli/Cargo.toml b/gen/mapsengine1-cli/Cargo.toml index 38da241e37..9f369bfbcf 100644 --- a/gen/mapsengine1-cli/Cargo.toml +++ b/gen/mapsengine1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-mapsengine1-cli" -version = "0.3.1+20150611" +version = "0.3.2+20150629" authors = ["Sebastian Thiel "] description = "A complete library to interact with Maps Engine (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mapsengine1-cli" @@ -17,9 +17,10 @@ keywords = ["mapsengine", "google", "cli"] name = "mapsengine1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/mapsengine1-cli/README.md b/gen/mapsengine1-cli/README.md index d10f5e0b0c..eaf3086dd7 100644 --- a/gen/mapsengine1-cli/README.md +++ b/gen/mapsengine1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *Maps Engine* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/mapsengine1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/mapsengine1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/mapsengine1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/mapsengine1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/mapsengine1-cli). # Usage -This documentation was generated from the *Maps Engine* API at revision *20150611*. The CLI is at version *0.3.1*. +This documentation was generated from the *Maps Engine* API at revision *20150629*. The CLI is at version *0.3.2*. ```bash mapsengine1 [options] diff --git a/gen/mapsengine1-cli/mkdocs.yml b/gen/mapsengine1-cli/mkdocs.yml index 905cc25ff0..d10d563413 100644 --- a/gen/mapsengine1-cli/mkdocs.yml +++ b/gen/mapsengine1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Maps Engine v0.3.1+20150611 +site_name: Maps Engine v0.3.2+20150629 site_url: http://byron.github.io/google-apis-rs/google-mapsengine1-cli site_description: Write integrating applications with bcore diff --git a/gen/mapsengine1-cli/src/cmn.rs b/gen/mapsengine1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/mapsengine1-cli/src/cmn.rs +++ b/gen/mapsengine1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/mapsengine1-cli/src/main.rs b/gen/mapsengine1-cli/src/main.rs index cfcb448fc9..fe63eeeb37 100644 --- a/gen/mapsengine1-cli/src/main.rs +++ b/gen/mapsengine1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -7573,7 +7574,7 @@ fn main() { let mut app = App::new("mapsengine1") .author("Sebastian Thiel ") - .version("0.3.1+20150611") + .version("0.3.2+20150629") .about("The Google Maps Engine API allows developers to store and query geospatial vector and raster data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_mapsengine1_cli") .arg(Arg::with_name("url") @@ -7666,7 +7667,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/mapsengine1/Cargo.toml b/gen/mapsengine1/Cargo.toml index ceff5d3cb6..7ef1d4166d 100644 --- a/gen/mapsengine1/Cargo.toml +++ b/gen/mapsengine1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-mapsengine1" -version = "0.1.8+20150611" +version = "0.1.9+20150629" authors = ["Sebastian Thiel "] description = "A complete library to interact with Maps Engine (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mapsengine1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/mapsengine1/README.md b/gen/mapsengine1/README.md index 5d868bed5f..56ceb3826c 100644 --- a/gen/mapsengine1/README.md +++ b/gen/mapsengine1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-mapsengine1` library allows access to all features of the *Google Maps Engine* service. -This documentation was generated from *Maps Engine* crate version *0.1.8+20150611*, where *20150611* is the exact revision of the *mapsengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Maps Engine* crate version *0.1.9+20150629*, where *20150629* is the exact revision of the *mapsengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *Maps Engine* *v1* API can be found at the [official documentation site](https://developers.google.com/maps-engine/). diff --git a/gen/mapsengine1/src/cmn.rs b/gen/mapsengine1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/mapsengine1/src/cmn.rs +++ b/gen/mapsengine1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/mapsengine1/src/lib.rs b/gen/mapsengine1/src/lib.rs index 937838b956..7e6f5ba925 100644 --- a/gen/mapsengine1/src/lib.rs +++ b/gen/mapsengine1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Maps Engine* crate version *0.1.8+20150611*, where *20150611* is the exact revision of the *mapsengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Maps Engine* crate version *0.1.9+20150629*, where *20150629* is the exact revision of the *mapsengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *Maps Engine* *v1* API can be found at the //! [official documentation site](https://developers.google.com/maps-engine/). diff --git a/gen/mapsengine1/src/lib.rs.in b/gen/mapsengine1/src/lib.rs.in index 7a0e8084f9..c89e5395a5 100644 --- a/gen/mapsengine1/src/lib.rs.in +++ b/gen/mapsengine1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -142,7 +143,7 @@ impl<'a, C, A> MapsEngine MapsEngine { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -169,7 +170,7 @@ impl<'a, C, A> MapsEngine } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/mirror1-cli/Cargo.toml b/gen/mirror1-cli/Cargo.toml index d34d61d737..6d322e42bf 100644 --- a/gen/mirror1-cli/Cargo.toml +++ b/gen/mirror1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-mirror1-cli" -version = "0.3.1+20150326" +version = "0.3.2+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with mirror (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mirror1-cli" @@ -17,9 +17,10 @@ keywords = ["mirror", "google", "cli"] name = "mirror1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/mirror1-cli/README.md b/gen/mirror1-cli/README.md index 7d4f596aed..9df2d54aad 100644 --- a/gen/mirror1-cli/README.md +++ b/gen/mirror1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *mirror* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/mirror1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/mirror1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/mirror1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/mirror1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/mirror1-cli). # Usage -This documentation was generated from the *mirror* API at revision *20150326*. The CLI is at version *0.3.1*. +This documentation was generated from the *mirror* API at revision *20150326*. The CLI is at version *0.3.2*. ```bash mirror1 [options] diff --git a/gen/mirror1-cli/mkdocs.yml b/gen/mirror1-cli/mkdocs.yml index 5a6d0bf846..028e4417df 100644 --- a/gen/mirror1-cli/mkdocs.yml +++ b/gen/mirror1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: mirror v0.3.1+20150326 +site_name: mirror v0.3.2+20150326 site_url: http://byron.github.io/google-apis-rs/google-mirror1-cli site_description: Write integrating applications with bcore diff --git a/gen/mirror1-cli/src/cmn.rs b/gen/mirror1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/mirror1-cli/src/cmn.rs +++ b/gen/mirror1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/mirror1-cli/src/main.rs b/gen/mirror1-cli/src/main.rs index 8a0d28eae8..638471640a 100644 --- a/gen/mirror1-cli/src/main.rs +++ b/gen/mirror1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -2562,7 +2563,7 @@ fn main() { let mut app = App::new("mirror1") .author("Sebastian Thiel ") - .version("0.3.1+20150326") + .version("0.3.2+20150326") .about("API for interacting with Glass users via the timeline.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_mirror1_cli") .arg(Arg::with_name("url") @@ -2655,7 +2656,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/mirror1/Cargo.toml b/gen/mirror1/Cargo.toml index 1b5e048467..a10094c549 100644 --- a/gen/mirror1/Cargo.toml +++ b/gen/mirror1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-mirror1" -version = "0.1.8+20150326" +version = "0.1.9+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with mirror (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mirror1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/mirror1/README.md b/gen/mirror1/README.md index 3848aa5c6b..d10957de74 100644 --- a/gen/mirror1/README.md +++ b/gen/mirror1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-mirror1` library allows access to all features of the *Google mirror* service. -This documentation was generated from *mirror* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *mirror* crate version *0.1.9+20150326*, where *20150326* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *mirror* *v1* API can be found at the [official documentation site](https://developers.google.com/glass). diff --git a/gen/mirror1/src/cmn.rs b/gen/mirror1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/mirror1/src/cmn.rs +++ b/gen/mirror1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/mirror1/src/lib.rs b/gen/mirror1/src/lib.rs index 3ec556e865..1e9b00e096 100644 --- a/gen/mirror1/src/lib.rs +++ b/gen/mirror1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *mirror* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *mirror* crate version *0.1.9+20150326*, where *20150326* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *mirror* *v1* API can be found at the //! [official documentation site](https://developers.google.com/glass). diff --git a/gen/mirror1/src/lib.rs.in b/gen/mirror1/src/lib.rs.in index 77d8e2e345..d29062faa5 100644 --- a/gen/mirror1/src/lib.rs.in +++ b/gen/mirror1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -135,7 +136,7 @@ impl<'a, C, A> Mirror Mirror { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -159,7 +160,7 @@ impl<'a, C, A> Mirror } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/oauth2_v2-cli/Cargo.toml b/gen/oauth2_v2-cli/Cargo.toml index 2b3f8f7022..beda58487b 100644 --- a/gen/oauth2_v2-cli/Cargo.toml +++ b/gen/oauth2_v2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-oauth2_v2-cli" -version = "0.3.1+20150526" +version = "0.3.2+20150714" authors = ["Sebastian Thiel "] description = "A complete library to interact with oauth2 (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/oauth2_v2-cli" @@ -17,9 +17,10 @@ keywords = ["oauth2", "google", "cli"] name = "oauth2-v2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/oauth2_v2-cli/README.md b/gen/oauth2_v2-cli/README.md index 6245507a85..ae91f60e1e 100644 --- a/gen/oauth2_v2-cli/README.md +++ b/gen/oauth2_v2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *oauth2* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/oauth2-v2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/oauth2-v2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/oauth2-v2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/oauth2-v2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/oauth2_v2-cli). # Usage -This documentation was generated from the *oauth2* API at revision *20150526*. The CLI is at version *0.3.1*. +This documentation was generated from the *oauth2* API at revision *20150714*. The CLI is at version *0.3.2*. ```bash oauth2-v2 [options] diff --git a/gen/oauth2_v2-cli/mkdocs.yml b/gen/oauth2_v2-cli/mkdocs.yml index e44b9f91c2..f9bd091ee4 100644 --- a/gen/oauth2_v2-cli/mkdocs.yml +++ b/gen/oauth2_v2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: oauth2 v0.3.1+20150526 +site_name: oauth2 v0.3.2+20150714 site_url: http://byron.github.io/google-apis-rs/google-oauth2_v2-cli site_description: Write integrating applications with bcore diff --git a/gen/oauth2_v2-cli/src/cmn.rs b/gen/oauth2_v2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/oauth2_v2-cli/src/cmn.rs +++ b/gen/oauth2_v2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/oauth2_v2-cli/src/main.rs b/gen/oauth2_v2-cli/src/main.rs index 6dfefdca14..3a4ca78c4e 100644 --- a/gen/oauth2_v2-cli/src/main.rs +++ b/gen/oauth2_v2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -445,7 +446,7 @@ fn main() { let mut app = App::new("oauth2-v2") .author("Sebastian Thiel ") - .version("0.3.1+20150526") + .version("0.3.2+20150714") .about("Lets you access OAuth2 protocol related APIs.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_oauth2_v2_cli") .arg(Arg::with_name("url") @@ -527,7 +528,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/oauth2_v2/Cargo.toml b/gen/oauth2_v2/Cargo.toml index 7af03e2a0a..a7aa92c6fb 100644 --- a/gen/oauth2_v2/Cargo.toml +++ b/gen/oauth2_v2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-oauth2_v2" -version = "0.1.8+20150526" +version = "0.1.9+20150714" authors = ["Sebastian Thiel "] description = "A complete library to interact with oauth2 (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/oauth2_v2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/oauth2_v2/README.md b/gen/oauth2_v2/README.md index f252866f40..9d00d4a60b 100644 --- a/gen/oauth2_v2/README.md +++ b/gen/oauth2_v2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-oauth2_v2` library allows access to all features of the *Google oauth2* service. -This documentation was generated from *oauth2* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *oauth2:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *oauth2* crate version *0.1.9+20150714*, where *20150714* is the exact revision of the *oauth2:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *oauth2* *v2* API can be found at the [official documentation site](https://developers.google.com/accounts/docs/OAuth2). diff --git a/gen/oauth2_v2/src/cmn.rs b/gen/oauth2_v2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/oauth2_v2/src/cmn.rs +++ b/gen/oauth2_v2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/oauth2_v2/src/lib.rs b/gen/oauth2_v2/src/lib.rs index 7e2a5e6f7e..d0fd91fec8 100644 --- a/gen/oauth2_v2/src/lib.rs +++ b/gen/oauth2_v2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *oauth2* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *oauth2:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *oauth2* crate version *0.1.9+20150714*, where *20150714* is the exact revision of the *oauth2:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *oauth2* *v2* API can be found at the //! [official documentation site](https://developers.google.com/accounts/docs/OAuth2). diff --git a/gen/oauth2_v2/src/lib.rs.in b/gen/oauth2_v2/src/lib.rs.in index 898a8b0d13..02898fb682 100644 --- a/gen/oauth2_v2/src/lib.rs.in +++ b/gen/oauth2_v2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -137,7 +138,7 @@ impl<'a, C, A> Oauth2 Oauth2 { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -149,7 +150,7 @@ impl<'a, C, A> Oauth2 } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/pagespeedonline2-cli/Cargo.toml b/gen/pagespeedonline2-cli/Cargo.toml index 67263bc035..b63d6960fa 100644 --- a/gen/pagespeedonline2-cli/Cargo.toml +++ b/gen/pagespeedonline2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-pagespeedonline2-cli" -version = "0.3.1+20150317" +version = "0.3.2+20150317" authors = ["Sebastian Thiel "] description = "A complete library to interact with pagespeedonline (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pagespeedonline2-cli" @@ -17,9 +17,10 @@ keywords = ["pagespeedonline", "google", "cli"] name = "pagespeedonline2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/pagespeedonline2-cli/README.md b/gen/pagespeedonline2-cli/README.md index 4088856e46..0f0ee9fc55 100644 --- a/gen/pagespeedonline2-cli/README.md +++ b/gen/pagespeedonline2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *pagespeedonline* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/pagespeedonline2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/pagespeedonline2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/pagespeedonline2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/pagespeedonline2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/pagespeedonline2-cli). # Usage -This documentation was generated from the *pagespeedonline* API at revision *20150317*. The CLI is at version *0.3.1*. +This documentation was generated from the *pagespeedonline* API at revision *20150317*. The CLI is at version *0.3.2*. ```bash pagespeedonline2 [options] diff --git a/gen/pagespeedonline2-cli/mkdocs.yml b/gen/pagespeedonline2-cli/mkdocs.yml index d7f2f24ec6..ebdedd38eb 100644 --- a/gen/pagespeedonline2-cli/mkdocs.yml +++ b/gen/pagespeedonline2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: pagespeedonline v0.3.1+20150317 +site_name: pagespeedonline v0.3.2+20150317 site_url: http://byron.github.io/google-apis-rs/google-pagespeedonline2-cli site_description: Write integrating applications with bcore diff --git a/gen/pagespeedonline2-cli/src/cmn.rs b/gen/pagespeedonline2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/pagespeedonline2-cli/src/cmn.rs +++ b/gen/pagespeedonline2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/pagespeedonline2-cli/src/main.rs b/gen/pagespeedonline2-cli/src/main.rs index 35c33385d9..ae552d2208 100644 --- a/gen/pagespeedonline2-cli/src/main.rs +++ b/gen/pagespeedonline2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -236,7 +237,7 @@ fn main() { let mut app = App::new("pagespeedonline2") .author("Sebastian Thiel ") - .version("0.3.1+20150317") + .version("0.3.2+20150317") .about("Lets you analyze the performance of a web page and get tailored suggestions to make that page faster.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_pagespeedonline2_cli") .arg(Arg::with_name("folder") @@ -313,7 +314,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/pagespeedonline2/Cargo.toml b/gen/pagespeedonline2/Cargo.toml index 9985f8d607..aa651983e3 100644 --- a/gen/pagespeedonline2/Cargo.toml +++ b/gen/pagespeedonline2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-pagespeedonline2" -version = "0.1.8+20150317" +version = "0.1.9+20150317" authors = ["Sebastian Thiel "] description = "A complete library to interact with pagespeedonline (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pagespeedonline2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/pagespeedonline2/README.md b/gen/pagespeedonline2/README.md index f60fb21773..9635b7cc76 100644 --- a/gen/pagespeedonline2/README.md +++ b/gen/pagespeedonline2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-pagespeedonline2` library allows access to all features of the *Google pagespeedonline* service. -This documentation was generated from *pagespeedonline* crate version *0.1.8+20150317*, where *20150317* is the exact revision of the *pagespeedonline:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *pagespeedonline* crate version *0.1.9+20150317*, where *20150317* is the exact revision of the *pagespeedonline:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *pagespeedonline* *v2* API can be found at the [official documentation site](https://developers.google.com/speed/docs/insights/v2/getting-started). diff --git a/gen/pagespeedonline2/src/cmn.rs b/gen/pagespeedonline2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/pagespeedonline2/src/cmn.rs +++ b/gen/pagespeedonline2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/pagespeedonline2/src/lib.rs b/gen/pagespeedonline2/src/lib.rs index 59d5a4e104..cc47eff46e 100644 --- a/gen/pagespeedonline2/src/lib.rs +++ b/gen/pagespeedonline2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *pagespeedonline* crate version *0.1.8+20150317*, where *20150317* is the exact revision of the *pagespeedonline:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *pagespeedonline* crate version *0.1.9+20150317*, where *20150317* is the exact revision of the *pagespeedonline:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *pagespeedonline* *v2* API can be found at the //! [official documentation site](https://developers.google.com/speed/docs/insights/v2/getting-started). diff --git a/gen/pagespeedonline2/src/lib.rs.in b/gen/pagespeedonline2/src/lib.rs.in index c65c7255f3..0bf64faa5e 100644 --- a/gen/pagespeedonline2/src/lib.rs.in +++ b/gen/pagespeedonline2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -108,7 +109,7 @@ impl<'a, C, A> Pagespeedonline Pagespeedonline { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -117,7 +118,7 @@ impl<'a, C, A> Pagespeedonline } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/plus1-cli/Cargo.toml b/gen/plus1-cli/Cargo.toml index f81923d508..d931954425 100644 --- a/gen/plus1-cli/Cargo.toml +++ b/gen/plus1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-plus1-cli" -version = "0.3.1+20150616" +version = "0.3.2+20150719" authors = ["Sebastian Thiel "] description = "A complete library to interact with plus (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/plus1-cli" @@ -17,9 +17,10 @@ keywords = ["plus", "google", "cli"] name = "plus1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/plus1-cli/README.md b/gen/plus1-cli/README.md index ce89bb2a07..29b834356d 100644 --- a/gen/plus1-cli/README.md +++ b/gen/plus1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *plus* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/plus1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/plus1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/plus1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/plus1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/plus1-cli). # Usage -This documentation was generated from the *plus* API at revision *20150616*. The CLI is at version *0.3.1*. +This documentation was generated from the *plus* API at revision *20150719*. The CLI is at version *0.3.2*. ```bash plus1 [options] diff --git a/gen/plus1-cli/mkdocs.yml b/gen/plus1-cli/mkdocs.yml index 4c92864c15..e994a185cc 100644 --- a/gen/plus1-cli/mkdocs.yml +++ b/gen/plus1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: plus v0.3.1+20150616 +site_name: plus v0.3.2+20150719 site_url: http://byron.github.io/google-apis-rs/google-plus1-cli site_description: Write integrating applications with bcore diff --git a/gen/plus1-cli/src/cmn.rs b/gen/plus1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/plus1-cli/src/cmn.rs +++ b/gen/plus1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/plus1-cli/src/main.rs b/gen/plus1-cli/src/main.rs index 3c5b101364..c1ac81360e 100644 --- a/gen/plus1-cli/src/main.rs +++ b/gen/plus1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1355,7 +1356,7 @@ fn main() { let mut app = App::new("plus1") .author("Sebastian Thiel ") - .version("0.3.1+20150616") + .version("0.3.2+20150719") .about("The Google+ API enables developers to build on top of the Google+ platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_plus1_cli") .arg(Arg::with_name("url") @@ -1437,7 +1438,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/plus1/Cargo.toml b/gen/plus1/Cargo.toml index b05eac7cb4..6a0cab78fa 100644 --- a/gen/plus1/Cargo.toml +++ b/gen/plus1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-plus1" -version = "0.1.8+20150616" +version = "0.1.9+20150719" authors = ["Sebastian Thiel "] description = "A complete library to interact with plus (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/plus1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/plus1/README.md b/gen/plus1/README.md index d56d1d4512..c5339f5090 100644 --- a/gen/plus1/README.md +++ b/gen/plus1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-plus1` library allows access to all features of the *Google plus* service. -This documentation was generated from *plus* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *plus* crate version *0.1.9+20150719*, where *20150719* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *plus* *v1* API can be found at the [official documentation site](https://developers.google.com/+/api/). diff --git a/gen/plus1/src/cmn.rs b/gen/plus1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/plus1/src/cmn.rs +++ b/gen/plus1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/plus1/src/lib.rs b/gen/plus1/src/lib.rs index b357128869..feb9756a54 100644 --- a/gen/plus1/src/lib.rs +++ b/gen/plus1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *plus* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *plus* crate version *0.1.9+20150719*, where *20150719* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *plus* *v1* API can be found at the //! [official documentation site](https://developers.google.com/+/api/). diff --git a/gen/plus1/src/lib.rs.in b/gen/plus1/src/lib.rs.in index efcc3926c4..cb6f2d050a 100644 --- a/gen/plus1/src/lib.rs.in +++ b/gen/plus1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -140,7 +141,7 @@ impl<'a, C, A> Plus Plus { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -158,7 +159,7 @@ impl<'a, C, A> Plus } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/plusdomains1-cli/Cargo.toml b/gen/plusdomains1-cli/Cargo.toml index b9cd655a29..f7f0cb0014 100644 --- a/gen/plusdomains1-cli/Cargo.toml +++ b/gen/plusdomains1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-plusdomains1-cli" -version = "0.3.1+20150616" +version = "0.3.2+20150719" authors = ["Sebastian Thiel "] description = "A complete library to interact with plusDomains (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/plusdomains1-cli" @@ -17,9 +17,10 @@ keywords = ["plusDomains", "google", "cli"] name = "plusdomains1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/plusdomains1-cli/README.md b/gen/plusdomains1-cli/README.md index 9e1084948c..45c89b39d1 100644 --- a/gen/plusdomains1-cli/README.md +++ b/gen/plusdomains1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *plusDomains* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/plusdomains1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/plusdomains1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/plusdomains1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/plusdomains1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/plusdomains1-cli). # Usage -This documentation was generated from the *plusDomains* API at revision *20150616*. The CLI is at version *0.3.1*. +This documentation was generated from the *plusDomains* API at revision *20150719*. The CLI is at version *0.3.2*. ```bash plusdomains1 [options] diff --git a/gen/plusdomains1-cli/mkdocs.yml b/gen/plusdomains1-cli/mkdocs.yml index 72d4e96db1..5e52f52a3e 100644 --- a/gen/plusdomains1-cli/mkdocs.yml +++ b/gen/plusdomains1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: plusDomains v0.3.1+20150616 +site_name: plusDomains v0.3.2+20150719 site_url: http://byron.github.io/google-apis-rs/google-plusdomains1-cli site_description: Write integrating applications with bcore diff --git a/gen/plusdomains1-cli/src/cmn.rs b/gen/plusdomains1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/plusdomains1-cli/src/cmn.rs +++ b/gen/plusdomains1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/plusdomains1-cli/src/main.rs b/gen/plusdomains1-cli/src/main.rs index 0f0845b1d6..e5ec090c74 100644 --- a/gen/plusdomains1-cli/src/main.rs +++ b/gen/plusdomains1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -2156,7 +2157,7 @@ fn main() { let mut app = App::new("plusdomains1") .author("Sebastian Thiel ") - .version("0.3.1+20150616") + .version("0.3.2+20150719") .about("The Google+ API enables developers to build on top of the Google+ platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_plusdomains1_cli") .arg(Arg::with_name("url") @@ -2249,7 +2250,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/plusdomains1/Cargo.toml b/gen/plusdomains1/Cargo.toml index 70efe13af4..a025c7053f 100644 --- a/gen/plusdomains1/Cargo.toml +++ b/gen/plusdomains1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-plusdomains1" -version = "0.1.8+20150616" +version = "0.1.9+20150719" authors = ["Sebastian Thiel "] description = "A complete library to interact with plusDomains (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/plusdomains1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/plusdomains1/README.md b/gen/plusdomains1/README.md index 377ebee7d6..20816dd559 100644 --- a/gen/plusdomains1/README.md +++ b/gen/plusdomains1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-plusdomains1` library allows access to all features of the *Google plusDomains* service. -This documentation was generated from *plusDomains* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *plusDomains* crate version *0.1.9+20150719*, where *20150719* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *plusDomains* *v1* API can be found at the [official documentation site](https://developers.google.com/+/domains/). diff --git a/gen/plusdomains1/src/cmn.rs b/gen/plusdomains1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/plusdomains1/src/cmn.rs +++ b/gen/plusdomains1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/plusdomains1/src/lib.rs b/gen/plusdomains1/src/lib.rs index a238edbbfa..aa355d5bde 100644 --- a/gen/plusdomains1/src/lib.rs +++ b/gen/plusdomains1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *plusDomains* crate version *0.1.8+20150616*, where *20150616* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *plusDomains* crate version *0.1.9+20150719*, where *20150719* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *plusDomains* *v1* API can be found at the //! [official documentation site](https://developers.google.com/+/domains/). diff --git a/gen/plusdomains1/src/lib.rs.in b/gen/plusdomains1/src/lib.rs.in index 02da968711..0449e1d4bb 100644 --- a/gen/plusdomains1/src/lib.rs.in +++ b/gen/plusdomains1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -163,7 +164,7 @@ impl<'a, C, A> PlusDomains PlusDomains { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -187,7 +188,7 @@ impl<'a, C, A> PlusDomains } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/prediction1d6-cli/Cargo.toml b/gen/prediction1d6-cli/Cargo.toml index 01562d8ea9..f19371d182 100644 --- a/gen/prediction1d6-cli/Cargo.toml +++ b/gen/prediction1d6-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-prediction1d6-cli" -version = "0.3.1+20140522" +version = "0.3.2+20140522" authors = ["Sebastian Thiel "] description = "A complete library to interact with prediction (protocol v1.6)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/prediction1d6-cli" @@ -17,9 +17,10 @@ keywords = ["prediction", "google", "cli"] name = "prediction1d6" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/prediction1d6-cli/README.md b/gen/prediction1d6-cli/README.md index 3166a0969e..23fbbf1d63 100644 --- a/gen/prediction1d6-cli/README.md +++ b/gen/prediction1d6-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *prediction* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/prediction1d6.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/prediction1d6.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/prediction1d6.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/prediction1d6.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/prediction1d6-cli). # Usage -This documentation was generated from the *prediction* API at revision *20140522*. The CLI is at version *0.3.1*. +This documentation was generated from the *prediction* API at revision *20140522*. The CLI is at version *0.3.2*. ```bash prediction1d6 [options] diff --git a/gen/prediction1d6-cli/mkdocs.yml b/gen/prediction1d6-cli/mkdocs.yml index 75686b1a4c..b5d924ae50 100644 --- a/gen/prediction1d6-cli/mkdocs.yml +++ b/gen/prediction1d6-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: prediction v0.3.1+20140522 +site_name: prediction v0.3.2+20140522 site_url: http://byron.github.io/google-apis-rs/google-prediction1d6-cli site_description: Write integrating applications with bcore diff --git a/gen/prediction1d6-cli/src/cmn.rs b/gen/prediction1d6-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/prediction1d6-cli/src/cmn.rs +++ b/gen/prediction1d6-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/prediction1d6-cli/src/main.rs b/gen/prediction1d6-cli/src/main.rs index a749865cbe..26649ebacc 100644 --- a/gen/prediction1d6-cli/src/main.rs +++ b/gen/prediction1d6-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -961,7 +962,7 @@ fn main() { let mut app = App::new("prediction1d6") .author("Sebastian Thiel ") - .version("0.3.1+20140522") + .version("0.3.2+20140522") .about("Lets you access a cloud hosted machine learning service that makes it easy to build smart apps") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_prediction1d6_cli") .arg(Arg::with_name("url") @@ -1043,7 +1044,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/prediction1d6/Cargo.toml b/gen/prediction1d6/Cargo.toml index dee12fc96d..a4c547bf49 100644 --- a/gen/prediction1d6/Cargo.toml +++ b/gen/prediction1d6/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-prediction1d6" -version = "0.1.8+20140522" +version = "0.1.9+20140522" authors = ["Sebastian Thiel "] description = "A complete library to interact with prediction (protocol v1.6)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/prediction1d6" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/prediction1d6/README.md b/gen/prediction1d6/README.md index 6380693024..e6ec6ef036 100644 --- a/gen/prediction1d6/README.md +++ b/gen/prediction1d6/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-prediction1d6` library allows access to all features of the *Google prediction* service. -This documentation was generated from *prediction* crate version *0.1.8+20140522*, where *20140522* is the exact revision of the *prediction:v1.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *prediction* crate version *0.1.9+20140522*, where *20140522* is the exact revision of the *prediction:v1.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *prediction* *v1d6* API can be found at the [official documentation site](https://developers.google.com/prediction/docs/developer-guide). diff --git a/gen/prediction1d6/src/cmn.rs b/gen/prediction1d6/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/prediction1d6/src/cmn.rs +++ b/gen/prediction1d6/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/prediction1d6/src/lib.rs b/gen/prediction1d6/src/lib.rs index 3c9b312e8c..bbfca58a65 100644 --- a/gen/prediction1d6/src/lib.rs +++ b/gen/prediction1d6/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *prediction* crate version *0.1.8+20140522*, where *20140522* is the exact revision of the *prediction:v1.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *prediction* crate version *0.1.9+20140522*, where *20140522* is the exact revision of the *prediction:v1.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *prediction* *v1d6* API can be found at the //! [official documentation site](https://developers.google.com/prediction/docs/developer-guide). diff --git a/gen/prediction1d6/src/lib.rs.in b/gen/prediction1d6/src/lib.rs.in index 577c8a1119..a5a0b31603 100644 --- a/gen/prediction1d6/src/lib.rs.in +++ b/gen/prediction1d6/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -143,7 +144,7 @@ impl<'a, C, A> Prediction Prediction { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -155,7 +156,7 @@ impl<'a, C, A> Prediction } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/pubsub1_beta2-cli/Cargo.toml b/gen/pubsub1_beta2-cli/Cargo.toml index 7409e71ef2..a9b9ceea11 100644 --- a/gen/pubsub1_beta2-cli/Cargo.toml +++ b/gen/pubsub1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-pubsub1_beta2-cli" -version = "0.3.1+20150427" +version = "0.3.2+20150604" authors = ["Sebastian Thiel "] description = "A complete library to interact with pubsub (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1_beta2-cli" @@ -17,9 +17,10 @@ keywords = ["pubsub", "google", "cli"] name = "pubsub1-beta2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/pubsub1_beta2-cli/README.md b/gen/pubsub1_beta2-cli/README.md index 6fd339019d..89eb51bf5b 100644 --- a/gen/pubsub1_beta2-cli/README.md +++ b/gen/pubsub1_beta2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *pubsub* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/pubsub1-beta2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/pubsub1-beta2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/pubsub1-beta2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/pubsub1-beta2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1_beta2-cli). # Usage -This documentation was generated from the *pubsub* API at revision *20150427*. The CLI is at version *0.3.1*. +This documentation was generated from the *pubsub* API at revision *20150604*. The CLI is at version *0.3.2*. ```bash pubsub1-beta2 [options] diff --git a/gen/pubsub1_beta2-cli/mkdocs.yml b/gen/pubsub1_beta2-cli/mkdocs.yml index b9e4fd80bd..073028fb28 100644 --- a/gen/pubsub1_beta2-cli/mkdocs.yml +++ b/gen/pubsub1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: pubsub v0.3.1+20150427 +site_name: pubsub v0.3.2+20150604 site_url: http://byron.github.io/google-apis-rs/google-pubsub1_beta2-cli site_description: Write integrating applications with bcore diff --git a/gen/pubsub1_beta2-cli/src/cmn.rs b/gen/pubsub1_beta2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/pubsub1_beta2-cli/src/cmn.rs +++ b/gen/pubsub1_beta2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/pubsub1_beta2-cli/src/main.rs b/gen/pubsub1_beta2-cli/src/main.rs index 806de98310..af4f496222 100644 --- a/gen/pubsub1_beta2-cli/src/main.rs +++ b/gen/pubsub1_beta2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1671,7 +1672,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the subscription. It must have the format "projects/{project}/subscriptions/{subscription}" for Google Cloud Pub/Sub API v1beta2. {subscription} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog"."##), + Some(r##"The name of the subscription. It must have the format "projects/{project}/subscriptions/{subscription}" for Google Cloud Pub/Sub API v1 and v1beta2. {subscription} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog"."##), Some(true), Some(false)), @@ -1738,12 +1739,12 @@ fn main() { Some(false)), ]), ("subscriptions-get-iam-policy", - Some(r##"Gets the access control policy for a resource. May be empty if no such policy or resource exists."##), + Some(r##"Gets the access control policy for a resource. Is empty if the policy or the resource does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli/projects_subscriptions-get-iam-policy", vec![ (Some(r##"resource"##), None, - Some(r##"REQUIRED: The resource for which policy is being requested. Usually some path like projects/{project}."##), + Some(r##"REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, projects/{project}."##), Some(true), Some(false)), @@ -1871,7 +1872,7 @@ fn main() { vec![ (Some(r##"resource"##), None, - Some(r##"REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}."##), + Some(r##"REQUIRED: The resource for which policy is being specified. Resource is usually specified as a path, such as, projects/{project}/zones/{zone}/disks/{disk}."##), Some(true), Some(false)), @@ -1899,7 +1900,7 @@ fn main() { vec![ (Some(r##"resource"##), None, - Some(r##"REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}."##), + Some(r##"REQUIRED: The resource for which policy detail is being requested. Resource is usually specified as a path, such as, projects/{project}."##), Some(true), Some(false)), @@ -1927,7 +1928,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the topic. It must have the format "projects/{project}/topics/{topic}" for Google Cloud Pub/Sub API v1beta2. {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog"."##), + Some(r##"The name of the topic. It must have the format "projects/{project}/topics/{topic}" for Google Cloud Pub/Sub API v1 and v1beta2. {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog"."##), Some(true), Some(false)), @@ -1950,7 +1951,7 @@ fn main() { Some(false)), ]), ("topics-delete", - Some(r##"Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted."##), + Some(r##"Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their `topic` field is set to `_deleted-topic_`."##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli/projects_topics-delete", vec![ (Some(r##"topic"##), @@ -1994,12 +1995,12 @@ fn main() { Some(false)), ]), ("topics-get-iam-policy", - Some(r##"Gets the access control policy for a resource. May be empty if no such policy or resource exists."##), + Some(r##"Gets the access control policy for a resource. Is empty if the policy or the resource does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli/projects_topics-get-iam-policy", vec![ (Some(r##"resource"##), None, - Some(r##"REQUIRED: The resource for which policy is being requested. Usually some path like projects/{project}."##), + Some(r##"REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, projects/{project}."##), Some(true), Some(false)), @@ -2071,7 +2072,7 @@ fn main() { vec![ (Some(r##"resource"##), None, - Some(r##"REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}."##), + Some(r##"REQUIRED: The resource for which policy is being specified. Resource is usually specified as a path, such as, projects/{project}/zones/{zone}/disks/{disk}."##), Some(true), Some(false)), @@ -2121,7 +2122,7 @@ fn main() { vec![ (Some(r##"resource"##), None, - Some(r##"REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}."##), + Some(r##"REQUIRED: The resource for which policy detail is being requested. Resource is usually specified as a path, such as, projects/{project}."##), Some(true), Some(false)), @@ -2149,7 +2150,7 @@ fn main() { let mut app = App::new("pubsub1-beta2") .author("Sebastian Thiel ") - .version("0.3.1+20150427") + .version("0.3.2+20150604") .about("Provides reliable, many-to-many, asynchronous messaging between applications.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli") .arg(Arg::with_name("url") @@ -2231,7 +2232,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/pubsub1_beta2/Cargo.toml b/gen/pubsub1_beta2/Cargo.toml index 93c334e5ed..c4ca046505 100644 --- a/gen/pubsub1_beta2/Cargo.toml +++ b/gen/pubsub1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-pubsub1_beta2" -version = "0.1.8+20150427" +version = "0.1.9+20150604" authors = ["Sebastian Thiel "] description = "A complete library to interact with pubsub (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1_beta2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/pubsub1_beta2/README.md b/gen/pubsub1_beta2/README.md index 8ad83b0ef1..17058e785a 100644 --- a/gen/pubsub1_beta2/README.md +++ b/gen/pubsub1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-pubsub1_beta2` library allows access to all features of the *Google pubsub* service. -This documentation was generated from *pubsub* crate version *0.1.8+20150427*, where *20150427* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *pubsub* crate version *0.1.9+20150604*, where *20150604* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *pubsub* *v1_beta2* API can be found at the [official documentation site](https://cloud.google.com/pubsub/docs). diff --git a/gen/pubsub1_beta2/src/cmn.rs b/gen/pubsub1_beta2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/pubsub1_beta2/src/cmn.rs +++ b/gen/pubsub1_beta2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/pubsub1_beta2/src/lib.rs b/gen/pubsub1_beta2/src/lib.rs index 2debc69f5d..a6cadc8849 100644 --- a/gen/pubsub1_beta2/src/lib.rs +++ b/gen/pubsub1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *pubsub* crate version *0.1.8+20150427*, where *20150427* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *pubsub* crate version *0.1.9+20150604*, where *20150604* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *pubsub* *v1_beta2* API can be found at the //! [official documentation site](https://cloud.google.com/pubsub/docs). diff --git a/gen/pubsub1_beta2/src/lib.rs.in b/gen/pubsub1_beta2/src/lib.rs.in index 0d2674e113..d69870e280 100644 --- a/gen/pubsub1_beta2/src/lib.rs.in +++ b/gen/pubsub1_beta2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -135,7 +136,7 @@ impl<'a, C, A> Pubsub Pubsub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -144,7 +145,7 @@ impl<'a, C, A> Pubsub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -294,7 +295,7 @@ pub struct ModifyAckDeadlineRequest { /// The new ack deadline with respect to the time this request was sent to the Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack deadline will expire 10 seconds after the ModifyAckDeadline call was made. Specifying zero may immediately make the message available for another pull request. #[serde(rename="ackDeadlineSeconds")] pub ack_deadline_seconds: Option, - /// The acknowledgment ID. + /// The acknowledgment ID. Either this or ack_ids must be populated, but not both. #[serde(rename="ackId")] pub ack_id: Option, /// List of acknowledgment IDs. @@ -339,7 +340,7 @@ pub struct PushConfig { impl Part for PushConfig {} -/// # Overview The `Policy` defines an access control policy language. It can be used to define policies that can be attached to resources like files, folders, VMs, etc. # Policy structure A `Policy` consists of a list of bindings. A `Binding` binds a set of members to a role, where the members can include user accounts, user groups, user domains, and service accounts. A role is a named set of permissions, defined by the IAM system. The definition of a role is outside the policy. A permission check involves determining the roles that include the specified permission, and then determining if the principal specified by the check is a member of a binding to at least one of these roles. The membership check is recursive when a group is bound to a role. Policy examples: ``` { "bindings": [ { "role": "roles/owner", "members": [ "user:mike@example.com", "group::admins@example.com", "domain:google.com", "serviceAccount:frontend@example.iam.gserviceaccounts.com"] }, { "role": "roles/viewer", "members": ["user:sean@example.com"] } ] } ``` +/// # Overview The `Policy` defines an access control policy language. It is used to define policies that are attached to resources like files, folders, VMs, etc. # Policy structure A `Policy` consists of a list of bindings. A `Binding` binds a set of members to a role, where the members include user accounts, user groups, user domains, and service accounts. A 'role' is a named set of permissions, defined by IAM. The definition of a role is outside the policy. A permission check first determines the roles that include the specified permission, and then determines if the principal specified is a member of a binding to at least one of these roles. The membership check is recursive when a group is bound to a role. Policy examples: ``` { "bindings": [ { "role": "roles/owner", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:frontend@example.iam.gserviceaccounts.com"] }, { "role": "roles/viewer", "members": ["user:sean@example.com"] } ] } ``` /// /// # Activities /// @@ -357,7 +358,7 @@ pub struct Policy { pub rules: Option>, /// It is an error to specify multiple bindings for the same role. It is an error to specify a binding with no members. pub bindings: Option>, - /// The policy language version. The version of the policy itself is represented by the etag. The current version is 0. + /// The policy language version. The version of the policy is represented by the etag. The default version is 0. pub version: Option, /// Can be used to perform a read-modify-write. pub etag: Option, @@ -427,7 +428,7 @@ pub struct ModifyPushConfigRequest { impl RequestValue for ModifyPushConfigRequest {} -/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } +/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`. /// /// # Activities /// @@ -512,7 +513,7 @@ pub struct PullRequest { impl RequestValue for PullRequest {} -/// Associates members of various types with roles. See below for details of the various objects that can be included as members. +/// Associates members with roles. See below for allowed formats of members. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -549,7 +550,7 @@ impl Part for DataAccessOptions {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Topic { - /// The name of the topic. It must have the format "projects/{project}/topics/{topic}" for Google Cloud Pub/Sub API v1beta2. {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog". + /// The name of the topic. It must have the format "projects/{project}/topics/{topic}" for Google Cloud Pub/Sub API v1 and v1beta2. {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog". pub name: Option, } @@ -667,7 +668,7 @@ impl Part for Condition {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Subscription { - /// The name of the topic from which this subscription is receiving messages. This will be present if and only if the subscription has not been detached from its topic. + /// The name of the topic from which this subscription is receiving messages. The value of this field will be `_deleted-topic_` if the topic has been deleted. pub topic: Option, /// This value is the maximum time after a subscriber receives a message before the subscriber should acknowledge the message. After message delivery but before the ack deadline expires and before the message is acknowledged, it is an outstanding message and will not be delivered again during that time (on a best-effort basis). For pull delivery this value is used as the initial value for the ack deadline. It may be overridden for each message using its corresponding ack_id by calling ModifyAckDeadline. For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. If this parameter is not set, the default value of 60 seconds is used. #[serde(rename="ackDeadlineSeconds")] @@ -675,7 +676,7 @@ pub struct Subscription { /// If push delivery is used with this subscription, this field is used to configure it. An empty pushConfig signifies that the subscriber will pull and ack messages using API methods. #[serde(rename="pushConfig")] pub push_config: Option, - /// The name of the subscription. It must have the format "projects/{project}/subscriptions/{subscription}" for Google Cloud Pub/Sub API v1beta2. {subscription} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog". + /// The name of the subscription. It must have the format "projects/{project}/subscriptions/{subscription}" for Google Cloud Pub/Sub API v1 and v1beta2. {subscription} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog". pub name: Option, } @@ -771,7 +772,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the topic. It must have the format "projects/{project}/topics/{topic}" for Google Cloud Pub/Sub API v1beta2. {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog". + /// * `name` - The name of the topic. It must have the format "projects/{project}/topics/{topic}" for Google Cloud Pub/Sub API v1 and v1beta2. {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog". pub fn topics_create(&self, request: Topic, name: &str) -> ProjectTopicCreateCall<'a, C, A> { ProjectTopicCreateCall { hub: self.hub, @@ -790,7 +791,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}. + /// * `resource` - REQUIRED: The resource for which policy detail is being requested. Resource is usually specified as a path, such as, projects/{project}. pub fn topics_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectTopicTestIamPermissionCall<'a, C, A> { ProjectTopicTestIamPermissionCall { hub: self.hub, @@ -859,11 +860,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the access control policy for a resource. May be empty if no such policy or resource exists. + /// Gets the access control policy for a resource. Is empty if the policy or the resource does not exist. /// /// # Arguments /// - /// * `resource` - REQUIRED: The resource for which policy is being requested. Usually some path like projects/{project}. + /// * `resource` - REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, projects/{project}. pub fn topics_get_iam_policy(&self, resource: &str) -> ProjectTopicGetIamPolicyCall<'a, C, A> { ProjectTopicGetIamPolicyCall { hub: self.hub, @@ -917,7 +918,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}. + /// * `resource` - REQUIRED: The resource for which policy is being specified. Resource is usually specified as a path, such as, projects/{project}/zones/{zone}/disks/{disk}. pub fn topics_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectTopicSetIamPolicyCall<'a, C, A> { ProjectTopicSetIamPolicyCall { hub: self.hub, @@ -936,7 +937,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the subscription. It must have the format "projects/{project}/subscriptions/{subscription}" for Google Cloud Pub/Sub API v1beta2. {subscription} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog". + /// * `name` - The name of the subscription. It must have the format "projects/{project}/subscriptions/{subscription}" for Google Cloud Pub/Sub API v1 and v1beta2. {subscription} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog". pub fn subscriptions_create(&self, request: Subscription, name: &str) -> ProjectSubscriptionCreateCall<'a, C, A> { ProjectSubscriptionCreateCall { hub: self.hub, @@ -969,11 +970,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the access control policy for a resource. May be empty if no such policy or resource exists. + /// Gets the access control policy for a resource. Is empty if the policy or the resource does not exist. /// /// # Arguments /// - /// * `resource` - REQUIRED: The resource for which policy is being requested. Usually some path like projects/{project}. + /// * `resource` - REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, projects/{project}. pub fn subscriptions_get_iam_policy(&self, resource: &str) -> ProjectSubscriptionGetIamPolicyCall<'a, C, A> { ProjectSubscriptionGetIamPolicyCall { hub: self.hub, @@ -991,7 +992,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}. + /// * `resource` - REQUIRED: The resource for which policy detail is being requested. Resource is usually specified as a path, such as, projects/{project}. pub fn subscriptions_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectSubscriptionTestIamPermissionCall<'a, C, A> { ProjectSubscriptionTestIamPermissionCall { hub: self.hub, @@ -1005,7 +1006,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted. + /// Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their `topic` field is set to `_deleted-topic_`. /// /// # Arguments /// @@ -1082,7 +1083,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}. + /// * `resource` - REQUIRED: The resource for which policy is being specified. Resource is usually specified as a path, such as, projects/{project}/zones/{zone}/disks/{disk}. pub fn subscriptions_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectSubscriptionSetIamPolicyCall<'a, C, A> { ProjectSubscriptionSetIamPolicyCall { hub: self.hub, @@ -1859,7 +1860,7 @@ impl<'a, C, A> ProjectTopicCreateCall<'a, C, A> where C: BorrowMut ProjectTopicTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectTopicGetCall<'a, C, A> where C: BorrowMut, } -/// Gets the access control policy for a resource. May be empty if no such policy or resource exists. +/// Gets the access control policy for a resource. Is empty if the policy or the resource does not exist. /// /// A builder for the *topics.getIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -3182,7 +3183,7 @@ impl<'a, C, A> ProjectTopicGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectTopicSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSubscriptionCreateCall<'a, C, A> where C: BorrowMut ProjectSubscriptionAcknowledgeCall<'a, C, A> where C: BorrowMut ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< } - /// REQUIRED: The resource for which policy is being requested. Usually some path like projects/{project}. + /// REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, projects/{project}. /// /// Sets the *resource* path property to the given value. /// @@ -5059,7 +5060,7 @@ impl<'a, C, A> ProjectSubscriptionTestIamPermissionCall<'a, C, A> where C: Borro self._request = new_value; self } - /// REQUIRED: The resource for which policy detail is being requested. Usually some path like projects/{project}. + /// REQUIRED: The resource for which policy detail is being requested. Resource is usually specified as a path, such as, projects/{project}. /// /// Sets the *resource* path property to the given value. /// @@ -5127,7 +5128,7 @@ impl<'a, C, A> ProjectSubscriptionTestIamPermissionCall<'a, C, A> where C: Borro } -/// Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted. +/// Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their `topic` field is set to `_deleted-topic_`. /// /// A builder for the *topics.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -6368,7 +6369,7 @@ impl<'a, C, A> ProjectSubscriptionSetIamPolicyCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// REQUIRED: The resource for which policy is being specified. Usually some path like projects/{project}/zones/{zone}/disks/{disk}. + /// REQUIRED: The resource for which policy is being specified. Resource is usually specified as a path, such as, projects/{project}/zones/{zone}/disks/{disk}. /// /// Sets the *resource* path property to the given value. /// diff --git a/gen/qpxexpress1-cli/Cargo.toml b/gen/qpxexpress1-cli/Cargo.toml index 391427e005..975623e757 100644 --- a/gen/qpxexpress1-cli/Cargo.toml +++ b/gen/qpxexpress1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-qpxexpress1-cli" -version = "0.3.1+20140321" +version = "0.3.2+20140321" authors = ["Sebastian Thiel "] description = "A complete library to interact with QPX Express (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/qpxexpress1-cli" @@ -17,9 +17,10 @@ keywords = ["qpxExpress", "google", "cli"] name = "qpxexpress1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/qpxexpress1-cli/README.md b/gen/qpxexpress1-cli/README.md index 2a675c1b4c..e5329365f6 100644 --- a/gen/qpxexpress1-cli/README.md +++ b/gen/qpxexpress1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *QPX Express* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/qpxexpress1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/qpxexpress1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/qpxexpress1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/qpxexpress1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/qpxexpress1-cli). # Usage -This documentation was generated from the *QPX Express* API at revision *20140321*. The CLI is at version *0.3.1*. +This documentation was generated from the *QPX Express* API at revision *20140321*. The CLI is at version *0.3.2*. ```bash qpxexpress1 [options] diff --git a/gen/qpxexpress1-cli/mkdocs.yml b/gen/qpxexpress1-cli/mkdocs.yml index 55ace66e59..3808ddeabf 100644 --- a/gen/qpxexpress1-cli/mkdocs.yml +++ b/gen/qpxexpress1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: QPX Express v0.3.1+20140321 +site_name: QPX Express v0.3.2+20140321 site_url: http://byron.github.io/google-apis-rs/google-qpxexpress1-cli site_description: Write integrating applications with bcore diff --git a/gen/qpxexpress1-cli/src/cmn.rs b/gen/qpxexpress1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/qpxexpress1-cli/src/cmn.rs +++ b/gen/qpxexpress1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/qpxexpress1-cli/src/main.rs b/gen/qpxexpress1-cli/src/main.rs index 71e7c0f4fb..3e4c76d290 100644 --- a/gen/qpxexpress1-cli/src/main.rs +++ b/gen/qpxexpress1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -262,7 +263,7 @@ fn main() { let mut app = App::new("qpxexpress1") .author("Sebastian Thiel ") - .version("0.3.1+20140321") + .version("0.3.2+20140321") .about("Lets you find the least expensive flights between an origin and a destination.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_qpxexpress1_cli") .arg(Arg::with_name("folder") @@ -339,7 +340,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/qpxexpress1/Cargo.toml b/gen/qpxexpress1/Cargo.toml index 4fef2d7362..ec5dc44f52 100644 --- a/gen/qpxexpress1/Cargo.toml +++ b/gen/qpxexpress1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-qpxexpress1" -version = "0.1.8+20140321" +version = "0.1.9+20140321" authors = ["Sebastian Thiel "] description = "A complete library to interact with QPX Express (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/qpxexpress1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/qpxexpress1/README.md b/gen/qpxexpress1/README.md index 044be9c773..dd556afb0f 100644 --- a/gen/qpxexpress1/README.md +++ b/gen/qpxexpress1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-qpxexpress1` library allows access to all features of the *Google QPX Express* service. -This documentation was generated from *QPX Express* crate version *0.1.8+20140321*, where *20140321* is the exact revision of the *qpxExpress:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *QPX Express* crate version *0.1.9+20140321*, where *20140321* is the exact revision of the *qpxExpress:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *QPX Express* *v1* API can be found at the [official documentation site](http://developers.google.com/qpx-express). diff --git a/gen/qpxexpress1/src/cmn.rs b/gen/qpxexpress1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/qpxexpress1/src/cmn.rs +++ b/gen/qpxexpress1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/qpxexpress1/src/lib.rs b/gen/qpxexpress1/src/lib.rs index 442079badb..5626ad514a 100644 --- a/gen/qpxexpress1/src/lib.rs +++ b/gen/qpxexpress1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *QPX Express* crate version *0.1.8+20140321*, where *20140321* is the exact revision of the *qpxExpress:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *QPX Express* crate version *0.1.9+20140321*, where *20140321* is the exact revision of the *qpxExpress:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *QPX Express* *v1* API can be found at the //! [official documentation site](http://developers.google.com/qpx-express). diff --git a/gen/qpxexpress1/src/lib.rs.in b/gen/qpxexpress1/src/lib.rs.in index f055961a46..318fc1c0f3 100644 --- a/gen/qpxexpress1/src/lib.rs.in +++ b/gen/qpxexpress1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -109,7 +110,7 @@ impl<'a, C, A> QPXExpress QPXExpress { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -118,7 +119,7 @@ impl<'a, C, A> QPXExpress } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/replicapool1_beta2-cli/Cargo.toml b/gen/replicapool1_beta2-cli/Cargo.toml index 771ee076ff..ad00dc118b 100644 --- a/gen/replicapool1_beta2-cli/Cargo.toml +++ b/gen/replicapool1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-replicapool1_beta2-cli" -version = "0.3.1+20150311" +version = "0.3.2+20150708" authors = ["Sebastian Thiel "] description = "A complete library to interact with replicapool (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/replicapool1_beta2-cli" @@ -17,9 +17,10 @@ keywords = ["replicapool", "google", "cli"] name = "replicapool1-beta2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/replicapool1_beta2-cli/README.md b/gen/replicapool1_beta2-cli/README.md index 4eaac398c8..99035b84d2 100644 --- a/gen/replicapool1_beta2-cli/README.md +++ b/gen/replicapool1_beta2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *replicapool* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/replicapool1-beta2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/replicapool1-beta2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/replicapool1-beta2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/replicapool1-beta2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/replicapool1_beta2-cli). # Usage -This documentation was generated from the *replicapool* API at revision *20150311*. The CLI is at version *0.3.1*. +This documentation was generated from the *replicapool* API at revision *20150708*. The CLI is at version *0.3.2*. ```bash replicapool1-beta2 [options] diff --git a/gen/replicapool1_beta2-cli/mkdocs.yml b/gen/replicapool1_beta2-cli/mkdocs.yml index f3b4c1571c..4563612495 100644 --- a/gen/replicapool1_beta2-cli/mkdocs.yml +++ b/gen/replicapool1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: replicapool v0.3.1+20150311 +site_name: replicapool v0.3.2+20150708 site_url: http://byron.github.io/google-apis-rs/google-replicapool1_beta2-cli site_description: Write integrating applications with bcore diff --git a/gen/replicapool1_beta2-cli/src/cmn.rs b/gen/replicapool1_beta2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/replicapool1_beta2-cli/src/cmn.rs +++ b/gen/replicapool1_beta2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/replicapool1_beta2-cli/src/main.rs b/gen/replicapool1_beta2-cli/src/main.rs index ac91e97240..d4c570bb08 100644 --- a/gen/replicapool1_beta2-cli/src/main.rs +++ b/gen/replicapool1_beta2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1488,7 +1489,7 @@ fn main() { let mut app = App::new("replicapool1-beta2") .author("Sebastian Thiel ") - .version("0.3.1+20150311") + .version("0.3.2+20150708") .about("The Google Compute Engine Instance Group Manager 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") @@ -1570,7 +1571,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/replicapool1_beta2/Cargo.toml b/gen/replicapool1_beta2/Cargo.toml index ddcee45875..5952e9914e 100644 --- a/gen/replicapool1_beta2/Cargo.toml +++ b/gen/replicapool1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-replicapool1_beta2" -version = "0.1.8+20150311" +version = "0.1.9+20150708" authors = ["Sebastian Thiel "] description = "A complete library to interact with replicapool (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/replicapool1_beta2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/replicapool1_beta2/README.md b/gen/replicapool1_beta2/README.md index f6d49af98f..4c5e38b53f 100644 --- a/gen/replicapool1_beta2/README.md +++ b/gen/replicapool1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-replicapool1_beta2` library allows access to all features of the *Google replicapool* service. -This documentation was generated from *replicapool* crate version *0.1.8+20150311*, where *20150311* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *replicapool* crate version *0.1.9+20150708*, where *20150708* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *replicapool* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/compute/docs/instance-groups/manager/v1beta2). diff --git a/gen/replicapool1_beta2/src/cmn.rs b/gen/replicapool1_beta2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/replicapool1_beta2/src/cmn.rs +++ b/gen/replicapool1_beta2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/replicapool1_beta2/src/lib.rs b/gen/replicapool1_beta2/src/lib.rs index ffd2f2e0dc..1edc4eff3f 100644 --- a/gen/replicapool1_beta2/src/lib.rs +++ b/gen/replicapool1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *replicapool* crate version *0.1.8+20150311*, where *20150311* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *replicapool* crate version *0.1.9+20150708*, where *20150708* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *replicapool* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/compute/docs/instance-groups/manager/v1beta2). diff --git a/gen/replicapool1_beta2/src/lib.rs.in b/gen/replicapool1_beta2/src/lib.rs.in index e899528d4a..a21d4ff4c3 100644 --- a/gen/replicapool1_beta2/src/lib.rs.in +++ b/gen/replicapool1_beta2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -136,7 +137,7 @@ impl<'a, C, A> Replicapool Replicapool { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -148,7 +149,7 @@ impl<'a, C, A> Replicapool } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -415,6 +416,9 @@ pub struct ReplicaPoolAutoHealingPolicy { /// The URL for the HealthCheck that signals autohealing. #[serde(rename="healthCheck")] pub health_check: Option, + /// The action to perform when an instance becomes unhealthy. Possible values are RECREATE or REBOOT. RECREATE replaces an unhealthy instance with a new instance that is based on the instance template for this managed instance group. REBOOT performs a soft reboot on an instance. If the instance cannot reboot, the instance performs a hard restart. + #[serde(rename="actionType")] + pub action_type: Option, } impl Part for ReplicaPoolAutoHealingPolicy {} diff --git a/gen/replicapoolupdater1_beta1-cli/Cargo.toml b/gen/replicapoolupdater1_beta1-cli/Cargo.toml index b18d6aa9aa..2c9dd374d3 100644 --- a/gen/replicapoolupdater1_beta1-cli/Cargo.toml +++ b/gen/replicapoolupdater1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-replicapoolupdater1_beta1-cli" -version = "0.3.1+20150326" +version = "0.3.2+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with replicapoolupdater (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/replicapoolupdater1_beta1-cli" @@ -17,9 +17,10 @@ keywords = ["replicapoolupdater", "google", "cli"] name = "replicapoolupdater1-beta1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/replicapoolupdater1_beta1-cli/README.md b/gen/replicapoolupdater1_beta1-cli/README.md index aa4eb36aae..8a6c67f402 100644 --- a/gen/replicapoolupdater1_beta1-cli/README.md +++ b/gen/replicapoolupdater1_beta1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *replicapoolupdater* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/replicapoolupdater1-beta1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/replicapoolupdater1-beta1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/replicapoolupdater1-beta1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/replicapoolupdater1-beta1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/replicapoolupdater1_beta1-cli). # Usage -This documentation was generated from the *replicapoolupdater* API at revision *20150326*. The CLI is at version *0.3.1*. +This documentation was generated from the *replicapoolupdater* API at revision *20150326*. The CLI is at version *0.3.2*. ```bash replicapoolupdater1-beta1 [options] diff --git a/gen/replicapoolupdater1_beta1-cli/mkdocs.yml b/gen/replicapoolupdater1_beta1-cli/mkdocs.yml index 71b77729d9..013006c580 100644 --- a/gen/replicapoolupdater1_beta1-cli/mkdocs.yml +++ b/gen/replicapoolupdater1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: replicapoolupdater v0.3.1+20150326 +site_name: replicapoolupdater v0.3.2+20150326 site_url: http://byron.github.io/google-apis-rs/google-replicapoolupdater1_beta1-cli site_description: Write integrating applications with bcore diff --git a/gen/replicapoolupdater1_beta1-cli/src/cmn.rs b/gen/replicapoolupdater1_beta1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/replicapoolupdater1_beta1-cli/src/cmn.rs +++ b/gen/replicapoolupdater1_beta1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/replicapoolupdater1_beta1-cli/src/main.rs b/gen/replicapoolupdater1_beta1-cli/src/main.rs index 8a246fd8ac..c3c06530fb 100644 --- a/gen/replicapoolupdater1_beta1-cli/src/main.rs +++ b/gen/replicapoolupdater1_beta1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1025,7 +1026,7 @@ fn main() { let mut app = App::new("replicapoolupdater1-beta1") .author("Sebastian Thiel ") - .version("0.3.1+20150326") + .version("0.3.2+20150326") .about("The Google Compute Engine Instance Group Updater API provides services for updating groups of Compute Engine Instances.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_replicapoolupdater1_beta1_cli") .arg(Arg::with_name("url") @@ -1107,7 +1108,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/replicapoolupdater1_beta1/Cargo.toml b/gen/replicapoolupdater1_beta1/Cargo.toml index 2c54b8dff2..3592a0f19d 100644 --- a/gen/replicapoolupdater1_beta1/Cargo.toml +++ b/gen/replicapoolupdater1_beta1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-replicapoolupdater1_beta1" -version = "0.1.8+20150326" +version = "0.1.9+20150326" authors = ["Sebastian Thiel "] description = "A complete library to interact with replicapoolupdater (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/replicapoolupdater1_beta1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/replicapoolupdater1_beta1/README.md b/gen/replicapoolupdater1_beta1/README.md index a6809e36bd..c90e4a5224 100644 --- a/gen/replicapoolupdater1_beta1/README.md +++ b/gen/replicapoolupdater1_beta1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-replicapoolupdater1_beta1` library allows access to all features of the *Google replicapoolupdater* service. -This documentation was generated from *replicapoolupdater* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *replicapoolupdater:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *replicapoolupdater* crate version *0.1.9+20150326*, where *20150326* is the exact revision of the *replicapoolupdater:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *replicapoolupdater* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_service). diff --git a/gen/replicapoolupdater1_beta1/src/cmn.rs b/gen/replicapoolupdater1_beta1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/replicapoolupdater1_beta1/src/cmn.rs +++ b/gen/replicapoolupdater1_beta1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/replicapoolupdater1_beta1/src/lib.rs b/gen/replicapoolupdater1_beta1/src/lib.rs index 0ef67a91fa..a5bd0058d5 100644 --- a/gen/replicapoolupdater1_beta1/src/lib.rs +++ b/gen/replicapoolupdater1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *replicapoolupdater* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *replicapoolupdater:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *replicapoolupdater* crate version *0.1.9+20150326*, where *20150326* is the exact revision of the *replicapoolupdater:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *replicapoolupdater* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_service). diff --git a/gen/replicapoolupdater1_beta1/src/lib.rs.in b/gen/replicapoolupdater1_beta1/src/lib.rs.in index 5e613a3413..88489715d4 100644 --- a/gen/replicapoolupdater1_beta1/src/lib.rs.in +++ b/gen/replicapoolupdater1_beta1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -137,7 +138,7 @@ impl<'a, C, A> Replicapoolupdater Replicapoolupdater { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -149,7 +150,7 @@ impl<'a, C, A> Replicapoolupdater } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/reseller1_sandbox-cli/Cargo.toml b/gen/reseller1_sandbox-cli/Cargo.toml index bd966fd25c..cc054ce87b 100644 --- a/gen/reseller1_sandbox-cli/Cargo.toml +++ b/gen/reseller1_sandbox-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-reseller1_sandbox-cli" -version = "0.3.1+20150603" +version = "0.3.2+20150603" authors = ["Sebastian Thiel "] description = "A complete library to interact with reseller (protocol v1sandbox)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/reseller1_sandbox-cli" @@ -17,9 +17,10 @@ keywords = ["reseller", "google", "cli"] name = "reseller1-sandbox" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/reseller1_sandbox-cli/README.md b/gen/reseller1_sandbox-cli/README.md index d563c7b31d..7b82542d85 100644 --- a/gen/reseller1_sandbox-cli/README.md +++ b/gen/reseller1_sandbox-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *reseller* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/reseller1-sandbox.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/reseller1-sandbox.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/reseller1-sandbox.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/reseller1-sandbox.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/reseller1_sandbox-cli). # Usage -This documentation was generated from the *reseller* API at revision *20150603*. The CLI is at version *0.3.1*. +This documentation was generated from the *reseller* API at revision *20150603*. The CLI is at version *0.3.2*. ```bash reseller1-sandbox [options] diff --git a/gen/reseller1_sandbox-cli/mkdocs.yml b/gen/reseller1_sandbox-cli/mkdocs.yml index c8d2d2fc7c..7ee0fe7032 100644 --- a/gen/reseller1_sandbox-cli/mkdocs.yml +++ b/gen/reseller1_sandbox-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: reseller v0.3.1+20150603 +site_name: reseller v0.3.2+20150603 site_url: http://byron.github.io/google-apis-rs/google-reseller1_sandbox-cli site_description: Write integrating applications with bcore diff --git a/gen/reseller1_sandbox-cli/src/cmn.rs b/gen/reseller1_sandbox-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/reseller1_sandbox-cli/src/cmn.rs +++ b/gen/reseller1_sandbox-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/reseller1_sandbox-cli/src/main.rs b/gen/reseller1_sandbox-cli/src/main.rs index 8dcce674f9..500515edcd 100644 --- a/gen/reseller1_sandbox-cli/src/main.rs +++ b/gen/reseller1_sandbox-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1638,7 +1639,7 @@ fn main() { let mut app = App::new("reseller1-sandbox") .author("Sebastian Thiel ") - .version("0.3.1+20150603") + .version("0.3.2+20150603") .about("Lets you create and manage your customers and their subscriptions.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_reseller1_sandbox_cli") .arg(Arg::with_name("url") @@ -1720,7 +1721,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/reseller1_sandbox/Cargo.toml b/gen/reseller1_sandbox/Cargo.toml index 6ec63e9bdd..9d8b35120c 100644 --- a/gen/reseller1_sandbox/Cargo.toml +++ b/gen/reseller1_sandbox/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-reseller1_sandbox" -version = "0.1.8+20150603" +version = "0.1.9+20150603" authors = ["Sebastian Thiel "] description = "A complete library to interact with reseller (protocol v1sandbox)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/reseller1_sandbox" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/reseller1_sandbox/README.md b/gen/reseller1_sandbox/README.md index 2fe0d7dd08..58f083357e 100644 --- a/gen/reseller1_sandbox/README.md +++ b/gen/reseller1_sandbox/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-reseller1_sandbox` library allows access to all features of the *Google reseller* service. -This documentation was generated from *reseller* crate version *0.1.8+20150603*, where *20150603* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *reseller* crate version *0.1.9+20150603*, where *20150603* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *reseller* *v1_sandbox* API can be found at the [official documentation site](https://developers.google.com/google-apps/reseller/). diff --git a/gen/reseller1_sandbox/src/cmn.rs b/gen/reseller1_sandbox/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/reseller1_sandbox/src/cmn.rs +++ b/gen/reseller1_sandbox/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/reseller1_sandbox/src/lib.rs b/gen/reseller1_sandbox/src/lib.rs index 1ab281238b..f7af61dc43 100644 --- a/gen/reseller1_sandbox/src/lib.rs +++ b/gen/reseller1_sandbox/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *reseller* crate version *0.1.8+20150603*, where *20150603* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *reseller* crate version *0.1.9+20150603*, where *20150603* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *reseller* *v1_sandbox* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/reseller/). diff --git a/gen/reseller1_sandbox/src/lib.rs.in b/gen/reseller1_sandbox/src/lib.rs.in index d2851a2bff..fd05c310df 100644 --- a/gen/reseller1_sandbox/src/lib.rs.in +++ b/gen/reseller1_sandbox/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -134,7 +135,7 @@ impl<'a, C, A> Reseller Reseller { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -146,7 +147,7 @@ impl<'a, C, A> Reseller } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/resourceviews1_beta2-cli/Cargo.toml b/gen/resourceviews1_beta2-cli/Cargo.toml index 3ca344b83d..1b99bfa880 100644 --- a/gen/resourceviews1_beta2-cli/Cargo.toml +++ b/gen/resourceviews1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-resourceviews1_beta2-cli" -version = "0.3.1+20150326" +version = "0.3.2+20150708" authors = ["Sebastian Thiel "] description = "A complete library to interact with resourceviews (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/resourceviews1_beta2-cli" @@ -17,9 +17,10 @@ keywords = ["resourceviews", "google", "cli"] name = "resourceviews1-beta2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/resourceviews1_beta2-cli/README.md b/gen/resourceviews1_beta2-cli/README.md index 8cee47f531..a0ac838693 100644 --- a/gen/resourceviews1_beta2-cli/README.md +++ b/gen/resourceviews1_beta2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *resourceviews* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/resourceviews1-beta2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/resourceviews1-beta2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/resourceviews1-beta2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/resourceviews1-beta2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/resourceviews1_beta2-cli). # Usage -This documentation was generated from the *resourceviews* API at revision *20150326*. The CLI is at version *0.3.1*. +This documentation was generated from the *resourceviews* API at revision *20150708*. The CLI is at version *0.3.2*. ```bash resourceviews1-beta2 [options] diff --git a/gen/resourceviews1_beta2-cli/mkdocs.yml b/gen/resourceviews1_beta2-cli/mkdocs.yml index dc8bc3a15a..4cd20d6c65 100644 --- a/gen/resourceviews1_beta2-cli/mkdocs.yml +++ b/gen/resourceviews1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: resourceviews v0.3.1+20150326 +site_name: resourceviews v0.3.2+20150708 site_url: http://byron.github.io/google-apis-rs/google-resourceviews1_beta2-cli site_description: Write integrating applications with bcore diff --git a/gen/resourceviews1_beta2-cli/src/cmn.rs b/gen/resourceviews1_beta2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/resourceviews1_beta2-cli/src/cmn.rs +++ b/gen/resourceviews1_beta2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/resourceviews1_beta2-cli/src/main.rs b/gen/resourceviews1_beta2-cli/src/main.rs index 6ea559f440..3e40e09b0e 100644 --- a/gen/resourceviews1_beta2-cli/src/main.rs +++ b/gen/resourceviews1_beta2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1321,7 +1322,7 @@ fn main() { let mut app = App::new("resourceviews1-beta2") .author("Sebastian Thiel ") - .version("0.3.1+20150326") + .version("0.3.2+20150708") .about("The Resource View API allows users to create and manage logical sets of Google Compute Engine instances.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_resourceviews1_beta2_cli") .arg(Arg::with_name("url") @@ -1403,7 +1404,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/resourceviews1_beta2/Cargo.toml b/gen/resourceviews1_beta2/Cargo.toml index e40984823d..78cd85f9d3 100644 --- a/gen/resourceviews1_beta2/Cargo.toml +++ b/gen/resourceviews1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-resourceviews1_beta2" -version = "0.1.8+20150326" +version = "0.1.9+20150708" authors = ["Sebastian Thiel "] description = "A complete library to interact with resourceviews (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/resourceviews1_beta2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/resourceviews1_beta2/README.md b/gen/resourceviews1_beta2/README.md index 675a713595..3c5caae412 100644 --- a/gen/resourceviews1_beta2/README.md +++ b/gen/resourceviews1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-resourceviews1_beta2` library allows access to all features of the *Google resourceviews* service. -This documentation was generated from *resourceviews* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *resourceviews* crate version *0.1.9+20150708*, where *20150708* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *resourceviews* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/compute/). diff --git a/gen/resourceviews1_beta2/src/cmn.rs b/gen/resourceviews1_beta2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/resourceviews1_beta2/src/cmn.rs +++ b/gen/resourceviews1_beta2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/resourceviews1_beta2/src/lib.rs b/gen/resourceviews1_beta2/src/lib.rs index e99a7511ab..533ebe3543 100644 --- a/gen/resourceviews1_beta2/src/lib.rs +++ b/gen/resourceviews1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *resourceviews* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *resourceviews* crate version *0.1.9+20150708*, where *20150708* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *resourceviews* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/compute/). diff --git a/gen/resourceviews1_beta2/src/lib.rs.in b/gen/resourceviews1_beta2/src/lib.rs.in index e1b81a09ac..4bc2685813 100644 --- a/gen/resourceviews1_beta2/src/lib.rs.in +++ b/gen/resourceviews1_beta2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -147,7 +148,7 @@ impl<'a, C, A> Resourceviews Resourceviews { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -159,7 +160,7 @@ impl<'a, C, A> Resourceviews } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/siteverification1-cli/Cargo.toml b/gen/siteverification1-cli/Cargo.toml index 705cd57e42..90d5924587 100644 --- a/gen/siteverification1-cli/Cargo.toml +++ b/gen/siteverification1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-siteverification1-cli" -version = "0.3.1+20131007" +version = "0.3.2+20131007" authors = ["Sebastian Thiel "] description = "A complete library to interact with siteVerification (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/siteverification1-cli" @@ -17,9 +17,10 @@ keywords = ["siteVerification", "google", "cli"] name = "siteverification1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/siteverification1-cli/README.md b/gen/siteverification1-cli/README.md index c664abce2e..1d7f6bb93e 100644 --- a/gen/siteverification1-cli/README.md +++ b/gen/siteverification1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *siteVerification* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/siteverification1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/siteverification1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/siteverification1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/siteverification1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/siteverification1-cli). # Usage -This documentation was generated from the *siteVerification* API at revision *20131007*. The CLI is at version *0.3.1*. +This documentation was generated from the *siteVerification* API at revision *20131007*. The CLI is at version *0.3.2*. ```bash siteverification1 [options] diff --git a/gen/siteverification1-cli/mkdocs.yml b/gen/siteverification1-cli/mkdocs.yml index 81bf30f2c0..10ad496626 100644 --- a/gen/siteverification1-cli/mkdocs.yml +++ b/gen/siteverification1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: siteVerification v0.3.1+20131007 +site_name: siteVerification v0.3.2+20131007 site_url: http://byron.github.io/google-apis-rs/google-siteverification1-cli site_description: Write integrating applications with bcore diff --git a/gen/siteverification1-cli/src/cmn.rs b/gen/siteverification1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/siteverification1-cli/src/cmn.rs +++ b/gen/siteverification1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/siteverification1-cli/src/main.rs b/gen/siteverification1-cli/src/main.rs index fd48aca1e2..5a0f6bd01c 100644 --- a/gen/siteverification1-cli/src/main.rs +++ b/gen/siteverification1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -826,7 +827,7 @@ fn main() { let mut app = App::new("siteverification1") .author("Sebastian Thiel ") - .version("0.3.1+20131007") + .version("0.3.2+20131007") .about("Lets you programatically verify ownership of websites or domains with Google.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_siteverification1_cli") .arg(Arg::with_name("url") @@ -908,7 +909,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/siteverification1/Cargo.toml b/gen/siteverification1/Cargo.toml index 769be87890..ab0760afaf 100644 --- a/gen/siteverification1/Cargo.toml +++ b/gen/siteverification1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-siteverification1" -version = "0.1.8+20131007" +version = "0.1.9+20131007" authors = ["Sebastian Thiel "] description = "A complete library to interact with siteVerification (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/siteverification1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/siteverification1/README.md b/gen/siteverification1/README.md index fcf3c9a4a5..d50a9909ad 100644 --- a/gen/siteverification1/README.md +++ b/gen/siteverification1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-siteverification1` library allows access to all features of the *Google siteVerification* service. -This documentation was generated from *siteVerification* crate version *0.1.8+20131007*, where *20131007* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *siteVerification* crate version *0.1.9+20131007*, where *20131007* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *siteVerification* *v1* API can be found at the [official documentation site](https://developers.google.com/site-verification/). diff --git a/gen/siteverification1/src/cmn.rs b/gen/siteverification1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/siteverification1/src/cmn.rs +++ b/gen/siteverification1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/siteverification1/src/lib.rs b/gen/siteverification1/src/lib.rs index 0e03c5da09..1c2633d439 100644 --- a/gen/siteverification1/src/lib.rs +++ b/gen/siteverification1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *siteVerification* crate version *0.1.8+20131007*, where *20131007* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *siteVerification* crate version *0.1.9+20131007*, where *20131007* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *siteVerification* *v1* API can be found at the //! [official documentation site](https://developers.google.com/site-verification/). diff --git a/gen/siteverification1/src/lib.rs.in b/gen/siteverification1/src/lib.rs.in index f8f0570246..f525436f44 100644 --- a/gen/siteverification1/src/lib.rs.in +++ b/gen/siteverification1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -135,7 +136,7 @@ impl<'a, C, A> SiteVerification SiteVerification { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -144,7 +145,7 @@ impl<'a, C, A> SiteVerification } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/spectrum1_explorer-cli/Cargo.toml b/gen/spectrum1_explorer-cli/Cargo.toml index 8e02c3f32a..4201a03404 100644 --- a/gen/spectrum1_explorer-cli/Cargo.toml +++ b/gen/spectrum1_explorer-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-spectrum1_explorer-cli" -version = "0.3.1+20150112" +version = "0.3.2+20150112" authors = ["Sebastian Thiel "] description = "A complete library to interact with spectrum (protocol v1explorer)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/spectrum1_explorer-cli" @@ -17,9 +17,10 @@ keywords = ["spectrum", "google", "cli"] name = "spectrum1-explorer" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/spectrum1_explorer-cli/README.md b/gen/spectrum1_explorer-cli/README.md index 71b68b9d45..d5771333aa 100644 --- a/gen/spectrum1_explorer-cli/README.md +++ b/gen/spectrum1_explorer-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *spectrum* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/spectrum1-explorer.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/spectrum1-explorer.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/spectrum1-explorer.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/spectrum1-explorer.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/spectrum1_explorer-cli). # Usage -This documentation was generated from the *spectrum* API at revision *20150112*. The CLI is at version *0.3.1*. +This documentation was generated from the *spectrum* API at revision *20150112*. The CLI is at version *0.3.2*. ```bash spectrum1-explorer [options] diff --git a/gen/spectrum1_explorer-cli/mkdocs.yml b/gen/spectrum1_explorer-cli/mkdocs.yml index a19268aa4c..26562d8233 100644 --- a/gen/spectrum1_explorer-cli/mkdocs.yml +++ b/gen/spectrum1_explorer-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: spectrum v0.3.1+20150112 +site_name: spectrum v0.3.2+20150112 site_url: http://byron.github.io/google-apis-rs/google-spectrum1_explorer-cli site_description: Write integrating applications with bcore diff --git a/gen/spectrum1_explorer-cli/src/cmn.rs b/gen/spectrum1_explorer-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/spectrum1_explorer-cli/src/cmn.rs +++ b/gen/spectrum1_explorer-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/spectrum1_explorer-cli/src/main.rs b/gen/spectrum1_explorer-cli/src/main.rs index 38630d19cc..72ffa7540b 100644 --- a/gen/spectrum1_explorer-cli/src/main.rs +++ b/gen/spectrum1_explorer-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -959,7 +960,7 @@ fn main() { let mut app = App::new("spectrum1-explorer") .author("Sebastian Thiel ") - .version("0.3.1+20150112") + .version("0.3.2+20150112") .about("API for spectrum-management functions.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_spectrum1_explorer_cli") .arg(Arg::with_name("folder") @@ -1036,7 +1037,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/spectrum1_explorer/Cargo.toml b/gen/spectrum1_explorer/Cargo.toml index 56dafca6f3..533ca8544a 100644 --- a/gen/spectrum1_explorer/Cargo.toml +++ b/gen/spectrum1_explorer/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-spectrum1_explorer" -version = "0.1.8+20150112" +version = "0.1.9+20150112" authors = ["Sebastian Thiel "] description = "A complete library to interact with spectrum (protocol v1explorer)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/spectrum1_explorer" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/spectrum1_explorer/README.md b/gen/spectrum1_explorer/README.md index c91e3d86fc..5a47170407 100644 --- a/gen/spectrum1_explorer/README.md +++ b/gen/spectrum1_explorer/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-spectrum1_explorer` library allows access to all features of the *Google spectrum* service. -This documentation was generated from *spectrum* crate version *0.1.8+20150112*, where *20150112* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *spectrum* crate version *0.1.9+20150112*, where *20150112* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *spectrum* *v1_explorer* API can be found at the [official documentation site](http://developers.google.com/spectrum). diff --git a/gen/spectrum1_explorer/src/cmn.rs b/gen/spectrum1_explorer/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/spectrum1_explorer/src/cmn.rs +++ b/gen/spectrum1_explorer/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/spectrum1_explorer/src/lib.rs b/gen/spectrum1_explorer/src/lib.rs index ff2c6c368f..1a2246f36f 100644 --- a/gen/spectrum1_explorer/src/lib.rs +++ b/gen/spectrum1_explorer/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *spectrum* crate version *0.1.8+20150112*, where *20150112* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *spectrum* crate version *0.1.9+20150112*, where *20150112* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *spectrum* *v1_explorer* API can be found at the //! [official documentation site](http://developers.google.com/spectrum). diff --git a/gen/spectrum1_explorer/src/lib.rs.in b/gen/spectrum1_explorer/src/lib.rs.in index e839d3185a..f58f5e06d0 100644 --- a/gen/spectrum1_explorer/src/lib.rs.in +++ b/gen/spectrum1_explorer/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -109,7 +110,7 @@ impl<'a, C, A> Spectrum Spectrum { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -118,7 +119,7 @@ impl<'a, C, A> Spectrum } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/sqladmin1_beta4-cli/Cargo.toml b/gen/sqladmin1_beta4-cli/Cargo.toml index e930129288..f572f0b47c 100644 --- a/gen/sqladmin1_beta4-cli/Cargo.toml +++ b/gen/sqladmin1_beta4-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-sqladmin1_beta4-cli" -version = "0.3.1+20150330" +version = "0.3.2+20150305" authors = ["Sebastian Thiel "] description = "A complete library to interact with SQL Admin (protocol v1beta4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sqladmin1_beta4-cli" @@ -17,9 +17,10 @@ keywords = ["sqladmin", "google", "cli"] name = "sqladmin1-beta4" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/sqladmin1_beta4-cli/README.md b/gen/sqladmin1_beta4-cli/README.md index 69e27cd4f5..3e80858584 100644 --- a/gen/sqladmin1_beta4-cli/README.md +++ b/gen/sqladmin1_beta4-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *SQL Admin* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/sqladmin1-beta4.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/sqladmin1-beta4.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/sqladmin1-beta4.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/sqladmin1-beta4.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/sqladmin1_beta4-cli). # Usage -This documentation was generated from the *SQL Admin* API at revision *20150330*. The CLI is at version *0.3.1*. +This documentation was generated from the *SQL Admin* API at revision *20150305*. The CLI is at version *0.3.2*. ```bash sqladmin1-beta4 [options] diff --git a/gen/sqladmin1_beta4-cli/mkdocs.yml b/gen/sqladmin1_beta4-cli/mkdocs.yml index 6a455e7d7d..e2d6ce7afc 100644 --- a/gen/sqladmin1_beta4-cli/mkdocs.yml +++ b/gen/sqladmin1_beta4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: SQL Admin v0.3.1+20150330 +site_name: SQL Admin v0.3.2+20150305 site_url: http://byron.github.io/google-apis-rs/google-sqladmin1_beta4-cli site_description: Write integrating applications with bcore diff --git a/gen/sqladmin1_beta4-cli/src/cmn.rs b/gen/sqladmin1_beta4-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/sqladmin1_beta4-cli/src/cmn.rs +++ b/gen/sqladmin1_beta4-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/sqladmin1_beta4-cli/src/main.rs b/gen/sqladmin1_beta4-cli/src/main.rs index 8368644df3..5a9622741a 100644 --- a/gen/sqladmin1_beta4-cli/src/main.rs +++ b/gen/sqladmin1_beta4-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -3906,7 +3907,7 @@ fn main() { let mut app = App::new("sqladmin1-beta4") .author("Sebastian Thiel ") - .version("0.3.1+20150330") + .version("0.3.2+20150305") .about("API for Cloud SQL database instance management.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli") .arg(Arg::with_name("url") @@ -3988,7 +3989,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/sqladmin1_beta4/Cargo.toml b/gen/sqladmin1_beta4/Cargo.toml index 1ccd80b805..136c626a13 100644 --- a/gen/sqladmin1_beta4/Cargo.toml +++ b/gen/sqladmin1_beta4/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-sqladmin1_beta4" -version = "0.1.8+20150330" +version = "0.1.9+20150305" authors = ["Sebastian Thiel "] description = "A complete library to interact with SQL Admin (protocol v1beta4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sqladmin1_beta4" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/sqladmin1_beta4/README.md b/gen/sqladmin1_beta4/README.md index f3c0b47eef..3f59cca010 100644 --- a/gen/sqladmin1_beta4/README.md +++ b/gen/sqladmin1_beta4/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-sqladmin1_beta4` library allows access to all features of the *Google SQL Admin* service. -This documentation was generated from *SQL Admin* crate version *0.1.8+20150330*, where *20150330* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *SQL Admin* crate version *0.1.9+20150305*, where *20150305* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *SQL Admin* *v1_beta4* API can be found at the [official documentation site](https://cloud.google.com/sql/docs/reference/latest). diff --git a/gen/sqladmin1_beta4/src/cmn.rs b/gen/sqladmin1_beta4/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/sqladmin1_beta4/src/cmn.rs +++ b/gen/sqladmin1_beta4/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/sqladmin1_beta4/src/lib.rs b/gen/sqladmin1_beta4/src/lib.rs index 5a12ca2d9e..36efafeb3f 100644 --- a/gen/sqladmin1_beta4/src/lib.rs +++ b/gen/sqladmin1_beta4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *SQL Admin* crate version *0.1.8+20150330*, where *20150330* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *SQL Admin* crate version *0.1.9+20150305*, where *20150305* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *SQL Admin* *v1_beta4* API can be found at the //! [official documentation site](https://cloud.google.com/sql/docs/reference/latest). diff --git a/gen/sqladmin1_beta4/src/lib.rs.in b/gen/sqladmin1_beta4/src/lib.rs.in index 5c917d9460..e07dae79b0 100644 --- a/gen/sqladmin1_beta4/src/lib.rs.in +++ b/gen/sqladmin1_beta4/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -135,7 +136,7 @@ impl<'a, C, A> SQLAdmin SQLAdmin { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -165,7 +166,7 @@ impl<'a, C, A> SQLAdmin } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/storage1-cli/Cargo.toml b/gen/storage1-cli/Cargo.toml index 78c883f13e..238b61ba7f 100644 --- a/gen/storage1-cli/Cargo.toml +++ b/gen/storage1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-storage1-cli" -version = "0.3.1+20150326" +version = "0.3.2+20150710" authors = ["Sebastian Thiel "] description = "A complete library to interact with storage (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/storage1-cli" @@ -17,9 +17,10 @@ keywords = ["storage", "google", "cli"] name = "storage1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/storage1-cli/README.md b/gen/storage1-cli/README.md index d6da38f060..33789f48b4 100644 --- a/gen/storage1-cli/README.md +++ b/gen/storage1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *storage* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/storage1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/storage1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/storage1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/storage1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/storage1-cli). # Usage -This documentation was generated from the *storage* API at revision *20150326*. The CLI is at version *0.3.1*. +This documentation was generated from the *storage* API at revision *20150710*. The CLI is at version *0.3.2*. ```bash storage1 [options] diff --git a/gen/storage1-cli/mkdocs.yml b/gen/storage1-cli/mkdocs.yml index b656755391..4855cf77c8 100644 --- a/gen/storage1-cli/mkdocs.yml +++ b/gen/storage1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: storage v0.3.1+20150326 +site_name: storage v0.3.2+20150710 site_url: http://byron.github.io/google-apis-rs/google-storage1-cli site_description: Write integrating applications with bcore diff --git a/gen/storage1-cli/src/cmn.rs b/gen/storage1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/storage1-cli/src/cmn.rs +++ b/gen/storage1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/storage1-cli/src/main.rs b/gen/storage1-cli/src/main.rs index 8b79708c9d..6dcb86dc7e 100644 --- a/gen/storage1-cli/src/main.rs +++ b/gen/storage1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -4454,7 +4455,7 @@ fn main() { let mut app = App::new("storage1") .author("Sebastian Thiel ") - .version("0.3.1+20150326") + .version("0.3.2+20150710") .about("Lets you store and retrieve potentially-large, immutable data objects.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_storage1_cli") .arg(Arg::with_name("url") @@ -4547,7 +4548,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/storage1/Cargo.toml b/gen/storage1/Cargo.toml index 29508185db..6bf3871c3b 100644 --- a/gen/storage1/Cargo.toml +++ b/gen/storage1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-storage1" -version = "0.1.8+20150326" +version = "0.1.9+20150710" authors = ["Sebastian Thiel "] description = "A complete library to interact with storage (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/storage1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/storage1/README.md b/gen/storage1/README.md index 067f148928..a1cf0e0501 100644 --- a/gen/storage1/README.md +++ b/gen/storage1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-storage1` library allows access to all features of the *Google storage* service. -This documentation was generated from *storage* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *storage* crate version *0.1.9+20150710*, where *20150710* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *storage* *v1* API can be found at the [official documentation site](https://developers.google.com/storage/docs/json_api/). diff --git a/gen/storage1/src/cmn.rs b/gen/storage1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/storage1/src/cmn.rs +++ b/gen/storage1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/storage1/src/lib.rs b/gen/storage1/src/lib.rs index c5782f77bd..e7609588d2 100644 --- a/gen/storage1/src/lib.rs +++ b/gen/storage1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *storage* crate version *0.1.8+20150326*, where *20150326* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *storage* crate version *0.1.9+20150710*, where *20150710* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *storage* *v1* API can be found at the //! [official documentation site](https://developers.google.com/storage/docs/json_api/). diff --git a/gen/storage1/src/lib.rs.in b/gen/storage1/src/lib.rs.in index a7d636ee53..271c7485b0 100644 --- a/gen/storage1/src/lib.rs.in +++ b/gen/storage1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -156,7 +157,7 @@ impl<'a, C, A> Storage Storage { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -180,7 +181,7 @@ impl<'a, C, A> Storage } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -436,14 +437,14 @@ pub struct Object { pub kind: Option, /// The name of this object. Required if not specified by URL parameter. pub name: Option, - /// MD5 hash of the data; encoded using base64. + /// MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. #[serde(rename="md5Hash")] pub md5_hash: Option, /// The name of the bucket containing this object. pub bucket: Option, /// Access controls on the object. pub acl: Option>, - /// CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. + /// CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices. pub crc32c: Option, /// HTTP 1.1 Entity tag for the object. pub etag: Option, diff --git a/gen/tagmanager1-cli/Cargo.toml b/gen/tagmanager1-cli/Cargo.toml index 56caffd1e3..7e3865feff 100644 --- a/gen/tagmanager1-cli/Cargo.toml +++ b/gen/tagmanager1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-tagmanager1-cli" -version = "0.3.1+20150526" +version = "0.3.2+20150526" authors = ["Sebastian Thiel "] description = "A complete library to interact with Tag Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager1-cli" @@ -17,9 +17,10 @@ keywords = ["tagmanager", "google", "cli"] name = "tagmanager1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/tagmanager1-cli/README.md b/gen/tagmanager1-cli/README.md index f5cf41eb38..8948f47f48 100644 --- a/gen/tagmanager1-cli/README.md +++ b/gen/tagmanager1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *Tag Manager* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/tagmanager1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/tagmanager1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/tagmanager1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/tagmanager1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager1-cli). # Usage -This documentation was generated from the *Tag Manager* API at revision *20150526*. The CLI is at version *0.3.1*. +This documentation was generated from the *Tag Manager* API at revision *20150526*. The CLI is at version *0.3.2*. ```bash tagmanager1 [options] diff --git a/gen/tagmanager1-cli/mkdocs.yml b/gen/tagmanager1-cli/mkdocs.yml index f139bd54c2..f265b21d67 100644 --- a/gen/tagmanager1-cli/mkdocs.yml +++ b/gen/tagmanager1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Tag Manager v0.3.1+20150526 +site_name: Tag Manager v0.3.2+20150526 site_url: http://byron.github.io/google-apis-rs/google-tagmanager1-cli site_description: Write integrating applications with bcore diff --git a/gen/tagmanager1-cli/src/cmn.rs b/gen/tagmanager1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/tagmanager1-cli/src/cmn.rs +++ b/gen/tagmanager1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/tagmanager1-cli/src/main.rs b/gen/tagmanager1-cli/src/main.rs index d11daae877..f428c10bf2 100644 --- a/gen/tagmanager1-cli/src/main.rs +++ b/gen/tagmanager1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -4827,7 +4828,7 @@ fn main() { let mut app = App::new("tagmanager1") .author("Sebastian Thiel ") - .version("0.3.1+20150526") + .version("0.3.2+20150526") .about("API for accessing Tag Manager accounts and containers.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_tagmanager1_cli") .arg(Arg::with_name("url") @@ -4909,7 +4910,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/tagmanager1/Cargo.toml b/gen/tagmanager1/Cargo.toml index f24af55514..0944a4c2d6 100644 --- a/gen/tagmanager1/Cargo.toml +++ b/gen/tagmanager1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-tagmanager1" -version = "0.1.8+20150526" +version = "0.1.9+20150526" authors = ["Sebastian Thiel "] description = "A complete library to interact with Tag Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/tagmanager1/README.md b/gen/tagmanager1/README.md index 3d47911b46..fb3452e607 100644 --- a/gen/tagmanager1/README.md +++ b/gen/tagmanager1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-tagmanager1` library allows access to all features of the *Google Tag Manager* service. -This documentation was generated from *Tag Manager* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *Tag Manager* crate version *0.1.9+20150526*, where *20150526* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *Tag Manager* *v1* API can be found at the [official documentation site](https://developers.google.com/tag-manager/api/v1/). diff --git a/gen/tagmanager1/src/cmn.rs b/gen/tagmanager1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/tagmanager1/src/cmn.rs +++ b/gen/tagmanager1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/tagmanager1/src/lib.rs b/gen/tagmanager1/src/lib.rs index 8af64dc583..9e50c9516d 100644 --- a/gen/tagmanager1/src/lib.rs +++ b/gen/tagmanager1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Tag Manager* crate version *0.1.8+20150526*, where *20150526* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *Tag Manager* crate version *0.1.9+20150526*, where *20150526* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *Tag Manager* *v1* API can be found at the //! [official documentation site](https://developers.google.com/tag-manager/api/v1/). diff --git a/gen/tagmanager1/src/lib.rs.in b/gen/tagmanager1/src/lib.rs.in index 4f8b6d6e5f..0e06c37967 100644 --- a/gen/tagmanager1/src/lib.rs.in +++ b/gen/tagmanager1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -156,7 +157,7 @@ impl<'a, C, A> TagManager TagManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -165,7 +166,7 @@ impl<'a, C, A> TagManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/taskqueue1_beta2-cli/Cargo.toml b/gen/taskqueue1_beta2-cli/Cargo.toml index 8e34281e01..01a8431f34 100644 --- a/gen/taskqueue1_beta2-cli/Cargo.toml +++ b/gen/taskqueue1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-taskqueue1_beta2-cli" -version = "0.3.1+20141111" +version = "0.3.2+20141111" authors = ["Sebastian Thiel "] description = "A complete library to interact with taskqueue (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/taskqueue1_beta2-cli" @@ -17,9 +17,10 @@ keywords = ["taskqueue", "google", "cli"] name = "taskqueue1-beta2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/taskqueue1_beta2-cli/README.md b/gen/taskqueue1_beta2-cli/README.md index 96e37a3506..0d6443df96 100644 --- a/gen/taskqueue1_beta2-cli/README.md +++ b/gen/taskqueue1_beta2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *taskqueue* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/taskqueue1-beta2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/taskqueue1-beta2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/taskqueue1-beta2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/taskqueue1-beta2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/taskqueue1_beta2-cli). # Usage -This documentation was generated from the *taskqueue* API at revision *20141111*. The CLI is at version *0.3.1*. +This documentation was generated from the *taskqueue* API at revision *20141111*. The CLI is at version *0.3.2*. ```bash taskqueue1-beta2 [options] diff --git a/gen/taskqueue1_beta2-cli/mkdocs.yml b/gen/taskqueue1_beta2-cli/mkdocs.yml index 0d7f02d456..756a83c64f 100644 --- a/gen/taskqueue1_beta2-cli/mkdocs.yml +++ b/gen/taskqueue1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: taskqueue v0.3.1+20141111 +site_name: taskqueue v0.3.2+20141111 site_url: http://byron.github.io/google-apis-rs/google-taskqueue1_beta2-cli site_description: Write integrating applications with bcore diff --git a/gen/taskqueue1_beta2-cli/src/cmn.rs b/gen/taskqueue1_beta2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/taskqueue1_beta2-cli/src/cmn.rs +++ b/gen/taskqueue1_beta2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/taskqueue1_beta2-cli/src/main.rs b/gen/taskqueue1_beta2-cli/src/main.rs index f2b6514eb7..abfef48354 100644 --- a/gen/taskqueue1_beta2-cli/src/main.rs +++ b/gen/taskqueue1_beta2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1008,7 +1009,7 @@ fn main() { let mut app = App::new("taskqueue1-beta2") .author("Sebastian Thiel ") - .version("0.3.1+20141111") + .version("0.3.2+20141111") .about("Lets you access a Google App Engine Pull Task Queue over REST.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_taskqueue1_beta2_cli") .arg(Arg::with_name("url") @@ -1090,7 +1091,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/taskqueue1_beta2/Cargo.toml b/gen/taskqueue1_beta2/Cargo.toml index b064b74479..7f8bfd2810 100644 --- a/gen/taskqueue1_beta2/Cargo.toml +++ b/gen/taskqueue1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-taskqueue1_beta2" -version = "0.1.8+20141111" +version = "0.1.9+20141111" authors = ["Sebastian Thiel "] description = "A complete library to interact with taskqueue (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/taskqueue1_beta2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/taskqueue1_beta2/README.md b/gen/taskqueue1_beta2/README.md index e8b1c17a33..cdf1325f51 100644 --- a/gen/taskqueue1_beta2/README.md +++ b/gen/taskqueue1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-taskqueue1_beta2` library allows access to all features of the *Google taskqueue* service. -This documentation was generated from *taskqueue* crate version *0.1.8+20141111*, where *20141111* is the exact revision of the *taskqueue:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *taskqueue* crate version *0.1.9+20141111*, where *20141111* is the exact revision of the *taskqueue:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *taskqueue* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/appengine/docs/python/taskqueue/rest). diff --git a/gen/taskqueue1_beta2/src/cmn.rs b/gen/taskqueue1_beta2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/taskqueue1_beta2/src/cmn.rs +++ b/gen/taskqueue1_beta2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/taskqueue1_beta2/src/lib.rs b/gen/taskqueue1_beta2/src/lib.rs index 3a4253312c..48999094b0 100644 --- a/gen/taskqueue1_beta2/src/lib.rs +++ b/gen/taskqueue1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *taskqueue* crate version *0.1.8+20141111*, where *20141111* is the exact revision of the *taskqueue:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *taskqueue* crate version *0.1.9+20141111*, where *20141111* is the exact revision of the *taskqueue:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *taskqueue* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/appengine/docs/python/taskqueue/rest). diff --git a/gen/taskqueue1_beta2/src/lib.rs.in b/gen/taskqueue1_beta2/src/lib.rs.in index 929cf26a1f..8c40b6f75b 100644 --- a/gen/taskqueue1_beta2/src/lib.rs.in +++ b/gen/taskqueue1_beta2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -131,7 +132,7 @@ impl<'a, C, A> Taskqueue Taskqueue { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -143,7 +144,7 @@ impl<'a, C, A> Taskqueue } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/tasks1-cli/Cargo.toml b/gen/tasks1-cli/Cargo.toml index bf69e699f7..c84cb33102 100644 --- a/gen/tasks1-cli/Cargo.toml +++ b/gen/tasks1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-tasks1-cli" -version = "0.3.1+20141121" +version = "0.3.2+20141121" authors = ["Sebastian Thiel "] description = "A complete library to interact with tasks (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tasks1-cli" @@ -17,9 +17,10 @@ keywords = ["tasks", "google", "cli"] name = "tasks1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/tasks1-cli/README.md b/gen/tasks1-cli/README.md index c97a700994..128921d6a0 100644 --- a/gen/tasks1-cli/README.md +++ b/gen/tasks1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *tasks* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/tasks1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/tasks1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/tasks1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/tasks1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/tasks1-cli). # Usage -This documentation was generated from the *tasks* API at revision *20141121*. The CLI is at version *0.3.1*. +This documentation was generated from the *tasks* API at revision *20141121*. The CLI is at version *0.3.2*. ```bash tasks1 [options] diff --git a/gen/tasks1-cli/mkdocs.yml b/gen/tasks1-cli/mkdocs.yml index a51b55ffac..86c795ab53 100644 --- a/gen/tasks1-cli/mkdocs.yml +++ b/gen/tasks1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: tasks v0.3.1+20141121 +site_name: tasks v0.3.2+20141121 site_url: http://byron.github.io/google-apis-rs/google-tasks1-cli site_description: Write integrating applications with bcore diff --git a/gen/tasks1-cli/src/cmn.rs b/gen/tasks1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/tasks1-cli/src/cmn.rs +++ b/gen/tasks1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/tasks1-cli/src/main.rs b/gen/tasks1-cli/src/main.rs index 1dec0b6ebd..a5995f62cb 100644 --- a/gen/tasks1-cli/src/main.rs +++ b/gen/tasks1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1551,7 +1552,7 @@ fn main() { let mut app = App::new("tasks1") .author("Sebastian Thiel ") - .version("0.3.1+20141121") + .version("0.3.2+20141121") .about("Lets you manage your tasks and task lists.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_tasks1_cli") .arg(Arg::with_name("url") @@ -1633,7 +1634,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/tasks1/Cargo.toml b/gen/tasks1/Cargo.toml index d16a5083b8..0c2a2dedd6 100644 --- a/gen/tasks1/Cargo.toml +++ b/gen/tasks1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-tasks1" -version = "0.1.8+20141121" +version = "0.1.9+20141121" authors = ["Sebastian Thiel "] description = "A complete library to interact with tasks (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tasks1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/tasks1/README.md b/gen/tasks1/README.md index 7528029542..c592f6c9e8 100644 --- a/gen/tasks1/README.md +++ b/gen/tasks1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-tasks1` library allows access to all features of the *Google tasks* service. -This documentation was generated from *tasks* crate version *0.1.8+20141121*, where *20141121* is the exact revision of the *tasks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *tasks* crate version *0.1.9+20141121*, where *20141121* is the exact revision of the *tasks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *tasks* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/tasks/firstapp). diff --git a/gen/tasks1/src/cmn.rs b/gen/tasks1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/tasks1/src/cmn.rs +++ b/gen/tasks1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/tasks1/src/lib.rs b/gen/tasks1/src/lib.rs index 228d41d619..8d8981a911 100644 --- a/gen/tasks1/src/lib.rs +++ b/gen/tasks1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *tasks* crate version *0.1.8+20141121*, where *20141121* is the exact revision of the *tasks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *tasks* crate version *0.1.9+20141121*, where *20141121* is the exact revision of the *tasks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *tasks* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/tasks/firstapp). diff --git a/gen/tasks1/src/lib.rs.in b/gen/tasks1/src/lib.rs.in index e9e4b5f7d1..d0a21bd22d 100644 --- a/gen/tasks1/src/lib.rs.in +++ b/gen/tasks1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -139,7 +140,7 @@ impl<'a, C, A> TasksHub TasksHub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -151,7 +152,7 @@ impl<'a, C, A> TasksHub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/translate2-cli/Cargo.toml b/gen/translate2-cli/Cargo.toml index 0fde60d643..d36eb4caf7 100644 --- a/gen/translate2-cli/Cargo.toml +++ b/gen/translate2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-translate2-cli" -version = "0.3.1+20141123" +version = "0.3.2+20141123" authors = ["Sebastian Thiel "] description = "A complete library to interact with translate (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/translate2-cli" @@ -17,9 +17,10 @@ keywords = ["translate", "google", "cli"] name = "translate2" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/translate2-cli/README.md b/gen/translate2-cli/README.md index 6870ccabbb..8bc7e4ff9e 100644 --- a/gen/translate2-cli/README.md +++ b/gen/translate2-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *translate* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/translate2.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/translate2.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/translate2.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/translate2.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/translate2-cli). # Usage -This documentation was generated from the *translate* API at revision *20141123*. The CLI is at version *0.3.1*. +This documentation was generated from the *translate* API at revision *20141123*. The CLI is at version *0.3.2*. ```bash translate2 [options] diff --git a/gen/translate2-cli/mkdocs.yml b/gen/translate2-cli/mkdocs.yml index b2f750991a..1187ed6322 100644 --- a/gen/translate2-cli/mkdocs.yml +++ b/gen/translate2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: translate v0.3.1+20141123 +site_name: translate v0.3.2+20141123 site_url: http://byron.github.io/google-apis-rs/google-translate2-cli site_description: Write integrating applications with bcore diff --git a/gen/translate2-cli/src/cmn.rs b/gen/translate2-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/translate2-cli/src/cmn.rs +++ b/gen/translate2-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/translate2-cli/src/main.rs b/gen/translate2-cli/src/main.rs index c9e6b8751c..cf7ac6484d 100644 --- a/gen/translate2-cli/src/main.rs +++ b/gen/translate2-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -404,7 +405,7 @@ fn main() { let mut app = App::new("translate2") .author("Sebastian Thiel ") - .version("0.3.1+20141123") + .version("0.3.2+20141123") .about("Lets you translate text from one language to another") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_translate2_cli") .arg(Arg::with_name("folder") @@ -481,7 +482,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/translate2/Cargo.toml b/gen/translate2/Cargo.toml index 22c572bcfb..2b6ee2a0f2 100644 --- a/gen/translate2/Cargo.toml +++ b/gen/translate2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-translate2" -version = "0.1.8+20141123" +version = "0.1.9+20141123" authors = ["Sebastian Thiel "] description = "A complete library to interact with translate (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/translate2" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/translate2/README.md b/gen/translate2/README.md index 500b5b9126..236fa5c8ef 100644 --- a/gen/translate2/README.md +++ b/gen/translate2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-translate2` library allows access to all features of the *Google translate* service. -This documentation was generated from *translate* crate version *0.1.8+20141123*, where *20141123* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *translate* crate version *0.1.9+20141123*, where *20141123* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *translate* *v2* API can be found at the [official documentation site](https://developers.google.com/translate/v2/using_rest). diff --git a/gen/translate2/src/cmn.rs b/gen/translate2/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/translate2/src/cmn.rs +++ b/gen/translate2/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/translate2/src/lib.rs b/gen/translate2/src/lib.rs index 5a01873f24..900c0de660 100644 --- a/gen/translate2/src/lib.rs +++ b/gen/translate2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *translate* crate version *0.1.8+20141123*, where *20141123* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *translate* crate version *0.1.9+20141123*, where *20141123* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *translate* *v2* API can be found at the //! [official documentation site](https://developers.google.com/translate/v2/using_rest). diff --git a/gen/translate2/src/lib.rs.in b/gen/translate2/src/lib.rs.in index 3e5e3726d3..f34a4c9f95 100644 --- a/gen/translate2/src/lib.rs.in +++ b/gen/translate2/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -103,7 +104,7 @@ impl<'a, C, A> Translate Translate { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -118,7 +119,7 @@ impl<'a, C, A> Translate } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/urlshortener1-cli/Cargo.toml b/gen/urlshortener1-cli/Cargo.toml index f39ec9f111..26687f2aa8 100644 --- a/gen/urlshortener1-cli/Cargo.toml +++ b/gen/urlshortener1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-urlshortener1-cli" -version = "0.3.1+20150519" +version = "0.3.2+20150519" authors = ["Sebastian Thiel "] description = "A complete library to interact with urlshortener (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/urlshortener1-cli" @@ -17,9 +17,10 @@ keywords = ["urlshortener", "google", "cli"] name = "urlshortener1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/urlshortener1-cli/README.md b/gen/urlshortener1-cli/README.md index 95c9e5ec3f..9d9f4bb80c 100644 --- a/gen/urlshortener1-cli/README.md +++ b/gen/urlshortener1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *urlshortener* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/urlshortener1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/urlshortener1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/urlshortener1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/urlshortener1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/urlshortener1-cli). # Usage -This documentation was generated from the *urlshortener* API at revision *20150519*. The CLI is at version *0.3.1*. +This documentation was generated from the *urlshortener* API at revision *20150519*. The CLI is at version *0.3.2*. ```bash urlshortener1 [options] diff --git a/gen/urlshortener1-cli/mkdocs.yml b/gen/urlshortener1-cli/mkdocs.yml index 00f57b9d38..f243ec9d64 100644 --- a/gen/urlshortener1-cli/mkdocs.yml +++ b/gen/urlshortener1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: urlshortener v0.3.1+20150519 +site_name: urlshortener v0.3.2+20150519 site_url: http://byron.github.io/google-apis-rs/google-urlshortener1-cli site_description: Write integrating applications with bcore diff --git a/gen/urlshortener1-cli/src/cmn.rs b/gen/urlshortener1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/urlshortener1-cli/src/cmn.rs +++ b/gen/urlshortener1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/urlshortener1-cli/src/main.rs b/gen/urlshortener1-cli/src/main.rs index 3d82835dc5..47328e782f 100644 --- a/gen/urlshortener1-cli/src/main.rs +++ b/gen/urlshortener1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -429,7 +430,7 @@ fn main() { let mut app = App::new("urlshortener1") .author("Sebastian Thiel ") - .version("0.3.1+20150519") + .version("0.3.2+20150519") .about("Lets you create, inspect, and manage goo.gl short URLs") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_urlshortener1_cli") .arg(Arg::with_name("url") @@ -511,7 +512,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/urlshortener1/Cargo.toml b/gen/urlshortener1/Cargo.toml index 04cbcd4b19..a7464d601d 100644 --- a/gen/urlshortener1/Cargo.toml +++ b/gen/urlshortener1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-urlshortener1" -version = "0.1.8+20150519" +version = "0.1.9+20150519" authors = ["Sebastian Thiel "] description = "A complete library to interact with urlshortener (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/urlshortener1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/urlshortener1/README.md b/gen/urlshortener1/README.md index 4dfd1efa5a..7fce6d771f 100644 --- a/gen/urlshortener1/README.md +++ b/gen/urlshortener1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-urlshortener1` library allows access to all features of the *Google urlshortener* service. -This documentation was generated from *urlshortener* crate version *0.1.8+20150519*, where *20150519* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *urlshortener* crate version *0.1.9+20150519*, where *20150519* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *urlshortener* *v1* API can be found at the [official documentation site](https://developers.google.com/url-shortener/v1/getting_started). diff --git a/gen/urlshortener1/src/cmn.rs b/gen/urlshortener1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/urlshortener1/src/cmn.rs +++ b/gen/urlshortener1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/urlshortener1/src/lib.rs b/gen/urlshortener1/src/lib.rs index dbd4d624fa..131cf9d9f1 100644 --- a/gen/urlshortener1/src/lib.rs +++ b/gen/urlshortener1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *urlshortener* crate version *0.1.8+20150519*, where *20150519* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *urlshortener* crate version *0.1.9+20150519*, where *20150519* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *urlshortener* *v1* API can be found at the //! [official documentation site](https://developers.google.com/url-shortener/v1/getting_started). diff --git a/gen/urlshortener1/src/lib.rs.in b/gen/urlshortener1/src/lib.rs.in index 588698a2e6..e19c3e2022 100644 --- a/gen/urlshortener1/src/lib.rs.in +++ b/gen/urlshortener1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -126,7 +127,7 @@ impl<'a, C, A> Urlshortener Urlshortener { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -135,7 +136,7 @@ impl<'a, C, A> Urlshortener } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/webfonts1-cli/Cargo.toml b/gen/webfonts1-cli/Cargo.toml index 7e93c26a29..c1b0827b8c 100644 --- a/gen/webfonts1-cli/Cargo.toml +++ b/gen/webfonts1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-webfonts1-cli" -version = "0.3.1+20140210" +version = "0.3.2+20140210" authors = ["Sebastian Thiel "] description = "A complete library to interact with webfonts (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/webfonts1-cli" @@ -17,9 +17,10 @@ keywords = ["webfonts", "google", "cli"] name = "webfonts1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/webfonts1-cli/README.md b/gen/webfonts1-cli/README.md index 4f8db37c96..0d268d790a 100644 --- a/gen/webfonts1-cli/README.md +++ b/gen/webfonts1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *webfonts* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/webfonts1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/webfonts1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/webfonts1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/webfonts1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/webfonts1-cli). # Usage -This documentation was generated from the *webfonts* API at revision *20140210*. The CLI is at version *0.3.1*. +This documentation was generated from the *webfonts* API at revision *20140210*. The CLI is at version *0.3.2*. ```bash webfonts1 [options] diff --git a/gen/webfonts1-cli/mkdocs.yml b/gen/webfonts1-cli/mkdocs.yml index b605c2051b..1d60f23976 100644 --- a/gen/webfonts1-cli/mkdocs.yml +++ b/gen/webfonts1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: webfonts v0.3.1+20140210 +site_name: webfonts v0.3.2+20140210 site_url: http://byron.github.io/google-apis-rs/google-webfonts1-cli site_description: Write integrating applications with bcore diff --git a/gen/webfonts1-cli/src/cmn.rs b/gen/webfonts1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/webfonts1-cli/src/cmn.rs +++ b/gen/webfonts1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/webfonts1-cli/src/main.rs b/gen/webfonts1-cli/src/main.rs index a01af48e9c..b745fc9600 100644 --- a/gen/webfonts1-cli/src/main.rs +++ b/gen/webfonts1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -218,7 +219,7 @@ fn main() { let mut app = App::new("webfonts1") .author("Sebastian Thiel ") - .version("0.3.1+20140210") + .version("0.3.2+20140210") .about("The Google Fonts Developer API.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_webfonts1_cli") .arg(Arg::with_name("folder") @@ -295,7 +296,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/webfonts1/Cargo.toml b/gen/webfonts1/Cargo.toml index c55a03c219..231549050b 100644 --- a/gen/webfonts1/Cargo.toml +++ b/gen/webfonts1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-webfonts1" -version = "0.1.8+20140210" +version = "0.1.9+20140210" authors = ["Sebastian Thiel "] description = "A complete library to interact with webfonts (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/webfonts1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/webfonts1/README.md b/gen/webfonts1/README.md index b0cc26b879..9048fff870 100644 --- a/gen/webfonts1/README.md +++ b/gen/webfonts1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-webfonts1` library allows access to all features of the *Google webfonts* service. -This documentation was generated from *webfonts* crate version *0.1.8+20140210*, where *20140210* is the exact revision of the *webfonts:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *webfonts* crate version *0.1.9+20140210*, where *20140210* is the exact revision of the *webfonts:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *webfonts* *v1* API can be found at the [official documentation site](https://developers.google.com/fonts/docs/developer_api). diff --git a/gen/webfonts1/src/cmn.rs b/gen/webfonts1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/webfonts1/src/cmn.rs +++ b/gen/webfonts1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/webfonts1/src/lib.rs b/gen/webfonts1/src/lib.rs index 58e4cb4ebb..ea0bcf9947 100644 --- a/gen/webfonts1/src/lib.rs +++ b/gen/webfonts1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *webfonts* crate version *0.1.8+20140210*, where *20140210* is the exact revision of the *webfonts:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *webfonts* crate version *0.1.9+20140210*, where *20140210* is the exact revision of the *webfonts:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *webfonts* *v1* API can be found at the //! [official documentation site](https://developers.google.com/fonts/docs/developer_api). diff --git a/gen/webfonts1/src/lib.rs.in b/gen/webfonts1/src/lib.rs.in index 95b93e818b..e07334f351 100644 --- a/gen/webfonts1/src/lib.rs.in +++ b/gen/webfonts1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -104,7 +105,7 @@ impl<'a, C, A> Webfonts Webfonts { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -113,7 +114,7 @@ impl<'a, C, A> Webfonts } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/webmasters3-cli/Cargo.toml b/gen/webmasters3-cli/Cargo.toml index 6b342855bd..7e3cf40589 100644 --- a/gen/webmasters3-cli/Cargo.toml +++ b/gen/webmasters3-cli/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-webmasters3-cli" -version = "0.3.1+20140908" +version = "0.3.2+20150624" authors = ["Sebastian Thiel "] description = "A complete library to interact with webmasters (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/webmasters3-cli" -homepage = "https://developers.google.com/webmaster-tools/v3/welcome" +homepage = "https://developers.google.com/webmaster-tools/" documentation = "http://byron.github.io/google-apis-rs/google_webmasters3_cli" license = "MIT" keywords = ["webmasters", "google", "cli"] @@ -17,9 +17,10 @@ keywords = ["webmasters", "google", "cli"] name = "webmasters3" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/webmasters3-cli/README.md b/gen/webmasters3-cli/README.md index 6e8aaeae05..83af890f93 100644 --- a/gen/webmasters3-cli/README.md +++ b/gen/webmasters3-cli/README.md @@ -11,23 +11,25 @@ capabilities. Errors will be printed to standard error, and cause the program's If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. Everything else about the *webmasters* API can be found at the -[official documentation site](https://developers.google.com/webmaster-tools/v3/welcome). +[official documentation site](https://developers.google.com/webmaster-tools/). # Downloads You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/webmasters3.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/webmasters3.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/webmasters3.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/webmasters3.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/webmasters3-cli). # Usage -This documentation was generated from the *webmasters* API at revision *20140908*. The CLI is at version *0.3.1*. +This documentation was generated from the *webmasters* API at revision *20150624*. The CLI is at version *0.3.2*. ```bash webmasters3 [options] + searchanalytics + query (-r )... [-p ]... [-o ] sitemaps delete [-p ]... get [-p ]... [-o ] diff --git a/gen/webmasters3-cli/mkdocs.yml b/gen/webmasters3-cli/mkdocs.yml index 0ac3893804..bc6e4319e9 100644 --- a/gen/webmasters3-cli/mkdocs.yml +++ b/gen/webmasters3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: webmasters v0.3.1+20140908 +site_name: webmasters v0.3.2+20150624 site_url: http://byron.github.io/google-apis-rs/google-webmasters3-cli site_description: Write integrating applications with bcore @@ -9,6 +9,7 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['searchanalytics_query.md', 'Searchanalytics', 'Query'] - ['sitemaps_delete.md', 'Sitemaps', 'Delete'] - ['sitemaps_get.md', 'Sitemaps', 'Get'] - ['sitemaps_list.md', 'Sitemaps', 'List'] diff --git a/gen/webmasters3-cli/src/cmn.rs b/gen/webmasters3-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/webmasters3-cli/src/cmn.rs +++ b/gen/webmasters3-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/webmasters3-cli/src/main.rs b/gen/webmasters3-cli/src/main.rs index 9dcf1ab3bd..74ac43bf23 100644 --- a/gen/webmasters3-cli/src/main.rs +++ b/gen/webmasters3-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -44,6 +45,96 @@ struct Engine<'n, 'a> { impl<'n, 'a> Engine<'n, 'a> { + fn _searchanalytics_query(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "start-date" => Some(("startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-date" => Some(("endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dimensions" => Some(("dimensions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "search-type" => Some(("searchType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "row-limit" => Some(("rowLimit", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "aggregation-type" => Some(("aggregationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-type", "dimensions", "end-date", "row-limit", "search-type", "start-date"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SearchAnalyticsQueryRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.searchanalytics().query(request, opt.value_of("site-url").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _sitemaps_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.sitemaps().delete(opt.value_of("site-url").unwrap_or(""), opt.value_of("feedpath").unwrap_or("")); @@ -647,6 +738,17 @@ impl<'n, 'a> Engine<'n, 'a> { let mut call_result: Result<(), DoitError> = Ok(()); let mut err_opt: Option = None; match self.opt.subcommand() { + ("searchanalytics", Some(opt)) => { + match opt.subcommand() { + ("query", Some(opt)) => { + call_result = self._searchanalytics_query(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("searchanalytics".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("sitemaps", Some(opt)) => { match opt.subcommand() { ("delete", Some(opt)) => { @@ -797,6 +899,41 @@ impl<'n, 'a> Engine<'n, 'a> { fn main() { let mut exit_status = 0i32; let arg_data = [ + ("searchanalytics", "methods: 'query'", vec![ + ("query", + Some(r##"[LIMITED ACCESS] + + Query your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days. + + When date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned."##), + "Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/searchanalytics_query", + vec![ + (Some(r##"site-url"##), + None, + Some(r##"The site's URL, including protocol. For example: http://www.example.com/"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("sitemaps", "methods: 'delete', 'get', 'list' and 'submit'", vec![ ("delete", Some(r##"Deletes a sitemap from this site."##), @@ -804,13 +941,13 @@ fn main() { vec![ (Some(r##"site-url"##), None, - Some(r##"The site's URL, including protocol, for example 'http://www.example.com/'"##), + Some(r##"The site's URL, including protocol. For example: http://www.example.com/"##), Some(true), Some(false)), (Some(r##"feedpath"##), None, - Some(r##"The URL of the actual sitemap (for example http://www.example.com/sitemap.xml)."##), + Some(r##"The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml"##), Some(true), Some(false)), @@ -826,13 +963,13 @@ fn main() { vec![ (Some(r##"site-url"##), None, - Some(r##"The site's URL, including protocol, for example 'http://www.example.com/'"##), + Some(r##"The site's URL, including protocol. For example: http://www.example.com/"##), Some(true), Some(false)), (Some(r##"feedpath"##), None, - Some(r##"The URL of the actual sitemap (for example http://www.example.com/sitemap.xml)."##), + Some(r##"The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml"##), Some(true), Some(false)), @@ -849,12 +986,12 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists sitemaps uploaded to the site."##), + Some(r##"Lists the sitemaps-entries submitted for this site, or included in the sitemap index file (if sitemapIndex is specified in the request)."##), "Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/sitemaps_list", vec![ (Some(r##"site-url"##), None, - Some(r##"The site's URL, including protocol, for example 'http://www.example.com/'"##), + Some(r##"The site's URL, including protocol. For example: http://www.example.com/"##), Some(true), Some(false)), @@ -876,13 +1013,13 @@ fn main() { vec![ (Some(r##"site-url"##), None, - Some(r##"The site's URL, including protocol, for example 'http://www.example.com/'"##), + Some(r##"The site's URL, including protocol. For example: http://www.example.com/"##), Some(true), Some(false)), (Some(r##"feedpath"##), None, - Some(r##"The URL of the sitemap to add."##), + Some(r##"The URL of the sitemap to add. For example: http://www.example.com/sitemap.xml"##), Some(true), Some(false)), @@ -917,7 +1054,7 @@ fn main() { vec![ (Some(r##"site-url"##), None, - Some(r##"The site's URL, including protocol, for example 'http://www.example.com/'"##), + Some(r##"The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/"##), Some(true), Some(false)), @@ -933,7 +1070,7 @@ fn main() { vec![ (Some(r##"site-url"##), None, - Some(r##"The site's URL, including protocol, for example 'http://www.example.com/'"##), + Some(r##"The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/"##), Some(true), Some(false)), @@ -950,7 +1087,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists your Webmaster Tools sites."##), + Some(r##"Lists the user's Webmaster Tools sites."##), "Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/sites_list", vec![ (Some(r##"v"##), @@ -974,7 +1111,7 @@ fn main() { vec![ (Some(r##"site-url"##), None, - Some(r##"The site's URL, including protocol, for example 'http://www.example.com/'"##), + Some(r##"The site's URL, including protocol. For example: http://www.example.com/"##), Some(true), Some(false)), @@ -999,25 +1136,25 @@ fn main() { vec![ (Some(r##"site-url"##), None, - Some(r##"The site's URL, including protocol, for example 'http://www.example.com/'"##), + Some(r##"The site's URL, including protocol. For example: http://www.example.com/"##), Some(true), Some(false)), (Some(r##"url"##), None, - Some(r##"The relative path (without the site) of the sample URL; must be one of the URLs returned by list"##), + Some(r##"The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename"##), Some(true), Some(false)), (Some(r##"category"##), None, - Some(r##"The crawl error category, for example 'authPermissions'"##), + Some(r##"The crawl error category. For example: authPermissions"##), Some(true), Some(false)), (Some(r##"platform"##), None, - Some(r##"The user agent type (platform) that made the request, for example 'web'"##), + Some(r##"The user agent type (platform) that made the request. For example: web"##), Some(true), Some(false)), @@ -1039,19 +1176,19 @@ fn main() { vec![ (Some(r##"site-url"##), None, - Some(r##"The site's URL, including protocol, for example 'http://www.example.com/'"##), + Some(r##"The site's URL, including protocol. For example: http://www.example.com/"##), Some(true), Some(false)), (Some(r##"category"##), None, - Some(r##"The crawl error category, for example 'authPermissions'"##), + Some(r##"The crawl error category. For example: authPermissions"##), Some(true), Some(false)), (Some(r##"platform"##), None, - Some(r##"The user agent type (platform) that made the request, for example 'web'"##), + Some(r##"The user agent type (platform) that made the request. For example: web"##), Some(true), Some(false)), @@ -1073,25 +1210,25 @@ fn main() { vec![ (Some(r##"site-url"##), None, - Some(r##"The site's URL, including protocol, for example 'http://www.example.com/'"##), + Some(r##"The site's URL, including protocol. For example: http://www.example.com/"##), Some(true), Some(false)), (Some(r##"url"##), None, - Some(r##"The relative path (without the site) of the sample URL; must be one of the URLs returned by list"##), + Some(r##"The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename"##), Some(true), Some(false)), (Some(r##"category"##), None, - Some(r##"The crawl error category, for example 'authPermissions'"##), + Some(r##"The crawl error category. For example: authPermissions"##), Some(true), Some(false)), (Some(r##"platform"##), None, - Some(r##"The user agent type (platform) that made the request, for example 'web'"##), + Some(r##"The user agent type (platform) that made the request. For example: web"##), Some(true), Some(false)), @@ -1107,7 +1244,7 @@ fn main() { let mut app = App::new("webmasters3") .author("Sebastian Thiel ") - .version("0.3.1+20140908") + .version("0.3.2+20150624") .about("Lets you view Google Webmaster Tools data for your verified sites.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_webmasters3_cli") .arg(Arg::with_name("url") @@ -1189,7 +1326,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/webmasters3/Cargo.toml b/gen/webmasters3/Cargo.toml index 253bf3d017..63cb826be0 100644 --- a/gen/webmasters3/Cargo.toml +++ b/gen/webmasters3/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-webmasters3" -version = "0.1.8+20140908" +version = "0.1.9+20150624" authors = ["Sebastian Thiel "] description = "A complete library to interact with webmasters (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/webmasters3" -homepage = "https://developers.google.com/webmaster-tools/v3/welcome" +homepage = "https://developers.google.com/webmaster-tools/" documentation = "http://byron.github.io/google-apis-rs/google_webmasters3" license = "MIT" keywords = ["webmasters", "google", "protocol", "web", "api"] @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/webmasters3/README.md b/gen/webmasters3/README.md index c24e0468bd..5d06d46dd1 100644 --- a/gen/webmasters3/README.md +++ b/gen/webmasters3/README.md @@ -5,14 +5,16 @@ DO NOT EDIT ! --> The `google-webmasters3` library allows access to all features of the *Google webmasters* service. -This documentation was generated from *webmasters* crate version *0.1.8+20140908*, where *20140908* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *webmasters* crate version *0.1.9+20150624*, where *20150624* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *webmasters* *v3* API can be found at the -[official documentation site](https://developers.google.com/webmaster-tools/v3/welcome). +[official documentation site](https://developers.google.com/webmaster-tools/). # Features Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google_webmasters3/struct.Webmasters.html) ... +* searchanalytics + * [*query*](http://byron.github.io/google-apis-rs/google_webmasters3/struct.SearchanalyticQueryCall.html) * sitemaps * [*delete*](http://byron.github.io/google-apis-rs/google_webmasters3/struct.SitemapDeleteCall.html), [*get*](http://byron.github.io/google-apis-rs/google_webmasters3/struct.SitemapGetCall.html), [*list*](http://byron.github.io/google-apis-rs/google_webmasters3/struct.SitemapListCall.html) and [*submit*](http://byron.github.io/google-apis-rs/google_webmasters3/struct.SitemapSubmitCall.html) * sites diff --git a/gen/webmasters3/src/cmn.rs b/gen/webmasters3/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/webmasters3/src/cmn.rs +++ b/gen/webmasters3/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/webmasters3/src/lib.rs b/gen/webmasters3/src/lib.rs index c77c02de7c..2e32efc1aa 100644 --- a/gen/webmasters3/src/lib.rs +++ b/gen/webmasters3/src/lib.rs @@ -2,15 +2,17 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *webmasters* crate version *0.1.8+20140908*, where *20140908* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *webmasters* crate version *0.1.9+20150624*, where *20150624* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *webmasters* *v3* API can be found at the -//! [official documentation site](https://developers.google.com/webmaster-tools/v3/welcome). +//! [official documentation site](https://developers.google.com/webmaster-tools/). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/webmasters3). //! # Features //! //! Handle the following *Resources* with ease from the central [hub](struct.Webmasters.html) ... //! +//! * searchanalytics +//! * [*query*](struct.SearchanalyticQueryCall.html) //! * sitemaps //! * [*delete*](struct.SitemapDeleteCall.html), [*get*](struct.SitemapGetCall.html), [*list*](struct.SitemapListCall.html) and [*submit*](struct.SitemapSubmitCall.html) //! * sites diff --git a/gen/webmasters3/src/lib.rs.in b/gen/webmasters3/src/lib.rs.in index f2805b3f9b..397f336e57 100644 --- a/gen/webmasters3/src/lib.rs.in +++ b/gen/webmasters3/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -129,10 +130,13 @@ impl<'a, C, A> Webmasters Webmasters { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } + pub fn searchanalytics(&'a self) -> SearchanalyticMethods<'a, C, A> { + SearchanalyticMethods { hub: &self } + } pub fn sitemaps(&'a self) -> SitemapMethods<'a, C, A> { SitemapMethods { hub: &self } } @@ -147,7 +151,7 @@ impl<'a, C, A> Webmasters } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -161,24 +165,6 @@ impl<'a, C, A> Webmasters // ############ // SCHEMAS ### // ########## -/// List of sitemaps. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list sitemaps](struct.SitemapListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SitemapsListResponse { - /// Information about a sitemap entry. - pub sitemap: Option>, -} - -impl ResponseResult for SitemapsListResponse {} - - /// Information about the various content types in the sitemap. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -187,7 +173,7 @@ impl ResponseResult for SitemapsListResponse {} pub struct WmxSitemapContent { /// The number of URLs from the sitemap that were indexed (of the content type). pub indexed: Option, - /// The specific type of content in this sitemap (for example "web", "images"). + /// The specific type of content in this sitemap. For example: web. #[serde(rename="type")] pub type_: Option, /// The number of URLs in the sitemap (of the content type). @@ -197,43 +183,20 @@ pub struct WmxSitemapContent { impl Part for WmxSitemapContent {} -/// Number of errors per day for a specific error type (defined by platform and category). +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlCrawlErrorCountsPerType { - /// The crawl error type. - pub category: Option, - /// Corresponding to the user agent that made the request. - pub platform: Option, - /// The error count entries time series. - pub entries: Option>, +pub struct ApiDimensionFilterGroup { + /// no description provided + #[serde(rename="groupType")] + pub group_type: Option, + /// no description provided + pub filters: Option>, } -impl Part for UrlCrawlErrorCountsPerType {} - - -/// Access level information for a Webmaster Tools site. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get sites](struct.SiteGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct WmxSite { - /// The user's permission level for the site. - #[serde(rename="permissionLevel")] - pub permission_level: Option, - /// The URL of the site. - #[serde(rename="siteUrl")] - pub site_url: Option, -} - -impl ResponseResult for WmxSite {} +impl Part for ApiDimensionFilterGroup {} /// A time series of the number of URL crawl errors per error category and platform. @@ -247,7 +210,7 @@ impl ResponseResult for WmxSite {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UrlCrawlErrorsCountsQueryResponse { - /// The time series of the number of URL crawl errors for per error category and platform. + /// The time series of the number of URL crawl errors per error category and platform. #[serde(rename="countPerTypes")] pub count_per_types: Option>, } @@ -255,22 +218,7 @@ pub struct UrlCrawlErrorsCountsQueryResponse { impl ResponseResult for UrlCrawlErrorsCountsQueryResponse {} -/// An entry in a URL crawl errors time series. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlCrawlErrorCount { - /// The error count at the given timestamp. - pub count: Option, - /// The time (well, date) when errors were detected, in RFC 3339 format. - pub timestamp: Option, -} - -impl Part for UrlCrawlErrorCount {} - - -/// There is no detailed description. +/// Contains detailed information about a specific URL submitted as a sitemap. /// /// # Activities /// @@ -281,9 +229,9 @@ impl Part for UrlCrawlErrorCount {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct WmxSitemap { - /// Number of errors in the sitemap - issues with the sitemap itself, that needs to be fixed before it can be processed correctly. + /// Number of errors in the sitemap. These are issues with the sitemap itself that need to be fixed before it can be processed correctly. pub errors: Option, - /// Number of warnings for the sitemap - issues with URLs in the sitemaps. + /// Number of warnings for the sitemap. These are generally non-critical issues with URLs in the sitemaps. pub warnings: Option, /// If true, the sitemap has not been processed. #[serde(rename="isPending")] @@ -299,7 +247,7 @@ pub struct WmxSitemap { pub last_downloaded: Option, /// The url of the sitemap. pub path: Option, - /// The type of the sitemap (for example "sitemap"). + /// The type of the sitemap. For example: rssFeed. #[serde(rename="type")] pub type_: Option, /// The various content types in the sitemap. @@ -320,7 +268,7 @@ impl ResponseResult for WmxSitemap {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SitesListResponse { - /// Access level information for a Webmaster Tools site. + /// Contains permission level information about a Webmaster Tools site. For more information, see Permissions in Webmaster Tools. #[serde(rename="siteEntry")] pub site_entry: Option>, } @@ -330,32 +278,40 @@ impl ResponseResult for SitesListResponse {} /// There is no detailed description. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get urlcrawlerrorssamples](struct.UrlcrawlerrorssampleGetCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlCrawlErrorsSample { - /// Additional details about the URL, set only when calling get(). - #[serde(rename="urlDetails")] - pub url_details: Option, - /// The URL of an error, relative to the site. - #[serde(rename="pageUrl")] - pub page_url: Option, - /// The time when the URL was last crawled, in RFC 3339 format. - pub last_crawled: Option, - /// The HTTP response code, if any. - #[serde(rename="responseCode")] - pub response_code: Option, - /// The time the error was first detected, in RFC 3339 format. - pub first_detected: Option, +pub struct ApiDataRow { + /// no description provided + pub keys: Option>, + /// no description provided + pub impressions: Option, + /// no description provided + pub clicks: Option, + /// no description provided + pub ctr: Option, + /// no description provided + pub position: Option, } -impl Resource for UrlCrawlErrorsSample {} -impl ResponseResult for UrlCrawlErrorsSample {} +impl Part for ApiDataRow {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApiDimensionFilter { + /// no description provided + pub operator: Option, + /// no description provided + pub expression: Option, + /// no description provided + pub dimension: Option, +} + +impl Part for ApiDimensionFilter {} /// Additional details about the URL, set only when calling get(). @@ -394,6 +350,169 @@ pub struct UrlCrawlErrorsSamplesListResponse { impl ResponseResult for UrlCrawlErrorsSamplesListResponse {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [query searchanalytics](struct.SearchanalyticQueryCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchAnalyticsQueryRequest { + /// [Required] Start date of the requested date range, in YYYY-MM-DD format, in PST time (UTC - 8:00). Must be less than or equal to the end date. This value is included in the range. + #[serde(rename="startDate")] + pub start_date: Option, + /// [Required] End date of the requested date range, in YYYY-MM-DD format, in PST (UTC - 8:00). Must be greater than or equal to the start date. This value is included in the range. + #[serde(rename="endDate")] + pub end_date: Option, + /// [Optional] Zero or more dimensions to group results by. Dimensions are the group-by values in the Search Analytics page. Dimensions are combined to create a unique row key for each row. Results are grouped in the order that you supply these dimensions. + pub dimensions: Option>, + /// [Optional; Default is WEB] The search type to filter for. + #[serde(rename="searchType")] + pub search_type: Option, + /// [Optional] Zero or more filters to apply to the dimension grouping values; for example, 'Country CONTAINS "Guinea"' to see only data where the country contains the substring "Guinea". You can filter by a dimension without grouping by it. + #[serde(rename="dimensionFilterGroups")] + pub dimension_filter_groups: Option>, + /// [Optional; Default is AUTO] How data is aggregated. If aggregated by property, all data for the same property is aggregated; if aggregated by page, all data is aggregated by canonical URI. If you filter or group by page, choose AUTO; otherwise you can aggregate either by property or by page, depending on how you want your data calculated; see the help documentation to learn how data is calculated differently by site versus by page. + /// + /// Note: If you group or filter by page, you cannot aggregate by property. + /// + /// If you specify any value other than AUTO, the aggregation type in the result will match the requested type, or if you request an invalid type, you will get an error. The API will never change your aggregation type if the requested type is invalid. + #[serde(rename="aggregationType")] + pub aggregation_type: Option, + /// [Optional; Default is 1000] The maximum number of rows to return. Must be a number from 1 to 1,000 (inclusive). + #[serde(rename="rowLimit")] + pub row_limit: Option, +} + +impl RequestValue for SearchAnalyticsQueryRequest {} + + +/// List of sitemaps. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list sitemaps](struct.SitemapListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SitemapsListResponse { + /// Contains detailed information about a specific URL submitted as a sitemap. + pub sitemap: Option>, +} + +impl ResponseResult for SitemapsListResponse {} + + +/// Number of errors per day for a specific error type (defined by platform and category). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlCrawlErrorCountsPerType { + /// The crawl error type. + pub category: Option, + /// The general type of Googlebot that made the request (see list of Googlebot user-agents for the user-agents used). + pub platform: Option, + /// The error count entries time series. + pub entries: Option>, +} + +impl Part for UrlCrawlErrorCountsPerType {} + + +/// Contains permission level information about a Webmaster Tools site. For more information, see Permissions in Webmaster Tools. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get sites](struct.SiteGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WmxSite { + /// The user's permission level for the site. + #[serde(rename="permissionLevel")] + pub permission_level: Option, + /// The URL of the site. + #[serde(rename="siteUrl")] + pub site_url: Option, +} + +impl ResponseResult for WmxSite {} + + +/// An entry in a URL crawl errors time series. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlCrawlErrorCount { + /// The error count at the given timestamp. + pub count: Option, + /// The date and time when the crawl attempt took place, in RFC 3339 format. + pub timestamp: Option, +} + +impl Part for UrlCrawlErrorCount {} + + +/// Contains information about specific crawl errors. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get urlcrawlerrorssamples](struct.UrlcrawlerrorssampleGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlCrawlErrorsSample { + /// Additional details about the URL, set only when calling get(). + #[serde(rename="urlDetails")] + pub url_details: Option, + /// The URL of an error, relative to the site. + #[serde(rename="pageUrl")] + pub page_url: Option, + /// The time when the URL was last crawled, in RFC 3339 format. + pub last_crawled: Option, + /// The HTTP response code, if any. + #[serde(rename="responseCode")] + pub response_code: Option, + /// The time the error was first detected, in RFC 3339 format. + pub first_detected: Option, +} + +impl Resource for UrlCrawlErrorsSample {} +impl ResponseResult for UrlCrawlErrorsSample {} + + +/// A list of rows, one per result, grouped by key. Metrics in each row are aggregated for all data grouped by that key either by page or property, as specified by the aggregation type parameter. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [query searchanalytics](struct.SearchanalyticQueryCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchAnalyticsQueryResponse { + /// A list of rows grouped by the key values in the order given in the query. + pub rows: Option>, + /// How the results were aggregated. + #[serde(rename="responseAggregationType")] + pub response_aggregation_type: Option, +} + +impl ResponseResult for SearchAnalyticsQueryResponse {} + + // ################### // MethodBuilders ### @@ -443,8 +562,8 @@ impl<'a, C, A> SitemapMethods<'a, C, A> { /// /// # Arguments /// - /// * `siteUrl` - The site's URL, including protocol, for example 'http://www.example.com/' - /// * `feedpath` - The URL of the actual sitemap (for example http://www.example.com/sitemap.xml). + /// * `siteUrl` - The site's URL, including protocol. For example: http://www.example.com/ + /// * `feedpath` - The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml pub fn delete(&self, site_url: &str, feedpath: &str) -> SitemapDeleteCall<'a, C, A> { SitemapDeleteCall { hub: self.hub, @@ -462,8 +581,8 @@ impl<'a, C, A> SitemapMethods<'a, C, A> { /// /// # Arguments /// - /// * `siteUrl` - The site's URL, including protocol, for example 'http://www.example.com/' - /// * `feedpath` - The URL of the sitemap to add. + /// * `siteUrl` - The site's URL, including protocol. For example: http://www.example.com/ + /// * `feedpath` - The URL of the sitemap to add. For example: http://www.example.com/sitemap.xml pub fn submit(&self, site_url: &str, feedpath: &str) -> SitemapSubmitCall<'a, C, A> { SitemapSubmitCall { hub: self.hub, @@ -481,8 +600,8 @@ impl<'a, C, A> SitemapMethods<'a, C, A> { /// /// # Arguments /// - /// * `siteUrl` - The site's URL, including protocol, for example 'http://www.example.com/' - /// * `feedpath` - The URL of the actual sitemap (for example http://www.example.com/sitemap.xml). + /// * `siteUrl` - The site's URL, including protocol. For example: http://www.example.com/ + /// * `feedpath` - The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml pub fn get(&self, site_url: &str, feedpath: &str) -> SitemapGetCall<'a, C, A> { SitemapGetCall { hub: self.hub, @@ -496,11 +615,11 @@ impl<'a, C, A> SitemapMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists sitemaps uploaded to the site. + /// Lists the sitemaps-entries submitted for this site, or included in the sitemap index file (if sitemapIndex is specified in the request). /// /// # Arguments /// - /// * `siteUrl` - The site's URL, including protocol, for example 'http://www.example.com/' + /// * `siteUrl` - The site's URL, including protocol. For example: http://www.example.com/ pub fn list(&self, site_url: &str) -> SitemapListCall<'a, C, A> { SitemapListCall { hub: self.hub, @@ -559,7 +678,7 @@ impl<'a, C, A> SiteMethods<'a, C, A> { /// /// # Arguments /// - /// * `siteUrl` - The site's URL, including protocol, for example 'http://www.example.com/' + /// * `siteUrl` - The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/ pub fn get(&self, site_url: &str) -> SiteGetCall<'a, C, A> { SiteGetCall { hub: self.hub, @@ -589,7 +708,7 @@ impl<'a, C, A> SiteMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists your Webmaster Tools sites. + /// Lists the user's Webmaster Tools sites. pub fn list(&self) -> SiteListCall<'a, C, A> { SiteListCall { hub: self.hub, @@ -605,7 +724,7 @@ impl<'a, C, A> SiteMethods<'a, C, A> { /// /// # Arguments /// - /// * `siteUrl` - The site's URL, including protocol, for example 'http://www.example.com/' + /// * `siteUrl` - The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/ pub fn delete(&self, site_url: &str) -> SiteDeleteCall<'a, C, A> { SiteDeleteCall { hub: self.hub, @@ -619,6 +738,70 @@ impl<'a, C, A> SiteMethods<'a, C, A> { +/// A builder providing access to all methods supported on *searchanalytic* resources. +/// It is not used directly, but through the `Webmasters` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_webmasters3 as webmasters3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use webmasters3::Webmasters; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Webmasters::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `query(...)` +/// // to build up your call. +/// let rb = hub.searchanalytics(); +/// # } +/// ``` +pub struct SearchanalyticMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Webmasters, +} + +impl<'a, C, A> MethodsBuilder for SearchanalyticMethods<'a, C, A> {} + +impl<'a, C, A> SearchanalyticMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// [LIMITED ACCESS] + /// + /// Query your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days. + /// + /// When date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `siteUrl` - The site's URL, including protocol. For example: http://www.example.com/ + pub fn query(&self, request: SearchAnalyticsQueryRequest, site_url: &str) -> SearchanalyticQueryCall<'a, C, A> { + SearchanalyticQueryCall { + hub: self.hub, + _request: request, + _site_url: site_url.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *urlcrawlerrorscount* resources. /// It is not used directly, but through the `Webmasters` hub. /// @@ -663,7 +846,7 @@ impl<'a, C, A> UrlcrawlerrorscountMethods<'a, C, A> { /// /// # Arguments /// - /// * `siteUrl` - The site's URL, including protocol, for example 'http://www.example.com/' + /// * `siteUrl` - The site's URL, including protocol. For example: http://www.example.com/ pub fn query(&self, site_url: &str) -> UrlcrawlerrorscountQueryCall<'a, C, A> { UrlcrawlerrorscountQueryCall { hub: self.hub, @@ -724,10 +907,10 @@ impl<'a, C, A> UrlcrawlerrorssampleMethods<'a, C, A> { /// /// # Arguments /// - /// * `siteUrl` - The site's URL, including protocol, for example 'http://www.example.com/' - /// * `url` - The relative path (without the site) of the sample URL; must be one of the URLs returned by list - /// * `category` - The crawl error category, for example 'authPermissions' - /// * `platform` - The user agent type (platform) that made the request, for example 'web' + /// * `siteUrl` - The site's URL, including protocol. For example: http://www.example.com/ + /// * `url` - The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename + /// * `category` - The crawl error category. For example: authPermissions + /// * `platform` - The user agent type (platform) that made the request. For example: web pub fn get(&self, site_url: &str, url: &str, category: &str, platform: &str) -> UrlcrawlerrorssampleGetCall<'a, C, A> { UrlcrawlerrorssampleGetCall { hub: self.hub, @@ -747,9 +930,9 @@ impl<'a, C, A> UrlcrawlerrorssampleMethods<'a, C, A> { /// /// # Arguments /// - /// * `siteUrl` - The site's URL, including protocol, for example 'http://www.example.com/' - /// * `category` - The crawl error category, for example 'authPermissions' - /// * `platform` - The user agent type (platform) that made the request, for example 'web' + /// * `siteUrl` - The site's URL, including protocol. For example: http://www.example.com/ + /// * `category` - The crawl error category. For example: authPermissions + /// * `platform` - The user agent type (platform) that made the request. For example: web pub fn list(&self, site_url: &str, category: &str, platform: &str) -> UrlcrawlerrorssampleListCall<'a, C, A> { UrlcrawlerrorssampleListCall { hub: self.hub, @@ -768,10 +951,10 @@ impl<'a, C, A> UrlcrawlerrorssampleMethods<'a, C, A> { /// /// # Arguments /// - /// * `siteUrl` - The site's URL, including protocol, for example 'http://www.example.com/' - /// * `url` - The relative path (without the site) of the sample URL; must be one of the URLs returned by list - /// * `category` - The crawl error category, for example 'authPermissions' - /// * `platform` - The user agent type (platform) that made the request, for example 'web' + /// * `siteUrl` - The site's URL, including protocol. For example: http://www.example.com/ + /// * `url` - The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename + /// * `category` - The crawl error category. For example: authPermissions + /// * `platform` - The user agent type (platform) that made the request. For example: web pub fn mark_as_fixed(&self, site_url: &str, url: &str, category: &str, platform: &str) -> UrlcrawlerrorssampleMarkAsFixedCall<'a, C, A> { UrlcrawlerrorssampleMarkAsFixedCall { hub: self.hub, @@ -959,7 +1142,7 @@ impl<'a, C, A> SitemapDeleteCall<'a, C, A> where C: BorrowMut, A: } - /// The site's URL, including protocol, for example 'http://www.example.com/' + /// The site's URL, including protocol. For example: http://www.example.com/ /// /// Sets the *site url* path property to the given value. /// @@ -969,7 +1152,7 @@ impl<'a, C, A> SitemapDeleteCall<'a, C, A> where C: BorrowMut, A: self._site_url = new_value.to_string(); self } - /// The URL of the actual sitemap (for example http://www.example.com/sitemap.xml). + /// The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml /// /// Sets the *feedpath* path property to the given value. /// @@ -1196,7 +1379,7 @@ impl<'a, C, A> SitemapSubmitCall<'a, C, A> where C: BorrowMut, A: } - /// The site's URL, including protocol, for example 'http://www.example.com/' + /// The site's URL, including protocol. For example: http://www.example.com/ /// /// Sets the *site url* path property to the given value. /// @@ -1206,7 +1389,7 @@ impl<'a, C, A> SitemapSubmitCall<'a, C, A> where C: BorrowMut, A: self._site_url = new_value.to_string(); self } - /// The URL of the sitemap to add. + /// The URL of the sitemap to add. For example: http://www.example.com/sitemap.xml /// /// Sets the *feedpath* path property to the given value. /// @@ -1444,7 +1627,7 @@ impl<'a, C, A> SitemapGetCall<'a, C, A> where C: BorrowMut, A: oa } - /// The site's URL, including protocol, for example 'http://www.example.com/' + /// The site's URL, including protocol. For example: http://www.example.com/ /// /// Sets the *site url* path property to the given value. /// @@ -1454,7 +1637,7 @@ impl<'a, C, A> SitemapGetCall<'a, C, A> where C: BorrowMut, A: oa self._site_url = new_value.to_string(); self } - /// The URL of the actual sitemap (for example http://www.example.com/sitemap.xml). + /// The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml /// /// Sets the *feedpath* path property to the given value. /// @@ -1516,7 +1699,7 @@ impl<'a, C, A> SitemapGetCall<'a, C, A> where C: BorrowMut, A: oa } -/// Lists sitemaps uploaded to the site. +/// Lists the sitemaps-entries submitted for this site, or included in the sitemap index file (if sitemapIndex is specified in the request). /// /// A builder for the *list* method supported by a *sitemap* resource. /// It is not used directly, but through a `SitemapMethods` instance. @@ -1695,7 +1878,7 @@ impl<'a, C, A> SitemapListCall<'a, C, A> where C: BorrowMut, A: o } - /// The site's URL, including protocol, for example 'http://www.example.com/' + /// The site's URL, including protocol. For example: http://www.example.com/ /// /// Sets the *site url* path property to the given value. /// @@ -1705,7 +1888,7 @@ impl<'a, C, A> SitemapListCall<'a, C, A> where C: BorrowMut, A: o self._site_url = new_value.to_string(); self } - /// A URL of a site's sitemap index. + /// A URL of a site's sitemap index. For example: http://www.example.com/sitemapindex.xml /// /// Sets the *sitemap index* query property to the given value. pub fn sitemap_index(mut self, new_value: &str) -> SitemapListCall<'a, C, A> { @@ -1938,7 +2121,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth } - /// The site's URL, including protocol, for example 'http://www.example.com/' + /// The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/ /// /// Sets the *site url* path property to the given value. /// @@ -2225,7 +2408,7 @@ impl<'a, C, A> SiteAddCall<'a, C, A> where C: BorrowMut, A: oauth } -/// Lists your Webmaster Tools sites. +/// Lists the user's Webmaster Tools sites. /// /// A builder for the *list* method supported by a *site* resource. /// It is not used directly, but through a `SiteMethods` instance. @@ -2591,7 +2774,7 @@ impl<'a, C, A> SiteDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - /// The site's URL, including protocol, for example 'http://www.example.com/' + /// The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/ /// /// Sets the *site url* path property to the given value. /// @@ -2653,6 +2836,277 @@ impl<'a, C, A> SiteDeleteCall<'a, C, A> where C: BorrowMut, A: oa } +/// [LIMITED ACCESS] +/// +/// Query your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days. +/// +/// When date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned. +/// +/// A builder for the *query* method supported by a *searchanalytic* resource. +/// It is not used directly, but through a `SearchanalyticMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_webmasters3 as webmasters3; +/// use webmasters3::SearchAnalyticsQueryRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use webmasters3::Webmasters; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Webmasters::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 = SearchAnalyticsQueryRequest::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.searchanalytics().query(req, "siteUrl") +/// .doit(); +/// # } +/// ``` +pub struct SearchanalyticQueryCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Webmasters, + _request: SearchAnalyticsQueryRequest, + _site_url: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SearchanalyticQueryCall<'a, C, A> {} + +impl<'a, C, A> SearchanalyticQueryCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SearchAnalyticsQueryResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "webmasters.searchanalytics.query", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("siteUrl", self._site_url.to_string())); + for &field in ["alt", "siteUrl"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}/searchAnalytics/query".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{siteUrl}", "siteUrl")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["siteUrl"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SearchAnalyticsQueryRequest) -> SearchanalyticQueryCall<'a, C, A> { + self._request = new_value; + self + } + /// The site's URL, including protocol. For example: http://www.example.com/ + /// + /// Sets the *site url* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn site_url(mut self, new_value: &str) -> SearchanalyticQueryCall<'a, C, A> { + self._site_url = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> SearchanalyticQueryCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> SearchanalyticQueryCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SearchanalyticQueryCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Retrieves a time series of the number of URL crawl errors per error category and platform. /// /// A builder for the *query* method supported by a *urlcrawlerrorscount* resource. @@ -2680,9 +3134,9 @@ impl<'a, C, A> SiteDeleteCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.urlcrawlerrorscounts().query("siteUrl") -/// .platform("gubergren") -/// .latest_counts_only(false) -/// .category("aliquyam") +/// .platform("sadipscing") +/// .latest_counts_only(true) +/// .category("ea") /// .doit(); /// # } /// ``` @@ -2842,7 +3296,7 @@ impl<'a, C, A> UrlcrawlerrorscountQueryCall<'a, C, A> where C: BorrowMut UrlcrawlerrorscountQueryCall<'a, C, A> where C: BorrowMut UrlcrawlerrorscountQueryCall<'a, C, A> { @@ -2866,7 +3320,7 @@ impl<'a, C, A> UrlcrawlerrorscountQueryCall<'a, C, A> where C: BorrowMut UrlcrawlerrorscountQueryCall<'a, C, A> { @@ -3105,7 +3559,7 @@ impl<'a, C, A> UrlcrawlerrorssampleGetCall<'a, C, A> where C: BorrowMut UrlcrawlerrorssampleGetCall<'a, C, A> where C: BorrowMut UrlcrawlerrorssampleGetCall<'a, C, A> where C: BorrowMut UrlcrawlerrorssampleGetCall<'a, C, A> where C: BorrowMut UrlcrawlerrorssampleListCall<'a, C, A> where C: BorrowMut UrlcrawlerrorssampleListCall<'a, C, A> where C: BorrowMut UrlcrawlerrorssampleListCall<'a, C, A> where C: BorrowMut UrlcrawlerrorssampleMarkAsFixedCall<'a, C, A> where C: BorrowMut< } - /// The site's URL, including protocol, for example 'http://www.example.com/' + /// The site's URL, including protocol. For example: http://www.example.com/ /// /// Sets the *site url* path property to the given value. /// @@ -3636,7 +4090,7 @@ impl<'a, C, A> UrlcrawlerrorssampleMarkAsFixedCall<'a, C, A> where C: BorrowMut< self._site_url = new_value.to_string(); self } - /// The relative path (without the site) of the sample URL; must be one of the URLs returned by list + /// The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename /// /// Sets the *url* path property to the given value. /// @@ -3646,7 +4100,7 @@ impl<'a, C, A> UrlcrawlerrorssampleMarkAsFixedCall<'a, C, A> where C: BorrowMut< self._url = new_value.to_string(); self } - /// The crawl error category, for example 'authPermissions' + /// The crawl error category. For example: authPermissions /// /// Sets the *category* query property to the given value. /// @@ -3656,7 +4110,7 @@ impl<'a, C, A> UrlcrawlerrorssampleMarkAsFixedCall<'a, C, A> where C: BorrowMut< self._category = new_value.to_string(); self } - /// The user agent type (platform) that made the request, for example 'web' + /// The user agent type (platform) that made the request. For example: web /// /// Sets the *platform* query property to the given value. /// diff --git a/gen/youtube3-cli/Cargo.toml b/gen/youtube3-cli/Cargo.toml index 08480a6a24..5fc7d0e33e 100644 --- a/gen/youtube3-cli/Cargo.toml +++ b/gen/youtube3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-youtube3-cli" -version = "0.3.1+20150529" +version = "0.3.2+20150706" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtube3-cli" @@ -17,9 +17,10 @@ keywords = ["youtube", "google", "cli"] name = "youtube3" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/youtube3-cli/README.md b/gen/youtube3-cli/README.md index bb06c81cef..0cd2d216a2 100644 --- a/gen/youtube3-cli/README.md +++ b/gen/youtube3-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *YouTube* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/youtube3.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/youtube3.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/youtube3.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/youtube3.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/youtube3-cli). # Usage -This documentation was generated from the *YouTube* API at revision *20150529*. The CLI is at version *0.3.1*. +This documentation was generated from the *YouTube* API at revision *20150706*. The CLI is at version *0.3.2*. ```bash youtube3 [options] @@ -66,6 +66,7 @@ youtube3 [options] list [-p ]... [-o ] live-broadcasts bind [-p ]... [-o ] + bind-direct [-p ]... [-o ] control [-p ]... [-o ] delete [-p ]... insert (-r )... [-p ]... [-o ] diff --git a/gen/youtube3-cli/mkdocs.yml b/gen/youtube3-cli/mkdocs.yml index 856c2a079d..b7a568957a 100644 --- a/gen/youtube3-cli/mkdocs.yml +++ b/gen/youtube3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: YouTube v0.3.1+20150529 +site_name: YouTube v0.3.2+20150706 site_url: http://byron.github.io/google-apis-rs/google-youtube3-cli site_description: Write integrating applications with bcore @@ -36,6 +36,7 @@ pages: - ['i18n-languages_list.md', 'I18n Languages', 'List'] - ['i18n-regions_list.md', 'I18n Regions', 'List'] - ['live-broadcasts_bind.md', 'Live Broadcasts', 'Bind'] +- ['live-broadcasts_bind-direct.md', 'Live Broadcasts', 'Bind Direct'] - ['live-broadcasts_control.md', 'Live Broadcasts', 'Control'] - ['live-broadcasts_delete.md', 'Live Broadcasts', 'Delete'] - ['live-broadcasts_insert.md', 'Live Broadcasts', 'Insert'] diff --git a/gen/youtube3-cli/src/cmn.rs b/gen/youtube3-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/youtube3-cli/src/cmn.rs +++ b/gen/youtube3-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/youtube3-cli/src/main.rs b/gen/youtube3-cli/src/main.rs index bb4f3209ac..9a3e78a4eb 100644 --- a/gen/youtube3-cli/src/main.rs +++ b/gen/youtube3-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -2356,6 +2357,68 @@ impl<'n, 'a> Engine<'n, 'a> { } } + fn _live_broadcasts_bind_direct(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.live_broadcasts().bind_direct(opt.value_of("id").unwrap_or(""), opt.value_of("part").unwrap_or("")); + for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "stream-id" => { + call = call.stream_id(value.unwrap_or("")); + }, + "on-behalf-of-content-owner-channel" => { + call = call.on_behalf_of_content_owner_channel(value.unwrap_or("")); + }, + "on-behalf-of-content-owner" => { + call = call.on_behalf_of_content_owner(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["on-behalf-of-content-owner-channel", "on-behalf-of-content-owner", "stream-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _live_broadcasts_control(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.live_broadcasts().control(opt.value_of("id").unwrap_or(""), opt.value_of("part").unwrap_or("")); @@ -2954,7 +3017,7 @@ impl<'n, 'a> Engine<'n, 'a> { match &temp_cursor.to_string()[..] { "status.stream-status" => Some(("status.streamStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.health-status.status" => Some(("status.healthStatus.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "status.health-status.last-update-time-s" => Some(("status.healthStatus.lastUpdateTimeS", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.health-status.last-update-time-seconds" => Some(("status.healthStatus.lastUpdateTimeSeconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.is-reusable" => Some(("contentDetails.isReusable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.closed-captions-ingestion-url" => Some(("contentDetails.closedCaptionsIngestionUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2971,7 +3034,7 @@ impl<'n, 'a> Engine<'n, 'a> { "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["backup-ingestion-address", "cdn", "channel-id", "closed-captions-ingestion-url", "content-details", "description", "etag", "format", "health-status", "id", "ingestion-address", "ingestion-info", "ingestion-type", "is-default-stream", "is-reusable", "kind", "last-update-time-s", "published-at", "snippet", "status", "stream-name", "stream-status", "title"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["backup-ingestion-address", "cdn", "channel-id", "closed-captions-ingestion-url", "content-details", "description", "etag", "format", "health-status", "id", "ingestion-address", "ingestion-info", "ingestion-type", "is-default-stream", "is-reusable", "kind", "last-update-time-seconds", "published-at", "snippet", "status", "stream-name", "stream-status", "title"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3134,7 +3197,7 @@ impl<'n, 'a> Engine<'n, 'a> { match &temp_cursor.to_string()[..] { "status.stream-status" => Some(("status.streamStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.health-status.status" => Some(("status.healthStatus.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "status.health-status.last-update-time-s" => Some(("status.healthStatus.lastUpdateTimeS", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.health-status.last-update-time-seconds" => Some(("status.healthStatus.lastUpdateTimeSeconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.is-reusable" => Some(("contentDetails.isReusable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.closed-captions-ingestion-url" => Some(("contentDetails.closedCaptionsIngestionUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3151,7 +3214,7 @@ impl<'n, 'a> Engine<'n, 'a> { "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["backup-ingestion-address", "cdn", "channel-id", "closed-captions-ingestion-url", "content-details", "description", "etag", "format", "health-status", "id", "ingestion-address", "ingestion-info", "ingestion-type", "is-default-stream", "is-reusable", "kind", "last-update-time-s", "published-at", "snippet", "status", "stream-name", "stream-status", "title"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["backup-ingestion-address", "cdn", "channel-id", "closed-captions-ingestion-url", "content-details", "description", "etag", "format", "health-status", "id", "ingestion-address", "ingestion-info", "ingestion-type", "is-default-stream", "is-reusable", "kind", "last-update-time-seconds", "published-at", "snippet", "status", "stream-name", "stream-status", "title"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5654,6 +5717,9 @@ impl<'n, 'a> Engine<'n, 'a> { ("bind", Some(opt)) => { call_result = self._live_broadcasts_bind(opt, dry_run, &mut err); }, + ("bind-direct", Some(opt)) => { + call_result = self._live_broadcasts_bind_direct(opt, dry_run, &mut err); + }, ("control", Some(opt)) => { call_result = self._live_broadcasts_control(opt, dry_run, &mut err); }, @@ -6553,7 +6619,7 @@ fn main() { ]), ]), - ("live-broadcasts", "methods: 'bind', 'control', 'delete', 'insert', 'list', 'transition' and 'update'", vec![ + ("live-broadcasts", "methods: 'bind', 'bind-direct', 'control', 'delete', 'insert', 'list', 'transition' and 'update'", vec![ ("bind", Some(r##"Binds a YouTube broadcast to a stream or removes an existing binding between a broadcast and a stream. A broadcast can only be bound to one video stream, though a video stream may be bound to more than one broadcast."##), "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/live-broadcasts_bind", @@ -6576,6 +6642,34 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("bind-direct", + Some(r##"Binds a YouTube broadcast to a stream or removes an existing binding between a broadcast and a stream. A broadcast can only be bound to one video stream, though a video stream may be bound to more than one broadcast."##), + "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/live-broadcasts_bind-direct", + vec![ + (Some(r##"id"##), + None, + Some(r##"The id parameter specifies the unique ID of the broadcast that is being bound to a video stream."##), + Some(true), + Some(false)), + + (Some(r##"part"##), + None, + Some(r##"The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -7362,7 +7456,7 @@ fn main() { let mut app = App::new("youtube3") .author("Sebastian Thiel ") - .version("0.3.1+20150529") + .version("0.3.2+20150706") .about("Programmatic access to YouTube features.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_youtube3_cli") .arg(Arg::with_name("url") @@ -7455,7 +7549,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/youtube3/README.md b/gen/youtube3/README.md index 525900b3de..058ed7abcf 100644 --- a/gen/youtube3/README.md +++ b/gen/youtube3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-youtube3` library allows access to all features of the *Google YouTube* service. -This documentation was generated from *YouTube* crate version *0.1.8+20150529*, where *20150529* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *YouTube* crate version *0.1.9+20150706*, where *20150706* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *YouTube* *v3* API can be found at the [official documentation site](https://developers.google.com/youtube/v3). @@ -34,7 +34,7 @@ Handle the following *Resources* with ease from the central [hub](http://byron.g * [i18n regions](http://byron.github.io/google-apis-rs/google_youtube3/struct.I18nRegion.html) * [*list*](http://byron.github.io/google-apis-rs/google_youtube3/struct.I18nRegionListCall.html) * [live broadcasts](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcast.html) - * [*bind*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastBindCall.html), [*control*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastControlCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastDeleteCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastInsertCall.html), [*list*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastListCall.html), [*transition*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastTransitionCall.html) and [*update*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastUpdateCall.html) + * [*bind*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastBindCall.html), [*bind_direct*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastBindDirectCall.html), [*control*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastControlCall.html), [*delete*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastDeleteCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastInsertCall.html), [*list*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastListCall.html), [*transition*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastTransitionCall.html) and [*update*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveBroadcastUpdateCall.html) * [live streams](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveStream.html) * [*delete*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveStreamDeleteCall.html), [*insert*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveStreamInsertCall.html), [*list*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveStreamListCall.html) and [*update*](http://byron.github.io/google-apis-rs/google_youtube3/struct.LiveStreamUpdateCall.html) * [playlist items](http://byron.github.io/google-apis-rs/google_youtube3/struct.PlaylistItem.html) @@ -104,13 +104,14 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.videos().rate(...).doit() -let r = hub.videos().report_abuse(...).doit() -let r = hub.videos().get_rating(...).doit() -let r = hub.videos().list(...).doit() -let r = hub.videos().insert(...).doit() -let r = hub.videos().update(...).doit() -let r = hub.videos().delete(...).doit() +let r = hub.live_broadcasts().control(...).doit() +let r = hub.live_broadcasts().insert(...).doit() +let r = hub.live_broadcasts().bind_direct(...).doit() +let r = hub.live_broadcasts().list(...).doit() +let r = hub.live_broadcasts().transition(...).doit() +let r = hub.live_broadcasts().update(...).doit() +let r = hub.live_broadcasts().delete(...).doit() +let r = hub.live_broadcasts().bind(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -155,18 +156,14 @@ let mut hub = YouTube::new(hyper::Client::new(), auth); // 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.videos().list("part") - .video_category_id("sit") - .region_code("Stet") - .page_token("sed") - .on_behalf_of_content_owner("et") - .my_rating("dolores") - .max_results(38) - .locale("accusam") - .id("takimata") - .hl("justo") - .debug_project_id_override("amet.") - .chart("erat") +let result = hub.live_broadcasts().list("part") + .page_token("sit") + .on_behalf_of_content_owner_channel("Stet") + .on_behalf_of_content_owner("sed") + .mine(false) + .max_results(83) + .id("kasd") + .broadcast_status("accusam") .doit(); match result { diff --git a/gen/youtube3/cargo.toml b/gen/youtube3/cargo.toml index b06de5caf5..59b7dba3ed 100644 --- a/gen/youtube3/cargo.toml +++ b/gen/youtube3/cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-youtube3" -version = "0.1.8+20150529" +version = "0.1.9+20150706" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtube3" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/youtube3/src/cmn.rs b/gen/youtube3/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/youtube3/src/cmn.rs +++ b/gen/youtube3/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/youtube3/src/lib.rs b/gen/youtube3/src/lib.rs index 38d77b22fd..0a63dc0922 100644 --- a/gen/youtube3/src/lib.rs +++ b/gen/youtube3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *YouTube* crate version *0.1.8+20150529*, where *20150529* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *YouTube* crate version *0.1.9+20150706*, where *20150706* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *YouTube* *v3* API can be found at the //! [official documentation site](https://developers.google.com/youtube/v3). @@ -32,7 +32,7 @@ //! * [i18n regions](struct.I18nRegion.html) //! * [*list*](struct.I18nRegionListCall.html) //! * [live broadcasts](struct.LiveBroadcast.html) -//! * [*bind*](struct.LiveBroadcastBindCall.html), [*control*](struct.LiveBroadcastControlCall.html), [*delete*](struct.LiveBroadcastDeleteCall.html), [*insert*](struct.LiveBroadcastInsertCall.html), [*list*](struct.LiveBroadcastListCall.html), [*transition*](struct.LiveBroadcastTransitionCall.html) and [*update*](struct.LiveBroadcastUpdateCall.html) +//! * [*bind*](struct.LiveBroadcastBindCall.html), [*bind_direct*](struct.LiveBroadcastBindDirectCall.html), [*control*](struct.LiveBroadcastControlCall.html), [*delete*](struct.LiveBroadcastDeleteCall.html), [*insert*](struct.LiveBroadcastInsertCall.html), [*list*](struct.LiveBroadcastListCall.html), [*transition*](struct.LiveBroadcastTransitionCall.html) and [*update*](struct.LiveBroadcastUpdateCall.html) //! * [live streams](struct.LiveStream.html) //! * [*delete*](struct.LiveStreamDeleteCall.html), [*insert*](struct.LiveStreamInsertCall.html), [*list*](struct.LiveStreamListCall.html) and [*update*](struct.LiveStreamUpdateCall.html) //! * [playlist items](struct.PlaylistItem.html) @@ -104,13 +104,14 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.videos().rate(...).doit() -//! let r = hub.videos().report_abuse(...).doit() -//! let r = hub.videos().get_rating(...).doit() -//! let r = hub.videos().list(...).doit() -//! let r = hub.videos().insert(...).doit() -//! let r = hub.videos().update(...).doit() -//! let r = hub.videos().delete(...).doit() +//! let r = hub.live_broadcasts().control(...).doit() +//! let r = hub.live_broadcasts().insert(...).doit() +//! let r = hub.live_broadcasts().bind_direct(...).doit() +//! let r = hub.live_broadcasts().list(...).doit() +//! let r = hub.live_broadcasts().transition(...).doit() +//! let r = hub.live_broadcasts().update(...).doit() +//! let r = hub.live_broadcasts().delete(...).doit() +//! let r = hub.live_broadcasts().bind(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -156,18 +157,14 @@ //! // 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.videos().list("part") -//! .video_category_id("dolores") -//! .region_code("et") -//! .page_token("sed") -//! .on_behalf_of_content_owner("et") -//! .my_rating("aliquyam") -//! .max_results(10) -//! .locale("sit") -//! .id("aliquyam") -//! .hl("sadipscing") -//! .debug_project_id_override("magna") -//! .chart("gubergren") +//! let result = hub.live_broadcasts().list("part") +//! .page_token("erat") +//! .on_behalf_of_content_owner_channel("amet.") +//! .on_behalf_of_content_owner("dolores") +//! .mine(false) +//! .max_results(78) +//! .id("sed") +//! .broadcast_status("et") //! .doit(); //! //! match result { diff --git a/gen/youtube3/src/lib.rs.in b/gen/youtube3/src/lib.rs.in index 4631828ca8..03111e6b07 100644 --- a/gen/youtube3/src/lib.rs.in +++ b/gen/youtube3/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -109,18 +110,14 @@ impl Default for Scope { /// // 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.videos().list("part") -/// .video_category_id("sea") -/// .region_code("nonumy") -/// .page_token("dolores") -/// .on_behalf_of_content_owner("gubergren") -/// .my_rating("sadipscing") -/// .max_results(70) -/// .locale("ea") -/// .id("no") -/// .hl("justo") -/// .debug_project_id_override("justo") -/// .chart("et") +/// let result = hub.live_broadcasts().list("part") +/// .page_token("justo") +/// .on_behalf_of_content_owner_channel("amet.") +/// .on_behalf_of_content_owner("erat") +/// .mine(true) +/// .max_results(92) +/// .id("nonumy") +/// .broadcast_status("dolores") /// .doit(); /// /// match result { @@ -156,7 +153,7 @@ impl<'a, C, A> YouTube YouTube { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -225,7 +222,7 @@ impl<'a, C, A> YouTube } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -3939,6 +3936,7 @@ impl Part for ActivityContentDetailsSubscription {} /// /// * [control live broadcasts](struct.LiveBroadcastControlCall.html) (response) /// * [insert live broadcasts](struct.LiveBroadcastInsertCall.html) (request|response) +/// * [bind_direct live broadcasts](struct.LiveBroadcastBindDirectCall.html) (response) /// * [list live broadcasts](struct.LiveBroadcastListCall.html) (none) /// * [transition live broadcasts](struct.LiveBroadcastTransitionCall.html) (response) /// * [update live broadcasts](struct.LiveBroadcastUpdateCall.html) (request|response) @@ -4284,8 +4282,8 @@ pub struct LiveStreamHealthStatus { #[serde(rename="configurationIssues")] pub configuration_issues: Option>, /// The last time this status was updated (in seconds) - #[serde(rename="lastUpdateTimeS")] - pub last_update_time_s: Option, + #[serde(rename="lastUpdateTimeSeconds")] + pub last_update_time_seconds: Option, } impl Part for LiveStreamHealthStatus {} @@ -6501,7 +6499,7 @@ impl<'a, C, A> WatermarkMethods<'a, C, A> { /// ::default(), None); /// let mut hub = YouTube::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `bind(...)`, `control(...)`, `delete(...)`, `insert(...)`, `list(...)`, `transition(...)` and `update(...)` +/// // like `bind(...)`, `bind_direct(...)`, `control(...)`, `delete(...)`, `insert(...)`, `list(...)`, `transition(...)` and `update(...)` /// // to build up your call. /// let rb = hub.live_broadcasts(); /// # } @@ -6540,6 +6538,28 @@ impl<'a, C, A> LiveBroadcastMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Binds a YouTube broadcast to a stream or removes an existing binding between a broadcast and a stream. A broadcast can only be bound to one video stream, though a video stream may be bound to more than one broadcast. + /// + /// # Arguments + /// + /// * `id` - The id parameter specifies the unique ID of the broadcast that is being bound to a video stream. + /// * `part` - The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. + pub fn bind_direct(&self, id: &str, part: &str) -> LiveBroadcastBindDirectCall<'a, C, A> { + LiveBroadcastBindDirectCall { + hub: self.hub, + _id: id.to_string(), + _part: part.to_string(), + _stream_id: Default::default(), + _on_behalf_of_content_owner_channel: Default::default(), + _on_behalf_of_content_owner: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates a broadcast. For example, you could modify the broadcast settings defined in the liveBroadcast resource's contentDetails object. @@ -6711,26 +6731,6 @@ impl<'a, C, A> MethodsBuilder for CaptionMethods<'a, C, A> {} impl<'a, C, A> CaptionMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Deletes a specified caption track. - /// - /// # Arguments - /// - /// * `id` - The id parameter identifies the caption track that is being deleted. The value is a caption track ID as identified by the id property in a caption resource. - pub fn delete(&self, id: &str) -> CaptionDeleteCall<'a, C, A> { - CaptionDeleteCall { - hub: self.hub, - _id: id.to_string(), - _on_behalf_of_content_owner: Default::default(), - _on_behalf_of: Default::default(), - _debug_project_id_override: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Uploads a caption track. @@ -6799,6 +6799,26 @@ impl<'a, C, A> CaptionMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes a specified caption track. + /// + /// # Arguments + /// + /// * `id` - The id parameter identifies the caption track that is being deleted. The value is a caption track ID as identified by the id property in a caption resource. + pub fn delete(&self, id: &str) -> CaptionDeleteCall<'a, C, A> { + CaptionDeleteCall { + hub: self.hub, + _id: id.to_string(), + _on_behalf_of_content_owner: Default::default(), + _on_behalf_of: Default::default(), + _debug_project_id_override: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates a caption track. When updating a caption track, you can change the track's draft status, upload a new caption file for the track, or both. @@ -7007,7 +7027,7 @@ impl<'a, C, A> ActivityMethods<'a, C, A> { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.i18n_languages().list("part") -/// .hl("diam") +/// .hl("sadipscing") /// .doit(); /// # } /// ``` @@ -7245,7 +7265,7 @@ impl<'a, C, A> I18nLanguageListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.channel_banners().insert(req) -/// .on_behalf_of_content_owner("ipsum") +/// .on_behalf_of_content_owner("aliquyam") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -7617,11 +7637,11 @@ impl<'a, C, A> ChannelBannerInsertCall<'a, C, A> where C: BorrowMut ChannelSectionListCall<'a, C, A> where C: BorrowMut ChannelSectionInsertCall<'a, C, A> where C: BorrowMut ChannelSectionDeleteCall<'a, C, A> where C: BorrowMut ChannelSectionUpdateCall<'a, C, A> where C: BorrowMut GuideCategoryListCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.playlists().insert(req) -/// .on_behalf_of_content_owner_channel("eirmod") -/// .on_behalf_of_content_owner("dolore") +/// .on_behalf_of_content_owner_channel("erat") +/// .on_behalf_of_content_owner("sadipscing") /// .doit(); /// # } /// ``` @@ -9259,14 +9279,14 @@ impl<'a, C, A> PlaylistInsertCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.playlists().list("part") -/// .page_token("aliquyam") -/// .on_behalf_of_content_owner_channel("accusam") -/// .on_behalf_of_content_owner("Lorem") -/// .mine(true) -/// .max_results(80) -/// .id("duo") -/// .hl("et") -/// .channel_id("eirmod") +/// .page_token("eirmod") +/// .on_behalf_of_content_owner_channel("elitr") +/// .on_behalf_of_content_owner("amet") +/// .mine(false) +/// .max_results(65) +/// .id("eirmod") +/// .hl("dolore") +/// .channel_id("invidunt") /// .doit(); /// # } /// ``` @@ -9578,7 +9598,7 @@ impl<'a, C, A> PlaylistListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.playlists().delete("id") -/// .on_behalf_of_content_owner("et") +/// .on_behalf_of_content_owner("accusam") /// .doit(); /// # } /// ``` @@ -9802,7 +9822,7 @@ impl<'a, C, A> PlaylistDeleteCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.playlists().update(req) -/// .on_behalf_of_content_owner("amet") +/// .on_behalf_of_content_owner("Lorem") /// .doit(); /// # } /// ``` @@ -10065,7 +10085,7 @@ impl<'a, C, A> PlaylistUpdateCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.thumbnails().set("videoId") -/// .on_behalf_of_content_owner("consetetur") +/// .on_behalf_of_content_owner("et") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -10408,7 +10428,7 @@ impl<'a, C, A> ThumbnailSetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().report_abuse(req) -/// .on_behalf_of_content_owner("ut") +/// .on_behalf_of_content_owner("duo") /// .doit(); /// # } /// ``` @@ -10639,17 +10659,17 @@ impl<'a, C, A> VideoReportAbuseCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().list("part") -/// .video_category_id("sed") -/// .region_code("dolor") -/// .page_token("dolor") -/// .on_behalf_of_content_owner("dolor") +/// .video_category_id("eirmod") +/// .region_code("sanctus") +/// .page_token("et") +/// .on_behalf_of_content_owner("amet") /// .my_rating("et") -/// .max_results(5) -/// .locale("amet.") -/// .id("voluptua.") -/// .hl("Lorem") -/// .debug_project_id_override("gubergren") -/// .chart("justo") +/// .max_results(56) +/// .locale("ut") +/// .id("ea") +/// .hl("sed") +/// .debug_project_id_override("dolor") +/// .chart("dolor") /// .doit(); /// # } /// ``` @@ -11212,7 +11232,7 @@ impl<'a, C, A> VideoRateCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().get_rating("id") -/// .on_behalf_of_content_owner("rebum.") +/// .on_behalf_of_content_owner("amet.") /// .doit(); /// # } /// ``` @@ -11441,7 +11461,7 @@ impl<'a, C, A> VideoGetRatingCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().delete("id") -/// .on_behalf_of_content_owner("sadipscing") +/// .on_behalf_of_content_owner("Lorem") /// .doit(); /// # } /// ``` @@ -11665,7 +11685,7 @@ impl<'a, C, A> VideoDeleteCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().update(req) -/// .on_behalf_of_content_owner("vero") +/// .on_behalf_of_content_owner("gubergren") /// .doit(); /// # } /// ``` @@ -11936,11 +11956,11 @@ impl<'a, C, A> VideoUpdateCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().insert(req) -/// .stabilize(false) -/// .on_behalf_of_content_owner_channel("invidunt") -/// .on_behalf_of_content_owner("consetetur") -/// .notify_subscribers(false) -/// .auto_levels(true) +/// .stabilize(true) +/// .on_behalf_of_content_owner_channel("sit") +/// .on_behalf_of_content_owner("vero") +/// .notify_subscribers(true) +/// .auto_levels(false) /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -12615,16 +12635,16 @@ impl<'a, C, A> SubscriptionInsertCall<'a, C, A> where C: BorrowMut SubscriptionDeleteCall<'a, C, A> where C: BorrowMut SearchListCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.i18n_regions().list("part") -/// .hl("justo") +/// .hl("diam") /// .doit(); /// # } /// ``` @@ -13978,16 +13998,16 @@ impl<'a, C, A> I18nRegionListCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comment_threads().list("part") -/// .video_id("clita") -/// .text_format("invidunt") -/// .search_terms("ut") -/// .page_token("dolores") -/// .order("eos") -/// .moderation_status("voluptua.") -/// .max_results(82) -/// .id("sed") -/// .channel_id("aliquyam") -/// .all_threads_related_to_channel_id("ea") +/// .video_id("justo") +/// .text_format("est") +/// .search_terms("amet") +/// .page_token("accusam") +/// .order("clita") +/// .moderation_status("diam") +/// .max_results(30) +/// .id("est") +/// .channel_id("clita") +/// .all_threads_related_to_channel_id("invidunt") /// .doit(); /// # } /// ``` @@ -14581,7 +14601,7 @@ impl<'a, C, A> CommentThreadUpdateCall<'a, C, A> where C: BorrowMut CommentThreadInsertCall<'a, C, A> where C: BorrowMut LiveStreamUpdateCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.live_streams().delete("id") -/// .on_behalf_of_content_owner_channel("invidunt") -/// .on_behalf_of_content_owner("rebum.") +/// .on_behalf_of_content_owner_channel("sed") +/// .on_behalf_of_content_owner("aliquyam") /// .doit(); /// # } /// ``` @@ -15410,12 +15430,12 @@ impl<'a, C, A> LiveStreamDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.live_streams().list("part") -/// .page_token("clita") -/// .on_behalf_of_content_owner_channel("invidunt") -/// .on_behalf_of_content_owner("eirmod") -/// .mine(false) -/// .max_results(5) -/// .id("et") +/// .page_token("ea") +/// .on_behalf_of_content_owner_channel("et") +/// .on_behalf_of_content_owner("dolor") +/// .mine(true) +/// .max_results(39) +/// .id("invidunt") /// .doit(); /// # } /// ``` @@ -15730,14 +15750,14 @@ impl<'a, C, A> LiveStreamListCall<'a, C, A> where C: BorrowMut, A /// req.status = Default::default(); // is LiveStreamStatus /// req.snippet = Default::default(); // is LiveStreamSnippet /// req.cdn = Default::default(); // is CdnSettings -/// req.id = Some("sed".to_string()); +/// req.id = Some("rebum.".to_string()); /// /// // 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.live_streams().insert(req) -/// .on_behalf_of_content_owner_channel("sit") -/// .on_behalf_of_content_owner("takimata") +/// .on_behalf_of_content_owner_channel("Lorem") +/// .on_behalf_of_content_owner("clita") /// .doit(); /// # } /// ``` @@ -16280,7 +16300,7 @@ impl<'a, C, A> CommentInsertCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().set_moderation_status("id", "moderationStatus") -/// .ban_author(true) +/// .ban_author(false) /// .doit(); /// # } /// ``` @@ -16714,11 +16734,11 @@ impl<'a, C, A> CommentDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().list("part") -/// .text_format("diam") -/// .parent_id("ut") -/// .page_token("ut") -/// .max_results(50) -/// .id("ipsum") +/// .text_format("sed") +/// .parent_id("sit") +/// .page_token("takimata") +/// .max_results(58) +/// .id("nonumy") /// .doit(); /// # } /// ``` @@ -17457,7 +17477,7 @@ impl<'a, C, A> CommentMarkAsSpamCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.channels().update(req) -/// .on_behalf_of_content_owner("dolor") +/// .on_behalf_of_content_owner("Lorem") /// .doit(); /// # } /// ``` @@ -17719,16 +17739,16 @@ impl<'a, C, A> ChannelUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.channels().list("part") -/// .page_token("ut") -/// .on_behalf_of_content_owner("eirmod") +/// .page_token("diam") +/// .on_behalf_of_content_owner("ut") /// .my_subscribers(true) -/// .mine(true) -/// .max_results(2) -/// .managed_by_me(true) -/// .id("et") -/// .hl("vero") +/// .mine(false) +/// .max_results(1) +/// .managed_by_me(false) +/// .id("dolor") +/// .hl("sea") /// .for_username("ut") -/// .category_id("sed") +/// .category_id("eirmod") /// .doit(); /// # } /// ``` @@ -18075,7 +18095,7 @@ impl<'a, C, A> ChannelListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.video_abuse_report_reasons().list("part") -/// .hl("ipsum") +/// .hl("voluptua.") /// .doit(); /// # } /// ``` @@ -18313,7 +18333,7 @@ impl<'a, C, A> VideoAbuseReportReasonListCall<'a, C, A> where C: BorrowMut PlaylistItemDeleteCall<'a, C, A> where C: BorrowMut PlaylistItemUpdateCall<'a, C, A> where C: BorrowMut WatermarkSetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.watermarks().unset("channelId") -/// .on_behalf_of_content_owner("labore") +/// .on_behalf_of_content_owner("takimata") /// .doit(); /// # } /// ``` @@ -19919,10 +19939,10 @@ impl<'a, C, A> WatermarkUnsetCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.live_broadcasts().control("id", "part") -/// .walltime("consetetur") -/// .on_behalf_of_content_owner_channel("sea") -/// .on_behalf_of_content_owner("elitr") -/// .offset_time_ms("At") +/// .walltime("et") +/// .on_behalf_of_content_owner_channel("sed") +/// .on_behalf_of_content_owner("no") +/// .offset_time_ms("invidunt") /// .display_slate(true) /// .doit(); /// # } @@ -20196,6 +20216,298 @@ impl<'a, C, A> LiveBroadcastControlCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = YouTube::new(hyper::Client::new(), auth); +/// // 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.live_broadcasts().bind_direct("id", "part") +/// .stream_id("elitr") +/// .on_behalf_of_content_owner_channel("consetetur") +/// .on_behalf_of_content_owner("sea") +/// .doit(); +/// # } +/// ``` +pub struct LiveBroadcastBindDirectCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a YouTube, + _id: String, + _part: String, + _stream_id: Option, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LiveBroadcastBindDirectCall<'a, C, A> {} + +impl<'a, C, A> LiveBroadcastBindDirectCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LiveBroadcast)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "youtube.liveBroadcasts.bind_direct", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("id", self._id.to_string())); + params.push(("part", self._part.to_string())); + if let Some(value) = self._stream_id { + params.push(("streamId", value.to_string())); + } + if let Some(value) = self._on_behalf_of_content_owner_channel { + params.push(("onBehalfOfContentOwnerChannel", value.to_string())); + } + if let Some(value) = self._on_behalf_of_content_owner { + params.push(("onBehalfOfContentOwner", value.to_string())); + } + for &field in ["alt", "id", "part", "streamId", "onBehalfOfContentOwnerChannel", "onBehalfOfContentOwner"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/youtube/v3/liveBroadcasts/bind/direct".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The id parameter specifies the unique ID of the broadcast that is being bound to a video stream. + /// + /// Sets the *id* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn id(mut self, new_value: &str) -> LiveBroadcastBindDirectCall<'a, C, A> { + self._id = new_value.to_string(); + self + } + /// The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. + /// + /// Sets the *part* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + /// **Settable Parts** + /// + /// * *id* + /// * *snippet* + /// * *contentDetails* + /// * *status* + pub fn part(mut self, new_value: &str) -> LiveBroadcastBindDirectCall<'a, C, A> { + self._part = new_value.to_string(); + self + } + /// The streamId parameter specifies the unique ID of the video stream that is being bound to a broadcast. If this parameter is omitted, the API will remove any existing binding between the broadcast and a video stream. + /// + /// Sets the *stream id* query property to the given value. + pub fn stream_id(mut self, new_value: &str) -> LiveBroadcastBindDirectCall<'a, C, A> { + self._stream_id = Some(new_value.to_string()); + self + } + /// This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + /// + /// This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + /// + /// Sets the *on behalf of content owner channel* query property to the given value. + pub fn on_behalf_of_content_owner_channel(mut self, new_value: &str) -> LiveBroadcastBindDirectCall<'a, C, A> { + self._on_behalf_of_content_owner_channel = Some(new_value.to_string()); + self + } + /// Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + /// + /// Sets the *on behalf of content owner* query property to the given value. + pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> LiveBroadcastBindDirectCall<'a, C, A> { + self._on_behalf_of_content_owner = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> LiveBroadcastBindDirectCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> LiveBroadcastBindDirectCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LiveBroadcastBindDirectCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Updates a broadcast. For example, you could modify the broadcast settings defined in the liveBroadcast resource's contentDetails object. /// /// A builder for the *update* method supported by a *liveBroadcast* resource. @@ -20243,14 +20555,14 @@ impl<'a, C, A> LiveBroadcastControlCall<'a, C, A> where C: BorrowMut LiveBroadcastUpdateCall<'a, C, A> where C: BorrowMut LiveBroadcastInsertCall<'a, C, A> where C: BorrowMut LiveBroadcastListCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.live_broadcasts().delete("id") -/// .on_behalf_of_content_owner_channel("Lorem") -/// .on_behalf_of_content_owner("consetetur") +/// .on_behalf_of_content_owner_channel("dolor") +/// .on_behalf_of_content_owner("sanctus") /// .doit(); /// # } /// ``` @@ -21440,8 +21752,8 @@ impl<'a, C, A> LiveBroadcastDeleteCall<'a, C, A> where C: BorrowMut LiveBroadcastTransitionCall<'a, C, A> where C: BorrowMut LiveBroadcastBindCall<'a, C, A> where C: BorrowMut } -/// Deletes a specified caption track. -/// -/// A builder for the *delete* method supported by a *caption* resource. -/// It is not used directly, but through a `CaptionMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_youtube3 as youtube3; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use youtube3::YouTube; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = YouTube::new(hyper::Client::new(), auth); -/// // 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.captions().delete("id") -/// .on_behalf_of_content_owner("clita") -/// .on_behalf_of("eos") -/// .debug_project_id_override("dolores") -/// .doit(); -/// # } -/// ``` -pub struct CaptionDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a YouTube, - _id: String, - _on_behalf_of_content_owner: Option, - _on_behalf_of: Option, - _debug_project_id_override: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for CaptionDeleteCall<'a, C, A> {} - -impl<'a, C, A> CaptionDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "youtube.captions.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("id", self._id.to_string())); - if let Some(value) = self._on_behalf_of_content_owner { - params.push(("onBehalfOfContentOwner", value.to_string())); - } - if let Some(value) = self._on_behalf_of { - params.push(("onBehalfOf", value.to_string())); - } - if let Some(value) = self._debug_project_id_override { - params.push(("debugProjectIdOverride", value.to_string())); - } - for &field in ["id", "onBehalfOfContentOwner", "onBehalfOf", "debugProjectIdOverride"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = "https://www.googleapis.com/youtube/v3/captions".to_string(); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); - } - - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, - access_token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep_ms(d.num_milliseconds() as u32); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The id parameter identifies the caption track that is being deleted. The value is a caption track ID as identified by the id property in a caption resource. - /// - /// Sets the *id* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn id(mut self, new_value: &str) -> CaptionDeleteCall<'a, C, A> { - self._id = new_value.to_string(); - self - } - /// Note: This parameter is intended exclusively for YouTube content partners. - /// - /// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. - /// - /// Sets the *on behalf of content owner* query property to the given value. - pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> CaptionDeleteCall<'a, C, A> { - self._on_behalf_of_content_owner = Some(new_value.to_string()); - self - } - /// ID of the Google+ Page for the channel that the request is be on behalf of - /// - /// Sets the *on behalf of* query property to the given value. - pub fn on_behalf_of(mut self, new_value: &str) -> CaptionDeleteCall<'a, C, A> { - self._on_behalf_of = Some(new_value.to_string()); - self - } - /// The debugProjectIdOverride parameter should be used for mimicking a request for a certain project ID - /// - /// Sets the *debug project id override* query property to the given value. - pub fn debug_project_id_override(mut self, new_value: &str) -> CaptionDeleteCall<'a, C, A> { - self._debug_project_id_override = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> CaptionDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> CaptionDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::ForceSsl`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> CaptionDeleteCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Uploads a caption track. /// /// A builder for the *insert* method supported by a *caption* resource. @@ -22258,9 +22328,9 @@ impl<'a, C, A> CaptionDeleteCall<'a, C, A> where C: BorrowMut, A: /// // Values shown here are possibly random and not representative ! /// let result = hub.captions().insert(req) /// .sync(true) -/// .on_behalf_of_content_owner("consetetur") -/// .on_behalf_of("vero") -/// .debug_project_id_override("consetetur") +/// .on_behalf_of_content_owner("Lorem") +/// .on_behalf_of("rebum.") +/// .debug_project_id_override("et") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -22682,10 +22752,10 @@ impl<'a, C, A> CaptionInsertCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.captions().list("part", "videoId") -/// .on_behalf_of_content_owner("tempor") -/// .on_behalf_of("gubergren") -/// .id("dolore") -/// .debug_project_id_override("amet.") +/// .on_behalf_of_content_owner("dolores") +/// .on_behalf_of("vero") +/// .id("consetetur") +/// .debug_project_id_override("vero") /// .doit(); /// # } /// ``` @@ -22967,11 +23037,11 @@ impl<'a, C, A> CaptionListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.captions().download("id") -/// .tlang("magna") -/// .tfmt("elitr") -/// .on_behalf_of_content_owner("magna") -/// .on_behalf_of("ipsum") -/// .debug_project_id_override("invidunt") +/// .tlang("eos") +/// .tfmt("justo") +/// .on_behalf_of_content_owner("tempor") +/// .on_behalf_of("gubergren") +/// .debug_project_id_override("dolore") /// .doit(); /// # } /// ``` @@ -23227,6 +23297,248 @@ impl<'a, C, A> CaptionDownloadCall<'a, C, A> where C: BorrowMut, } +/// Deletes a specified caption track. +/// +/// A builder for the *delete* method supported by a *caption* resource. +/// It is not used directly, but through a `CaptionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_youtube3 as youtube3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use youtube3::YouTube; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = YouTube::new(hyper::Client::new(), auth); +/// // 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.captions().delete("id") +/// .on_behalf_of_content_owner("dolore") +/// .on_behalf_of("magna") +/// .debug_project_id_override("elitr") +/// .doit(); +/// # } +/// ``` +pub struct CaptionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a YouTube, + _id: String, + _on_behalf_of_content_owner: Option, + _on_behalf_of: Option, + _debug_project_id_override: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CaptionDeleteCall<'a, C, A> {} + +impl<'a, C, A> CaptionDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "youtube.captions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("id", self._id.to_string())); + if let Some(value) = self._on_behalf_of_content_owner { + params.push(("onBehalfOfContentOwner", value.to_string())); + } + if let Some(value) = self._on_behalf_of { + params.push(("onBehalfOf", value.to_string())); + } + if let Some(value) = self._debug_project_id_override { + params.push(("debugProjectIdOverride", value.to_string())); + } + for &field in ["id", "onBehalfOfContentOwner", "onBehalfOf", "debugProjectIdOverride"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = "https://www.googleapis.com/youtube/v3/captions".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer, + access_token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep_ms(d.num_milliseconds() as u32); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The id parameter identifies the caption track that is being deleted. The value is a caption track ID as identified by the id property in a caption resource. + /// + /// Sets the *id* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn id(mut self, new_value: &str) -> CaptionDeleteCall<'a, C, A> { + self._id = new_value.to_string(); + self + } + /// Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + /// + /// Sets the *on behalf of content owner* query property to the given value. + pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> CaptionDeleteCall<'a, C, A> { + self._on_behalf_of_content_owner = Some(new_value.to_string()); + self + } + /// ID of the Google+ Page for the channel that the request is be on behalf of + /// + /// Sets the *on behalf of* query property to the given value. + pub fn on_behalf_of(mut self, new_value: &str) -> CaptionDeleteCall<'a, C, A> { + self._on_behalf_of = Some(new_value.to_string()); + self + } + /// The debugProjectIdOverride parameter should be used for mimicking a request for a certain project ID + /// + /// Sets the *debug project id override* query property to the given value. + pub fn debug_project_id_override(mut self, new_value: &str) -> CaptionDeleteCall<'a, C, A> { + self._debug_project_id_override = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> CaptionDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> CaptionDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::ForceSsl`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> CaptionDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Updates a caption track. When updating a caption track, you can change the track's draft status, upload a new caption file for the track, or both. /// /// A builder for the *update* method supported by a *caption* resource. @@ -23261,10 +23573,10 @@ impl<'a, C, A> CaptionDownloadCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.captions().update(req) -/// .sync(true) -/// .on_behalf_of_content_owner("labore") -/// .on_behalf_of("diam") -/// .debug_project_id_override("nonumy") +/// .sync(false) +/// .on_behalf_of_content_owner("ipsum") +/// .on_behalf_of("invidunt") +/// .debug_project_id_override("accusam") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -23673,8 +23985,8 @@ impl<'a, C, A> CaptionUpdateCall<'a, C, A> where C: BorrowMut, A: /// // Values shown here are possibly random and not representative ! /// let result = hub.video_categories().list("part") /// .region_code("diam") -/// .id("magna") -/// .hl("dolor") +/// .id("nonumy") +/// .hl("sed") /// .doit(); /// # } /// ``` @@ -23923,14 +24235,14 @@ impl<'a, C, A> VideoCategoryListCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.activities().list("part") -/// .region_code("dolor") -/// .published_before("vero") -/// .published_after("nonumy") -/// .page_token("takimata") -/// .mine(false) -/// .max_results(5) +/// .region_code("magna") +/// .published_before("dolor") +/// .published_after("Lorem") +/// .page_token("dolor") +/// .mine(true) +/// .max_results(10) /// .home(true) -/// .channel_id("amet.") +/// .channel_id("dolores") /// .doit(); /// # } /// ``` diff --git a/gen/youtubeanalytics1-cli/Cargo.toml b/gen/youtubeanalytics1-cli/Cargo.toml index 2429fd9f26..4c128bf0ae 100644 --- a/gen/youtubeanalytics1-cli/Cargo.toml +++ b/gen/youtubeanalytics1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-youtubeanalytics1-cli" -version = "0.3.1+20150304" +version = "0.3.2+20150304" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube Analytics (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtubeanalytics1-cli" @@ -17,9 +17,10 @@ keywords = ["youtubeAnalytics", "google", "cli"] name = "youtubeanalytics1" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" strsim = "*" yup-hyper-mock = ">=1.0.0" diff --git a/gen/youtubeanalytics1-cli/README.md b/gen/youtubeanalytics1-cli/README.md index 72de16724a..257539de1c 100644 --- a/gen/youtubeanalytics1-cli/README.md +++ b/gen/youtubeanalytics1-cli/README.md @@ -17,14 +17,14 @@ Everything else about the *YouTube Analytics* API can be found at the You can download the pre-compiled 64bit binaries for the following platforms: -* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.1/ubuntu/youtubeanalytics1.tar.gz) -* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.1/osx/youtubeanalytics1.tar.gz) +* ![icon](http://megaicons.net/static/img/icons_sizes/6/140/16/ubuntu-icon.png) [ubuntu](http://dl.byronimo.de/google.rs/cli/0.3.2/ubuntu/youtubeanalytics1.tar.gz) +* ![icon](http://hydra-media.cursecdn.com/wow.gamepedia.com/a/a2/Apple-icon-16x16.png?version=25ddd67ac3dd3b634478e3978b76cb74) [osx](http://dl.byronimo.de/google.rs/cli/0.3.2/osx/youtubeanalytics1.tar.gz) Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/youtubeanalytics1-cli). # Usage -This documentation was generated from the *YouTube Analytics* API at revision *20150304*. The CLI is at version *0.3.1*. +This documentation was generated from the *YouTube Analytics* API at revision *20150304*. The CLI is at version *0.3.2*. ```bash youtubeanalytics1 [options] diff --git a/gen/youtubeanalytics1-cli/mkdocs.yml b/gen/youtubeanalytics1-cli/mkdocs.yml index 5fec050ae5..d79970b6f3 100644 --- a/gen/youtubeanalytics1-cli/mkdocs.yml +++ b/gen/youtubeanalytics1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: YouTube Analytics v0.3.1+20150304 +site_name: YouTube Analytics v0.3.2+20150304 site_url: http://byron.github.io/google-apis-rs/google-youtubeanalytics1-cli site_description: Write integrating applications with bcore diff --git a/gen/youtubeanalytics1-cli/src/cmn.rs b/gen/youtubeanalytics1-cli/src/cmn.rs index 56051cab08..b65c8f7c9f 100644 --- a/gen/youtubeanalytics1-cli/src/cmn.rs +++ b/gen/youtubeanalytics1-cli/src/cmn.rs @@ -1,8 +1,8 @@ // COPY OF 'src/rust/cli/cmn.rs' // DO NOT EDIT use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; -use serde::json; -use serde::json::value::Value; +use serde_json as json; +use serde_json::value::Value; use mime::Mime; use clap::{App, SubCommand}; use strsim; diff --git a/gen/youtubeanalytics1-cli/src/main.rs b/gen/youtubeanalytics1-cli/src/main.rs index abcbca8e82..0472dc16ff 100644 --- a/gen/youtubeanalytics1-cli/src/main.rs +++ b/gen/youtubeanalytics1-cli/src/main.rs @@ -8,6 +8,7 @@ extern crate clap; extern crate yup_oauth2 as oauth2; extern crate yup_hyper_mock as mock; extern crate serde; +extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; @@ -27,7 +28,7 @@ use std::default::Default; use std::str::FromStr; use oauth2::{Authenticator, DefaultAuthenticatorDelegate}; -use serde::json; +use serde_json as json; use clap::ArgMatches; enum DoitError { @@ -1121,7 +1122,7 @@ fn main() { let mut app = App::new("youtubeanalytics1") .author("Sebastian Thiel ") - .version("0.3.1+20150304") + .version("0.3.2+20150304") .about("Retrieve your YouTube Analytics reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_youtubeanalytics1_cli") .arg(Arg::with_name("url") @@ -1203,7 +1204,7 @@ fn main() { }, DoitError::ApiError(err) => { if debug { - writeln!(io::stderr(), "{:?}", err).ok(); + writeln!(io::stderr(), "{:#?}", err).ok(); } else { writeln!(io::stderr(), "{}", err).ok(); } diff --git a/gen/youtubeanalytics1/Cargo.toml b/gen/youtubeanalytics1/Cargo.toml index 9ef9789ec6..b6117eda4e 100644 --- a/gen/youtubeanalytics1/Cargo.toml +++ b/gen/youtubeanalytics1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-youtubeanalytics1" -version = "0.1.8+20150304" +version = "0.1.9+20150304" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube Analytics (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtubeanalytics1" @@ -16,9 +16,10 @@ build = "src/build.rs" [dependencies] -hyper = ">= 0.6.4" -mime = "0.0.12" -serde = ">= 0.4.1" +hyper = ">= 0.6.8" +mime = "0.1.0" +serde = ">= 0.5.0" +serde_json = "*" yup-oauth2 = "*" url = "*" diff --git a/gen/youtubeanalytics1/README.md b/gen/youtubeanalytics1/README.md index b7c9b7fe46..e719250f96 100644 --- a/gen/youtubeanalytics1/README.md +++ b/gen/youtubeanalytics1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-youtubeanalytics1` library allows access to all features of the *Google YouTube Analytics* service. -This documentation was generated from *YouTube Analytics* crate version *0.1.8+20150304*, where *20150304* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +This documentation was generated from *YouTube Analytics* crate version *0.1.9+20150304*, where *20150304* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. Everything else about the *YouTube Analytics* *v1* API can be found at the [official documentation site](http://developers.google.com/youtube/analytics/). diff --git a/gen/youtubeanalytics1/src/cmn.rs b/gen/youtubeanalytics1/src/cmn.rs index defecc802c..0e31353ba3 100644 --- a/gen/youtubeanalytics1/src/cmn.rs +++ b/gen/youtubeanalytics1/src/cmn.rs @@ -16,7 +16,7 @@ use hyper::http::h1::LINE_ENDING; use hyper::method::Method; use hyper::status::StatusCode; -use serde; +use serde_json as json; /// Identifies the Hub. There is only one per library, this trait is supposed /// to make intended use more explicit. @@ -188,7 +188,7 @@ pub trait Delegate { /// /// * `json_encoded_value` - The json-encoded value which failed to decode. /// * `json_decode_error` - The decoder error - fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &serde::json::Error) { + fn response_json_decode_error(&mut self, json_encoded_value: &str, json_decode_error: &json::Error) { let _ = json_encoded_value; let _ = json_decode_error; } @@ -275,7 +275,7 @@ pub enum Error { /// Shows that we failed to decode the server response. /// This can happen if the protocol changes in conjunction with strict json decoding. - JsonDecodeError(String, serde::json::Error), + JsonDecodeError(String, json::Error), /// Indicates an HTTP repsonse with a non-success status code Failure(hyper::client::Response), @@ -718,8 +718,8 @@ impl<'a, A> ResumableUploadHelper<'a, A> let mut json_err = String::new(); res.read_to_string(&mut json_err).unwrap(); if let Retry::After(d) = self.delegate.http_failure(&res, - serde::json::from_str(&json_err).ok(), - serde::json::from_str(&json_err).ok()) { + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { sleep_ms(d.num_milliseconds() as u32); continue; } @@ -740,9 +740,9 @@ impl<'a, A> ResumableUploadHelper<'a, A> // Copy of src/rust/cli/cmn.rs // TODO(ST): Allow sharing common code between program types -pub fn remove_json_null_values(value: &mut serde::json::value::Value) { +pub fn remove_json_null_values(value: &mut json::value::Value) { match *value { - serde::json::value::Value::Object(ref mut map) => { + json::value::Value::Object(ref mut map) => { let mut for_removal = Vec::new(); for (key, mut value) in map.iter_mut() { diff --git a/gen/youtubeanalytics1/src/lib.rs b/gen/youtubeanalytics1/src/lib.rs index c4722e33f7..2a3ccaa620 100644 --- a/gen/youtubeanalytics1/src/lib.rs +++ b/gen/youtubeanalytics1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *YouTube Analytics* crate version *0.1.8+20150304*, where *20150304* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.8*. +//! This documentation was generated from *YouTube Analytics* crate version *0.1.9+20150304*, where *20150304* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.9*. //! //! Everything else about the *YouTube Analytics* *v1* API can be found at the //! [official documentation site](http://developers.google.com/youtube/analytics/). diff --git a/gen/youtubeanalytics1/src/lib.rs.in b/gen/youtubeanalytics1/src/lib.rs.in index 4c0e465c81..4b0d5a6add 100644 --- a/gen/youtubeanalytics1/src/lib.rs.in +++ b/gen/youtubeanalytics1/src/lib.rs.in @@ -4,6 +4,7 @@ extern crate hyper; extern crate serde; +extern crate serde_json; extern crate yup_oauth2 as oauth2; extern crate mime; extern crate url; @@ -15,7 +16,7 @@ use std::cell::RefCell; use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; -use serde::json; +use serde_json as json; use std::io; use std::fs; use std::thread::sleep_ms; @@ -46,7 +47,7 @@ pub enum Scope { /// View and manage your assets and associated content on YouTube Youtubepartner, - /// View YouTube Analytics monetary reports for your YouTube content + /// View monetary and non-monetary YouTube Analytics reports for your YouTube content YtAnalyticMonetaryReadonly, } @@ -144,7 +145,7 @@ impl<'a, C, A> YouTubeAnalytics YouTubeAnalytics { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.8".to_string(), + _user_agent: "google-api-rust-client/0.1.9".to_string(), } } @@ -165,7 +166,7 @@ impl<'a, C, A> YouTubeAnalytics } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.8`. + /// It defaults to `google-api-rust-client/0.1.9`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String {