mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-08 20:42:39 +01:00
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:
@@ -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))
|
||||
|
||||
@@ -78,8 +78,8 @@
|
||||
//!
|
||||
//! ```test_harness,no_run
|
||||
//! extern crate hyper;
|
||||
//! extern crate "yup-oauth2" as oauth2;
|
||||
//! extern crate "google-taskqueue1_beta2" as taskqueue1_beta2;
|
||||
//! extern crate yup_oauth2 as oauth2;
|
||||
//! extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
//! use taskqueue1_beta2::{Result, Error};
|
||||
//! # #[test] fn egal() {
|
||||
//! use std::default::Default;
|
||||
@@ -174,20 +174,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;
|
||||
|
||||
@@ -202,7 +202,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};
|
||||
|
||||
@@ -223,8 +223,8 @@ pub enum Scope {
|
||||
Consumer,
|
||||
}
|
||||
|
||||
impl Str for Scope {
|
||||
fn as_slice(&self) -> &str {
|
||||
impl AsRef<str> for Scope {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
Scope::Full => "https://www.googleapis.com/auth/taskqueue",
|
||||
Scope::Consumer => "https://www.googleapis.com/auth/taskqueue.consumer",
|
||||
@@ -252,8 +252,8 @@ impl Default for Scope {
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate "yup-oauth2" as oauth2;
|
||||
/// extern crate "google-taskqueue1_beta2" as taskqueue1_beta2;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// use taskqueue1_beta2::{Result, Error};
|
||||
/// # #[test] fn egal() {
|
||||
/// use std::default::Default;
|
||||
@@ -510,8 +510,8 @@ impl ResponseResult for Tasks {}
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate "yup-oauth2" as oauth2;
|
||||
/// extern crate "google-taskqueue1_beta2" as taskqueue1_beta2;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
///
|
||||
/// # #[test] fn egal() {
|
||||
/// use std::default::Default;
|
||||
@@ -571,8 +571,8 @@ impl<'a, C, NC, A> TaskqueueMethods<'a, C, NC, A> {
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate "yup-oauth2" as oauth2;
|
||||
/// extern crate "google-taskqueue1_beta2" as taskqueue1_beta2;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
///
|
||||
/// # #[test] fn egal() {
|
||||
/// use std::default::Default;
|
||||
@@ -777,8 +777,8 @@ impl<'a, C, NC, A> TaskMethods<'a, C, NC, A> {
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate "yup-oauth2" as oauth2;
|
||||
/// # extern crate "google-taskqueue1_beta2" as taskqueue1_beta2;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// # #[test] fn egal() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
|
||||
@@ -845,7 +845,7 @@ impl<'a, C, NC, A> TaskqueueGetCall<'a, C, NC, A> where NC: hyper::net::NetworkC
|
||||
|
||||
let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}".to_string();
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::Full.as_slice().to_string(), ());
|
||||
self._scopes.insert(Scope::Full.as_ref().to_string(), ());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{project}", "project"), ("{taskqueue}", "taskqueue")].iter() {
|
||||
@@ -875,7 +875,7 @@ impl<'a, C, NC, A> TaskqueueGetCall<'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()))));
|
||||
}
|
||||
|
||||
|
||||
@@ -893,7 +893,7 @@ impl<'a, C, NC, A> TaskqueueGetCall<'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());
|
||||
|
||||
@@ -904,7 +904,7 @@ impl<'a, C, NC, A> TaskqueueGetCall<'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);
|
||||
@@ -915,7 +915,7 @@ impl<'a, C, NC, A> TaskqueueGetCall<'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);
|
||||
@@ -998,8 +998,8 @@ impl<'a, C, NC, A> TaskqueueGetCall<'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) -> TaskqueueGetCall<'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
|
||||
}
|
||||
|
||||
@@ -1015,8 +1015,8 @@ impl<'a, C, NC, A> TaskqueueGetCall<'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) -> TaskqueueGetCall<'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
|
||||
}
|
||||
}
|
||||
@@ -1033,8 +1033,8 @@ impl<'a, C, NC, A> TaskqueueGetCall<'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-taskqueue1_beta2" as taskqueue1_beta2;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// # #[test] fn egal() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
|
||||
@@ -1110,7 +1110,7 @@ impl<'a, C, NC, A> TaskLeaseCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
|
||||
let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/lease".to_string();
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::Full.as_slice().to_string(), ());
|
||||
self._scopes.insert(Scope::Full.as_ref().to_string(), ());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{project}", "project"), ("{taskqueue}", "taskqueue")].iter() {
|
||||
@@ -1140,7 +1140,7 @@ impl<'a, C, NC, A> TaskLeaseCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
|
||||
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()))));
|
||||
}
|
||||
|
||||
|
||||
@@ -1158,7 +1158,7 @@ impl<'a, C, NC, A> TaskLeaseCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
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());
|
||||
|
||||
@@ -1169,7 +1169,7 @@ impl<'a, C, NC, A> TaskLeaseCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
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);
|
||||
@@ -1180,7 +1180,7 @@ impl<'a, C, NC, A> TaskLeaseCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
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);
|
||||
@@ -1291,8 +1291,8 @@ impl<'a, C, NC, A> TaskLeaseCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
/// * *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) -> TaskLeaseCall<'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
|
||||
}
|
||||
|
||||
@@ -1308,8 +1308,8 @@ impl<'a, C, NC, A> TaskLeaseCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
/// 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) -> TaskLeaseCall<'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
|
||||
}
|
||||
}
|
||||
@@ -1326,8 +1326,8 @@ impl<'a, C, NC, A> TaskLeaseCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate "yup-oauth2" as oauth2;
|
||||
/// # extern crate "google-taskqueue1_beta2" as taskqueue1_beta2;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// use taskqueue1_beta2::Task;
|
||||
/// # #[test] fn egal() {
|
||||
/// # use std::default::Default;
|
||||
@@ -1396,7 +1396,7 @@ impl<'a, C, NC, A> TaskInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
|
||||
let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks".to_string();
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::Full.as_slice().to_string(), ());
|
||||
self._scopes.insert(Scope::Full.as_ref().to_string(), ());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{project}", "project"), ("{taskqueue}", "taskqueue")].iter() {
|
||||
@@ -1426,7 +1426,7 @@ impl<'a, C, NC, A> TaskInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
|
||||
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());
|
||||
@@ -1449,7 +1449,7 @@ impl<'a, C, NC, A> TaskInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
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()))
|
||||
@@ -1463,7 +1463,7 @@ impl<'a, C, NC, A> TaskInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
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);
|
||||
@@ -1474,7 +1474,7 @@ impl<'a, C, NC, A> TaskInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
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);
|
||||
@@ -1558,8 +1558,8 @@ impl<'a, C, NC, A> TaskInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
/// * *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) -> TaskInsertCall<'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
|
||||
}
|
||||
|
||||
@@ -1575,8 +1575,8 @@ impl<'a, C, NC, A> TaskInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
/// 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) -> TaskInsertCall<'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
|
||||
}
|
||||
}
|
||||
@@ -1593,8 +1593,8 @@ impl<'a, C, NC, A> TaskInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate "yup-oauth2" as oauth2;
|
||||
/// # extern crate "google-taskqueue1_beta2" as taskqueue1_beta2;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// # #[test] fn egal() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
|
||||
@@ -1657,7 +1657,7 @@ impl<'a, C, NC, A> TaskDeleteCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
|
||||
let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}".to_string();
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::Full.as_slice().to_string(), ());
|
||||
self._scopes.insert(Scope::Full.as_ref().to_string(), ());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{project}", "project"), ("{taskqueue}", "taskqueue"), ("{task}", "task")].iter() {
|
||||
@@ -1687,7 +1687,7 @@ impl<'a, C, NC, A> TaskDeleteCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
|
||||
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()))));
|
||||
}
|
||||
|
||||
|
||||
@@ -1705,7 +1705,7 @@ impl<'a, C, NC, A> TaskDeleteCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
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());
|
||||
|
||||
@@ -1716,7 +1716,7 @@ impl<'a, C, NC, A> TaskDeleteCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
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);
|
||||
@@ -1727,7 +1727,7 @@ impl<'a, C, NC, A> TaskDeleteCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
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);
|
||||
@@ -1802,8 +1802,8 @@ impl<'a, C, NC, A> TaskDeleteCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
/// * *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) -> TaskDeleteCall<'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
|
||||
}
|
||||
|
||||
@@ -1819,8 +1819,8 @@ impl<'a, C, NC, A> TaskDeleteCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
/// 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) -> TaskDeleteCall<'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
|
||||
}
|
||||
}
|
||||
@@ -1837,8 +1837,8 @@ impl<'a, C, NC, A> TaskDeleteCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate "yup-oauth2" as oauth2;
|
||||
/// # extern crate "google-taskqueue1_beta2" as taskqueue1_beta2;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// use taskqueue1_beta2::Task;
|
||||
/// # #[test] fn egal() {
|
||||
/// # use std::default::Default;
|
||||
@@ -1911,7 +1911,7 @@ impl<'a, C, NC, A> TaskPatchCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
|
||||
let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}".to_string();
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::Full.as_slice().to_string(), ());
|
||||
self._scopes.insert(Scope::Full.as_ref().to_string(), ());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{project}", "project"), ("{taskqueue}", "taskqueue"), ("{task}", "task")].iter() {
|
||||
@@ -1941,7 +1941,7 @@ impl<'a, C, NC, A> TaskPatchCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
|
||||
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());
|
||||
@@ -1964,7 +1964,7 @@ impl<'a, C, NC, A> TaskPatchCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
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.as_slice())
|
||||
let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.as_ref())
|
||||
.header(UserAgent(self.hub._user_agent.clone()))
|
||||
.header(auth_header.clone())
|
||||
.header(ContentType(json_mime_type.clone()))
|
||||
@@ -1978,7 +1978,7 @@ impl<'a, C, NC, A> TaskPatchCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
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);
|
||||
@@ -1989,7 +1989,7 @@ impl<'a, C, NC, A> TaskPatchCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
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);
|
||||
@@ -2091,8 +2091,8 @@ impl<'a, C, NC, A> TaskPatchCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
/// * *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) -> TaskPatchCall<'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
|
||||
}
|
||||
|
||||
@@ -2108,8 +2108,8 @@ impl<'a, C, NC, A> TaskPatchCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
/// 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) -> TaskPatchCall<'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
|
||||
}
|
||||
}
|
||||
@@ -2126,8 +2126,8 @@ impl<'a, C, NC, A> TaskPatchCall<'a, C, NC, A> where NC: hyper::net::NetworkConn
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate "yup-oauth2" as oauth2;
|
||||
/// # extern crate "google-taskqueue1_beta2" as taskqueue1_beta2;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// # #[test] fn egal() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
|
||||
@@ -2189,7 +2189,7 @@ impl<'a, C, NC, A> TaskListCall<'a, C, NC, A> where NC: hyper::net::NetworkConne
|
||||
|
||||
let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks".to_string();
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::Full.as_slice().to_string(), ());
|
||||
self._scopes.insert(Scope::Full.as_ref().to_string(), ());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{project}", "project"), ("{taskqueue}", "taskqueue")].iter() {
|
||||
@@ -2219,7 +2219,7 @@ impl<'a, C, NC, A> TaskListCall<'a, C, NC, A> where NC: hyper::net::NetworkConne
|
||||
|
||||
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()))));
|
||||
}
|
||||
|
||||
|
||||
@@ -2237,7 +2237,7 @@ impl<'a, C, NC, A> TaskListCall<'a, C, NC, A> where NC: hyper::net::NetworkConne
|
||||
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());
|
||||
|
||||
@@ -2248,7 +2248,7 @@ impl<'a, C, NC, A> TaskListCall<'a, C, NC, A> where NC: hyper::net::NetworkConne
|
||||
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);
|
||||
@@ -2259,7 +2259,7 @@ impl<'a, C, NC, A> TaskListCall<'a, C, NC, A> where NC: hyper::net::NetworkConne
|
||||
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);
|
||||
@@ -2334,8 +2334,8 @@ impl<'a, C, NC, A> TaskListCall<'a, C, NC, A> where NC: hyper::net::NetworkConne
|
||||
/// * *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) -> TaskListCall<'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
|
||||
}
|
||||
|
||||
@@ -2351,8 +2351,8 @@ impl<'a, C, NC, A> TaskListCall<'a, C, NC, A> where NC: hyper::net::NetworkConne
|
||||
/// 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) -> TaskListCall<'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
|
||||
}
|
||||
}
|
||||
@@ -2369,8 +2369,8 @@ impl<'a, C, NC, A> TaskListCall<'a, C, NC, A> where NC: hyper::net::NetworkConne
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate "yup-oauth2" as oauth2;
|
||||
/// # extern crate "google-taskqueue1_beta2" as taskqueue1_beta2;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// # #[test] fn egal() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
|
||||
@@ -2434,7 +2434,7 @@ impl<'a, C, NC, A> TaskGetCall<'a, C, NC, A> where NC: hyper::net::NetworkConnec
|
||||
|
||||
let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}".to_string();
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::Full.as_slice().to_string(), ());
|
||||
self._scopes.insert(Scope::Full.as_ref().to_string(), ());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{project}", "project"), ("{taskqueue}", "taskqueue"), ("{task}", "task")].iter() {
|
||||
@@ -2464,7 +2464,7 @@ impl<'a, C, NC, A> TaskGetCall<'a, C, NC, A> where NC: hyper::net::NetworkConnec
|
||||
|
||||
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()))));
|
||||
}
|
||||
|
||||
|
||||
@@ -2482,7 +2482,7 @@ impl<'a, C, NC, A> TaskGetCall<'a, C, NC, A> where NC: hyper::net::NetworkConnec
|
||||
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());
|
||||
|
||||
@@ -2493,7 +2493,7 @@ impl<'a, C, NC, A> TaskGetCall<'a, C, NC, A> where NC: hyper::net::NetworkConnec
|
||||
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);
|
||||
@@ -2504,7 +2504,7 @@ impl<'a, C, NC, A> TaskGetCall<'a, C, NC, A> where NC: hyper::net::NetworkConnec
|
||||
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);
|
||||
@@ -2589,8 +2589,8 @@ impl<'a, C, NC, A> TaskGetCall<'a, C, NC, A> where NC: hyper::net::NetworkConnec
|
||||
/// * *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) -> TaskGetCall<'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
|
||||
}
|
||||
|
||||
@@ -2606,8 +2606,8 @@ impl<'a, C, NC, A> TaskGetCall<'a, C, NC, A> where NC: hyper::net::NetworkConnec
|
||||
/// 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) -> TaskGetCall<'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
|
||||
}
|
||||
}
|
||||
@@ -2624,8 +2624,8 @@ impl<'a, C, NC, A> TaskGetCall<'a, C, NC, A> where NC: hyper::net::NetworkConnec
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate "yup-oauth2" as oauth2;
|
||||
/// # extern crate "google-taskqueue1_beta2" as taskqueue1_beta2;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// use taskqueue1_beta2::Task;
|
||||
/// # #[test] fn egal() {
|
||||
/// # use std::default::Default;
|
||||
@@ -2698,7 +2698,7 @@ impl<'a, C, NC, A> TaskUpdateCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
|
||||
let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}".to_string();
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::Full.as_slice().to_string(), ());
|
||||
self._scopes.insert(Scope::Full.as_ref().to_string(), ());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{project}", "project"), ("{taskqueue}", "taskqueue"), ("{task}", "task")].iter() {
|
||||
@@ -2728,7 +2728,7 @@ impl<'a, C, NC, A> TaskUpdateCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
|
||||
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());
|
||||
@@ -2751,7 +2751,7 @@ impl<'a, C, NC, A> TaskUpdateCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
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()))
|
||||
@@ -2765,7 +2765,7 @@ impl<'a, C, NC, A> TaskUpdateCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
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);
|
||||
@@ -2776,7 +2776,7 @@ impl<'a, C, NC, A> TaskUpdateCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
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);
|
||||
@@ -2878,8 +2878,8 @@ impl<'a, C, NC, A> TaskUpdateCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
/// * *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) -> TaskUpdateCall<'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
|
||||
}
|
||||
|
||||
@@ -2895,8 +2895,8 @@ impl<'a, C, NC, A> TaskUpdateCall<'a, C, NC, A> where NC: hyper::net::NetworkCon
|
||||
/// 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) -> TaskUpdateCall<'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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user