fix(rustup): rustc (be9bd7c93 2015-04-05)

* using std::convert
* update to latest hyper (and other dependencies)

Related to #46
This commit is contained in:
Sebastian Thiel
2015-04-07 11:53:47 +02:00
parent 919ae4d8ae
commit 91861dcb71
354 changed files with 62261 additions and 24815 deletions

View File

@@ -1,11 +1,10 @@
// COPY OF 'src/rust/api/cmn.rs'
// DO NOT EDIT
use std::marker::MarkerTrait;
use std::io::{self, Read, Seek, Cursor, Write, SeekFrom};
use std;
use std::fmt::{self, Display};
use std::str::FromStr;
use std::thread::sleep;
use std::thread::sleep_ms;
use mime::{Mime, TopLevel, SubLevel, Attr, Value};
use oauth2::{TokenType, Retry, self};
@@ -21,35 +20,35 @@ use serde;
/// Identifies the Hub. There is only one per library, this trait is supposed
/// to make intended use more explicit.
/// The hub allows to access all resource methods more easily.
pub trait Hub: MarkerTrait {}
pub trait Hub {}
/// Identifies types for building methods of a particular resource type
pub trait MethodsBuilder: MarkerTrait {}
pub trait MethodsBuilder {}
/// Identifies types which represent builders for a particular resource method
pub trait CallBuilder: MarkerTrait {}
pub trait CallBuilder {}
/// Identifies types which can be inserted and deleted.
/// Types with this trait are most commonly used by clients of this API.
pub trait Resource: MarkerTrait {}
pub trait Resource {}
/// Identifies types which are used in API responses.
pub trait ResponseResult: MarkerTrait {}
pub trait ResponseResult {}
/// Identifies types which are used in API requests.
pub trait RequestValue: MarkerTrait {}
pub trait RequestValue {}
/// Identifies types which are not actually used by the API
/// This might be a bug within the google API schema.
pub trait UnusedType: MarkerTrait {}
pub trait UnusedType {}
/// Identifies types which are only used as part of other types, which
/// usually are carrying the `Resource` trait.
pub trait Part: MarkerTrait {}
pub trait Part {}
/// Identifies types which are only used by other types internally.
/// They have no special meaning, this trait just marks them for completeness.
pub trait NestedType: MarkerTrait {}
pub trait NestedType {}
/// A utility to specify reader types which provide seeking capabilities too
pub trait ReadSeek: Seek + Read {}
@@ -380,14 +379,10 @@ impl<'a> Read for MultiPartReader<'a> {
}
}
/// The `X-Upload-Content-Type` header.
#[derive(Clone, PartialEq, Debug)]
pub struct XUploadContentType(pub Mime);
impl_header!(XUploadContentType,
"X-Upload-Content-Type",
Mime);
header!{
#[doc="The `X-Upload-Content-Type` header."]
(XUploadContentType, "X-Upload-Content-Type") => [Mime]
}
#[derive(Clone, PartialEq, Debug)]
pub struct Chunk {
@@ -519,7 +514,7 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A>
Some(hh) if r.status == StatusCode::PermanentRedirect => hh,
None|Some(_) => {
if let Retry::After(d) = self.delegate.http_failure(&r, None) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
return Err(Ok(r))
@@ -529,7 +524,7 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A>
}
Err(err) => {
if let Retry::After(d) = self.delegate.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
return Err(Err(err))
@@ -586,7 +581,7 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, 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()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
}
@@ -594,7 +589,7 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A>
},
Err(err) => {
if let Retry::After(d) = self.delegate.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
return Some(Err(err))

View File

@@ -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.2+20140904*, where *20140904* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.2*.
//! This documentation was generated from *resourceviews* crate version *0.1.2+20150302*, where *20150302* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.2*.
//!
//! Everything else about the *resourceviews* *v1_beta2* API can be found at the
//! [official documentation site](https://developers.google.com/compute/).
@@ -77,8 +77,8 @@
//!
//! ```test_harness,no_run
//! extern crate hyper;
//! extern crate "yup-oauth2" as oauth2;
//! extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
//! extern crate yup_oauth2 as oauth2;
//! extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
//! use resourceviews1_beta2::ZoneViewsRemoveResourcesRequest;
//! use resourceviews1_beta2::{Result, Error};
//! # #[test] fn egal() {
@@ -177,20 +177,20 @@
//! [google-go-api]: https://github.com/google/google-api-go-client
//!
//!
#![feature(core,io,thread_sleep)]
#![feature(std_misc)]
// Unused attributes happen thanks to defined, but unused structures
// We don't warn about this, as depending on the API, some data structures or facilities are never used.
// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any
// unused imports in fully featured APIs. Same with unused_mut ... .
#![allow(unused_imports, unused_mut, dead_code)]
// Required for serde annotations
#![feature(custom_derive, custom_attribute, plugin)]
#![feature(custom_derive, custom_attribute, plugin, slice_patterns)]
#![plugin(serde_macros)]
#[macro_use]
extern crate hyper;
extern crate serde;
extern crate "yup-oauth2" as oauth2;
extern crate yup_oauth2 as oauth2;
extern crate mime;
extern crate url;
@@ -205,7 +205,7 @@ use std::marker::PhantomData;
use serde::json;
use std::io;
use std::fs;
use std::thread::sleep;
use std::thread::sleep_ms;
pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, Hub, ReadSeek, Part, ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder, Resource, JsonServerError};
@@ -235,8 +235,8 @@ pub enum Scope {
NdevCloudman,
}
impl Str for Scope {
fn as_slice(&self) -> &str {
impl AsRef<str> for Scope {
fn as_ref(&self) -> &str {
match *self {
Scope::Compute => "https://www.googleapis.com/auth/compute",
Scope::NdevCloudmanReadonly => "https://www.googleapis.com/auth/ndev.cloudman.readonly",
@@ -267,8 +267,8 @@ impl Default for Scope {
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate "yup-oauth2" as oauth2;
/// extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
/// extern crate yup_oauth2 as oauth2;
/// extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
/// use resourceviews1_beta2::ZoneViewsRemoveResourcesRequest;
/// use resourceviews1_beta2::{Result, Error};
/// # #[test] fn egal() {
@@ -760,8 +760,8 @@ impl Part for OperationWarningsData {}
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate "yup-oauth2" as oauth2;
/// extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
/// extern crate yup_oauth2 as oauth2;
/// extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
///
/// # #[test] fn egal() {
/// use std::default::Default;
@@ -1002,8 +1002,8 @@ impl<'a, C, NC, A> ZoneViewMethods<'a, C, NC, A> {
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate "yup-oauth2" as oauth2;
/// extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
/// extern crate yup_oauth2 as oauth2;
/// extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
///
/// # #[test] fn egal() {
/// use std::default::Default;
@@ -1094,8 +1094,8 @@ impl<'a, C, NC, A> ZoneOperationMethods<'a, C, NC, A> {
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
/// use resourceviews1_beta2::ZoneViewsRemoveResourcesRequest;
/// # #[test] fn egal() {
/// # use std::default::Default;
@@ -1166,7 +1166,7 @@ impl<'a, C, NC, A> ZoneViewRemoveResourceCall<'a, C, NC, A> where NC: hyper::net
let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/removeResources".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::CloudPlatform.as_slice().to_string(), ());
self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{resourceView}", "resourceView")].iter() {
@@ -1196,7 +1196,7 @@ impl<'a, C, NC, A> ZoneViewRemoveResourceCall<'a, C, NC, A> where NC: hyper::net
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
@@ -1219,7 +1219,7 @@ impl<'a, C, NC, A> ZoneViewRemoveResourceCall<'a, C, NC, A> where NC: hyper::net
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.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -1233,7 +1233,7 @@ impl<'a, C, NC, A> ZoneViewRemoveResourceCall<'a, C, NC, A> where NC: hyper::net
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -1244,7 +1244,7 @@ impl<'a, C, NC, A> ZoneViewRemoveResourceCall<'a, C, NC, A> where NC: hyper::net
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()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -1338,8 +1338,8 @@ impl<'a, C, NC, A> ZoneViewRemoveResourceCall<'a, C, NC, A> where NC: hyper::net
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> ZoneViewRemoveResourceCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -1355,8 +1355,8 @@ impl<'a, C, NC, A> ZoneViewRemoveResourceCall<'a, C, NC, A> where NC: hyper::net
/// 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<T>(mut self, scope: T) -> ZoneViewRemoveResourceCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -1373,8 +1373,8 @@ impl<'a, C, NC, A> ZoneViewRemoveResourceCall<'a, C, NC, A> where NC: hyper::net
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
/// use resourceviews1_beta2::ZoneViewsAddResourcesRequest;
/// # #[test] fn egal() {
/// # use std::default::Default;
@@ -1445,7 +1445,7 @@ impl<'a, C, NC, A> ZoneViewAddResourceCall<'a, C, NC, A> where NC: hyper::net::N
let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/addResources".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::CloudPlatform.as_slice().to_string(), ());
self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{resourceView}", "resourceView")].iter() {
@@ -1475,7 +1475,7 @@ impl<'a, C, NC, A> ZoneViewAddResourceCall<'a, C, NC, A> where NC: hyper::net::N
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
@@ -1498,7 +1498,7 @@ impl<'a, C, NC, A> ZoneViewAddResourceCall<'a, C, NC, A> where NC: hyper::net::N
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.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -1512,7 +1512,7 @@ impl<'a, C, NC, A> ZoneViewAddResourceCall<'a, C, NC, A> where NC: hyper::net::N
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -1523,7 +1523,7 @@ impl<'a, C, NC, A> ZoneViewAddResourceCall<'a, C, NC, A> where NC: hyper::net::N
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()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -1617,8 +1617,8 @@ impl<'a, C, NC, A> ZoneViewAddResourceCall<'a, C, NC, A> where NC: hyper::net::N
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> ZoneViewAddResourceCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -1634,8 +1634,8 @@ impl<'a, C, NC, A> ZoneViewAddResourceCall<'a, C, NC, A> where NC: hyper::net::N
/// 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<T>(mut self, scope: T) -> ZoneViewAddResourceCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -1652,8 +1652,8 @@ impl<'a, C, NC, A> ZoneViewAddResourceCall<'a, C, NC, A> where NC: hyper::net::N
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
/// # #[test] fn egal() {
/// # use std::default::Default;
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
@@ -1742,7 +1742,7 @@ impl<'a, C, NC, A> ZoneViewListResourceCall<'a, C, NC, A> where NC: hyper::net::
let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/resources".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::ComputeReadonly.as_slice().to_string(), ());
self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{resourceView}", "resourceView")].iter() {
@@ -1772,7 +1772,7 @@ impl<'a, C, NC, A> ZoneViewListResourceCall<'a, C, NC, A> where NC: hyper::net::
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
@@ -1790,7 +1790,7 @@ impl<'a, C, NC, A> ZoneViewListResourceCall<'a, C, NC, A> where NC: hyper::net::
access_token: token.unwrap().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.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone());
@@ -1801,7 +1801,7 @@ impl<'a, C, NC, A> ZoneViewListResourceCall<'a, C, NC, A> where NC: hyper::net::
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -1812,7 +1812,7 @@ impl<'a, C, NC, A> ZoneViewListResourceCall<'a, C, NC, A> where NC: hyper::net::
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()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -1937,8 +1937,8 @@ impl<'a, C, NC, A> ZoneViewListResourceCall<'a, C, NC, A> where NC: hyper::net::
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> ZoneViewListResourceCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -1954,8 +1954,8 @@ impl<'a, C, NC, A> ZoneViewListResourceCall<'a, C, NC, A> where NC: hyper::net::
/// 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<T>(mut self, scope: T) -> ZoneViewListResourceCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -1972,8 +1972,8 @@ impl<'a, C, NC, A> ZoneViewListResourceCall<'a, C, NC, A> where NC: hyper::net::
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
/// # #[test] fn egal() {
/// # use std::default::Default;
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
@@ -2037,7 +2037,7 @@ impl<'a, C, NC, A> ZoneViewGetCall<'a, C, NC, A> where NC: hyper::net::NetworkCo
let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::ComputeReadonly.as_slice().to_string(), ());
self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{resourceView}", "resourceView")].iter() {
@@ -2067,7 +2067,7 @@ impl<'a, C, NC, A> ZoneViewGetCall<'a, C, NC, A> where NC: hyper::net::NetworkCo
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
@@ -2085,7 +2085,7 @@ impl<'a, C, NC, A> ZoneViewGetCall<'a, C, NC, A> where NC: hyper::net::NetworkCo
access_token: token.unwrap().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.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone());
@@ -2096,7 +2096,7 @@ impl<'a, C, NC, A> ZoneViewGetCall<'a, C, NC, A> where NC: hyper::net::NetworkCo
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -2107,7 +2107,7 @@ impl<'a, C, NC, A> ZoneViewGetCall<'a, C, NC, A> where NC: hyper::net::NetworkCo
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()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -2192,8 +2192,8 @@ impl<'a, C, NC, A> ZoneViewGetCall<'a, C, NC, A> where NC: hyper::net::NetworkCo
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> ZoneViewGetCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -2209,8 +2209,8 @@ impl<'a, C, NC, A> ZoneViewGetCall<'a, C, NC, A> where NC: hyper::net::NetworkCo
/// 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<T>(mut self, scope: T) -> ZoneViewGetCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -2227,8 +2227,8 @@ impl<'a, C, NC, A> ZoneViewGetCall<'a, C, NC, A> where NC: hyper::net::NetworkCo
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
/// # #[test] fn egal() {
/// # use std::default::Default;
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
@@ -2300,7 +2300,7 @@ impl<'a, C, NC, A> ZoneViewListCall<'a, C, NC, A> where NC: hyper::net::NetworkC
let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::ComputeReadonly.as_slice().to_string(), ());
self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() {
@@ -2330,7 +2330,7 @@ impl<'a, C, NC, A> ZoneViewListCall<'a, C, NC, A> where NC: hyper::net::NetworkC
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
@@ -2348,7 +2348,7 @@ impl<'a, C, NC, A> ZoneViewListCall<'a, C, NC, A> where NC: hyper::net::NetworkC
access_token: token.unwrap().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.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone());
@@ -2359,7 +2359,7 @@ impl<'a, C, NC, A> ZoneViewListCall<'a, C, NC, A> where NC: hyper::net::NetworkC
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -2370,7 +2370,7 @@ impl<'a, C, NC, A> ZoneViewListCall<'a, C, NC, A> where NC: hyper::net::NetworkC
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()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -2461,8 +2461,8 @@ impl<'a, C, NC, A> ZoneViewListCall<'a, C, NC, A> where NC: hyper::net::NetworkC
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> ZoneViewListCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -2478,8 +2478,8 @@ impl<'a, C, NC, A> ZoneViewListCall<'a, C, NC, A> where NC: hyper::net::NetworkC
/// 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<T>(mut self, scope: T) -> ZoneViewListCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -2496,8 +2496,8 @@ impl<'a, C, NC, A> ZoneViewListCall<'a, C, NC, A> where NC: hyper::net::NetworkC
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
/// use resourceviews1_beta2::ResourceView;
/// # #[test] fn egal() {
/// # use std::default::Default;
@@ -2566,7 +2566,7 @@ impl<'a, C, NC, A> ZoneViewInsertCall<'a, C, NC, A> where NC: hyper::net::Networ
let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::CloudPlatform.as_slice().to_string(), ());
self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() {
@@ -2596,7 +2596,7 @@ impl<'a, C, NC, A> ZoneViewInsertCall<'a, C, NC, A> where NC: hyper::net::Networ
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
@@ -2619,7 +2619,7 @@ impl<'a, C, NC, A> ZoneViewInsertCall<'a, C, NC, A> where NC: hyper::net::Networ
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.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -2633,7 +2633,7 @@ impl<'a, C, NC, A> ZoneViewInsertCall<'a, C, NC, A> where NC: hyper::net::Networ
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -2644,7 +2644,7 @@ impl<'a, C, NC, A> ZoneViewInsertCall<'a, C, NC, A> where NC: hyper::net::Networ
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()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -2728,8 +2728,8 @@ impl<'a, C, NC, A> ZoneViewInsertCall<'a, C, NC, A> where NC: hyper::net::Networ
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> ZoneViewInsertCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -2745,8 +2745,8 @@ impl<'a, C, NC, A> ZoneViewInsertCall<'a, C, NC, A> where NC: hyper::net::Networ
/// 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<T>(mut self, scope: T) -> ZoneViewInsertCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -2763,8 +2763,8 @@ impl<'a, C, NC, A> ZoneViewInsertCall<'a, C, NC, A> where NC: hyper::net::Networ
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
/// # #[test] fn egal() {
/// # use std::default::Default;
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
@@ -2828,7 +2828,7 @@ impl<'a, C, NC, A> ZoneViewDeleteCall<'a, C, NC, A> where NC: hyper::net::Networ
let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::CloudPlatform.as_slice().to_string(), ());
self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{resourceView}", "resourceView")].iter() {
@@ -2858,7 +2858,7 @@ impl<'a, C, NC, A> ZoneViewDeleteCall<'a, C, NC, A> where NC: hyper::net::Networ
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
@@ -2876,7 +2876,7 @@ impl<'a, C, NC, A> ZoneViewDeleteCall<'a, C, NC, A> where NC: hyper::net::Networ
access_token: token.unwrap().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.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone());
@@ -2887,7 +2887,7 @@ impl<'a, C, NC, A> ZoneViewDeleteCall<'a, C, NC, A> where NC: hyper::net::Networ
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -2898,7 +2898,7 @@ impl<'a, C, NC, A> ZoneViewDeleteCall<'a, C, NC, A> where NC: hyper::net::Networ
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()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -2983,8 +2983,8 @@ impl<'a, C, NC, A> ZoneViewDeleteCall<'a, C, NC, A> where NC: hyper::net::Networ
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> ZoneViewDeleteCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -3000,8 +3000,8 @@ impl<'a, C, NC, A> ZoneViewDeleteCall<'a, C, NC, A> where NC: hyper::net::Networ
/// 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<T>(mut self, scope: T) -> ZoneViewDeleteCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -3018,8 +3018,8 @@ impl<'a, C, NC, A> ZoneViewDeleteCall<'a, C, NC, A> where NC: hyper::net::Networ
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
/// use resourceviews1_beta2::ZoneViewsSetServiceRequest;
/// # #[test] fn egal() {
/// # use std::default::Default;
@@ -3090,7 +3090,7 @@ impl<'a, C, NC, A> ZoneViewSetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/setService".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::CloudPlatform.as_slice().to_string(), ());
self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{resourceView}", "resourceView")].iter() {
@@ -3120,7 +3120,7 @@ impl<'a, C, NC, A> ZoneViewSetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
@@ -3143,7 +3143,7 @@ impl<'a, C, NC, A> ZoneViewSetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
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.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -3157,7 +3157,7 @@ impl<'a, C, NC, A> ZoneViewSetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -3168,7 +3168,7 @@ impl<'a, C, NC, A> ZoneViewSetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
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()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -3262,8 +3262,8 @@ impl<'a, C, NC, A> ZoneViewSetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> ZoneViewSetServiceCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -3279,8 +3279,8 @@ impl<'a, C, NC, A> ZoneViewSetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
/// 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<T>(mut self, scope: T) -> ZoneViewSetServiceCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -3297,8 +3297,8 @@ impl<'a, C, NC, A> ZoneViewSetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
/// # #[test] fn egal() {
/// # use std::default::Default;
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
@@ -3367,7 +3367,7 @@ impl<'a, C, NC, A> ZoneViewGetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/getService".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::CloudPlatform.as_slice().to_string(), ());
self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{resourceView}", "resourceView")].iter() {
@@ -3397,7 +3397,7 @@ impl<'a, C, NC, A> ZoneViewGetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
@@ -3415,7 +3415,7 @@ impl<'a, C, NC, A> ZoneViewGetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
access_token: token.unwrap().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.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone());
@@ -3426,7 +3426,7 @@ impl<'a, C, NC, A> ZoneViewGetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -3437,7 +3437,7 @@ impl<'a, C, NC, A> ZoneViewGetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
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()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -3530,8 +3530,8 @@ impl<'a, C, NC, A> ZoneViewGetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> ZoneViewGetServiceCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -3547,8 +3547,8 @@ impl<'a, C, NC, A> ZoneViewGetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
/// 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<T>(mut self, scope: T) -> ZoneViewGetServiceCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -3565,8 +3565,8 @@ impl<'a, C, NC, A> ZoneViewGetServiceCall<'a, C, NC, A> where NC: hyper::net::Ne
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
/// # #[test] fn egal() {
/// # use std::default::Default;
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
@@ -3630,7 +3630,7 @@ impl<'a, C, NC, A> ZoneOperationGetCall<'a, C, NC, A> where NC: hyper::net::Netw
let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/operations/{operation}".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::ComputeReadonly.as_slice().to_string(), ());
self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{operation}", "operation")].iter() {
@@ -3660,7 +3660,7 @@ impl<'a, C, NC, A> ZoneOperationGetCall<'a, C, NC, A> where NC: hyper::net::Netw
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
@@ -3678,7 +3678,7 @@ impl<'a, C, NC, A> ZoneOperationGetCall<'a, C, NC, A> where NC: hyper::net::Netw
access_token: token.unwrap().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.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone());
@@ -3689,7 +3689,7 @@ impl<'a, C, NC, A> ZoneOperationGetCall<'a, C, NC, A> where NC: hyper::net::Netw
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -3700,7 +3700,7 @@ impl<'a, C, NC, A> ZoneOperationGetCall<'a, C, NC, A> where NC: hyper::net::Netw
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()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -3785,8 +3785,8 @@ impl<'a, C, NC, A> ZoneOperationGetCall<'a, C, NC, A> where NC: hyper::net::Netw
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> ZoneOperationGetCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -3802,8 +3802,8 @@ impl<'a, C, NC, A> ZoneOperationGetCall<'a, C, NC, A> where NC: hyper::net::Netw
/// 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<T>(mut self, scope: T) -> ZoneOperationGetCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}
@@ -3820,8 +3820,8 @@ impl<'a, C, NC, A> ZoneOperationGetCall<'a, C, NC, A> where NC: hyper::net::Netw
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate "yup-oauth2" as oauth2;
/// # extern crate "google-resourceviews1_beta2" as resourceviews1_beta2;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_resourceviews1_beta2 as resourceviews1_beta2;
/// # #[test] fn egal() {
/// # use std::default::Default;
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
@@ -3898,7 +3898,7 @@ impl<'a, C, NC, A> ZoneOperationListCall<'a, C, NC, A> where NC: hyper::net::Net
let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/operations".to_string();
if self._scopes.len() == 0 {
self._scopes.insert(Scope::ComputeReadonly.as_slice().to_string(), ());
self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() {
@@ -3928,7 +3928,7 @@ impl<'a, C, NC, A> ZoneOperationListCall<'a, C, NC, A> where NC: hyper::net::Net
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_ref()))));
}
@@ -3946,7 +3946,7 @@ impl<'a, C, NC, A> ZoneOperationListCall<'a, C, NC, A> where NC: hyper::net::Net
access_token: token.unwrap().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.as_slice())
let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.as_ref())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone());
@@ -3957,7 +3957,7 @@ impl<'a, C, NC, A> ZoneOperationListCall<'a, C, NC, A> where NC: hyper::net::Net
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -3968,7 +3968,7 @@ impl<'a, C, NC, A> ZoneOperationListCall<'a, C, NC, A> where NC: hyper::net::Net
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()) {
sleep(d);
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
@@ -4067,8 +4067,8 @@ impl<'a, C, NC, A> ZoneOperationListCall<'a, C, NC, A> where NC: hyper::net::Net
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> ZoneOperationListCall<'a, C, NC, A>
where T: Str {
self._additional_params.insert(name.as_slice().to_string(), value.as_slice().to_string());
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
@@ -4084,8 +4084,8 @@ impl<'a, C, NC, A> ZoneOperationListCall<'a, C, NC, A> where NC: hyper::net::Net
/// 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<T>(mut self, scope: T) -> ZoneOperationListCall<'a, C, NC, A>
where T: Str {
self._scopes.insert(scope.as_slice().to_string(), ());
where T: AsRef<str> {
self._scopes.insert(scope.as_ref().to_string(), ());
self
}
}