mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +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))
|
||||
|
||||
@@ -82,8 +82,8 @@
|
||||
//!
|
||||
//! ```test_harness,no_run
|
||||
//! extern crate hyper;
|
||||
//! extern crate "yup-oauth2" as oauth2;
|
||||
//! extern crate "google-admin1_reports" as admin1_reports;
|
||||
//! extern crate yup_oauth2 as oauth2;
|
||||
//! extern crate google_admin1_reports as admin1_reports;
|
||||
//! use admin1_reports::Channel;
|
||||
//! use admin1_reports::{Result, Error};
|
||||
//! # #[test] fn egal() {
|
||||
@@ -190,20 +190,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;
|
||||
|
||||
@@ -218,7 +218,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};
|
||||
|
||||
@@ -239,8 +239,8 @@ pub enum Scope {
|
||||
ReportUsageReadonly,
|
||||
}
|
||||
|
||||
impl Str for Scope {
|
||||
fn as_slice(&self) -> &str {
|
||||
impl AsRef<str> for Scope {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
Scope::ReportAuditReadonly => "https://www.googleapis.com/auth/admin.reports.audit.readonly",
|
||||
Scope::ReportUsageReadonly => "https://www.googleapis.com/auth/admin.reports.usage.readonly",
|
||||
@@ -268,8 +268,8 @@ impl Default for Scope {
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate "yup-oauth2" as oauth2;
|
||||
/// extern crate "google-admin1_reports" as admin1_reports;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_admin1_reports as admin1_reports;
|
||||
/// use admin1_reports::Channel;
|
||||
/// use admin1_reports::{Result, Error};
|
||||
/// # #[test] fn egal() {
|
||||
@@ -710,8 +710,8 @@ impl ResponseResult for Channel {}
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate "yup-oauth2" as oauth2;
|
||||
/// extern crate "google-admin1_reports" as admin1_reports;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_admin1_reports as admin1_reports;
|
||||
///
|
||||
/// # #[test] fn egal() {
|
||||
/// use std::default::Default;
|
||||
@@ -768,8 +768,8 @@ impl<'a, C, NC, A> ChannelMethods<'a, C, NC, A> {
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate "yup-oauth2" as oauth2;
|
||||
/// extern crate "google-admin1_reports" as admin1_reports;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_admin1_reports as admin1_reports;
|
||||
///
|
||||
/// # #[test] fn egal() {
|
||||
/// use std::default::Default;
|
||||
@@ -865,8 +865,8 @@ impl<'a, C, NC, A> ActivityMethods<'a, C, NC, A> {
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate "yup-oauth2" as oauth2;
|
||||
/// extern crate "google-admin1_reports" as admin1_reports;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_admin1_reports as admin1_reports;
|
||||
///
|
||||
/// # #[test] fn egal() {
|
||||
/// use std::default::Default;
|
||||
@@ -926,8 +926,8 @@ impl<'a, C, NC, A> CustomerUsageReportMethods<'a, C, NC, A> {
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate "yup-oauth2" as oauth2;
|
||||
/// extern crate "google-admin1_reports" as admin1_reports;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_admin1_reports as admin1_reports;
|
||||
///
|
||||
/// # #[test] fn egal() {
|
||||
/// use std::default::Default;
|
||||
@@ -999,8 +999,8 @@ impl<'a, C, NC, A> UserUsageReportMethods<'a, C, NC, A> {
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate "yup-oauth2" as oauth2;
|
||||
/// # extern crate "google-admin1_reports" as admin1_reports;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_admin1_reports as admin1_reports;
|
||||
/// use admin1_reports::Channel;
|
||||
/// # #[test] fn egal() {
|
||||
/// # use std::default::Default;
|
||||
@@ -1064,13 +1064,13 @@ impl<'a, C, NC, A> ChannelStopCall<'a, C, NC, A> where NC: hyper::net::NetworkCo
|
||||
|
||||
let mut url = "https://www.googleapis.com/admin/reports/v1//admin/reports_v1/channels/stop".to_string();
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::ReportAuditReadonly.as_slice().to_string(), ());
|
||||
self._scopes.insert(Scope::ReportAuditReadonly.as_ref().to_string(), ());
|
||||
}
|
||||
|
||||
|
||||
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());
|
||||
@@ -1093,7 +1093,7 @@ impl<'a, C, NC, A> ChannelStopCall<'a, C, NC, A> where NC: hyper::net::NetworkCo
|
||||
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()))
|
||||
@@ -1107,7 +1107,7 @@ impl<'a, C, NC, A> ChannelStopCall<'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);
|
||||
@@ -1118,7 +1118,7 @@ impl<'a, C, NC, A> ChannelStopCall<'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);
|
||||
@@ -1172,8 +1172,8 @@ impl<'a, C, NC, A> ChannelStopCall<'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) -> ChannelStopCall<'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
|
||||
}
|
||||
|
||||
@@ -1189,8 +1189,8 @@ impl<'a, C, NC, A> ChannelStopCall<'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) -> ChannelStopCall<'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
|
||||
}
|
||||
}
|
||||
@@ -1207,8 +1207,8 @@ impl<'a, C, NC, A> ChannelStopCall<'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-admin1_reports" as admin1_reports;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_admin1_reports as admin1_reports;
|
||||
/// use admin1_reports::Channel;
|
||||
/// # #[test] fn egal() {
|
||||
/// # use std::default::Default;
|
||||
@@ -1317,7 +1317,7 @@ impl<'a, C, NC, A> ActivityWatchCall<'a, C, NC, A> where NC: hyper::net::Network
|
||||
|
||||
let mut url = "https://www.googleapis.com/admin/reports/v1/activity/users/{userKey}/applications/{applicationName}/watch".to_string();
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::ReportAuditReadonly.as_slice().to_string(), ());
|
||||
self._scopes.insert(Scope::ReportAuditReadonly.as_ref().to_string(), ());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{userKey}", "userKey"), ("{applicationName}", "applicationName")].iter() {
|
||||
@@ -1347,7 +1347,7 @@ impl<'a, C, NC, A> ActivityWatchCall<'a, C, NC, A> where NC: hyper::net::Network
|
||||
|
||||
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());
|
||||
@@ -1370,7 +1370,7 @@ impl<'a, C, NC, A> ActivityWatchCall<'a, C, NC, A> where NC: hyper::net::Network
|
||||
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()))
|
||||
@@ -1384,7 +1384,7 @@ impl<'a, C, NC, A> ActivityWatchCall<'a, C, NC, A> where NC: hyper::net::Network
|
||||
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);
|
||||
@@ -1395,7 +1395,7 @@ impl<'a, C, NC, A> ActivityWatchCall<'a, C, NC, A> where NC: hyper::net::Network
|
||||
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);
|
||||
@@ -1543,8 +1543,8 @@ impl<'a, C, NC, A> ActivityWatchCall<'a, C, NC, A> where NC: hyper::net::Network
|
||||
/// * *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) -> ActivityWatchCall<'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
|
||||
}
|
||||
|
||||
@@ -1560,8 +1560,8 @@ impl<'a, C, NC, A> ActivityWatchCall<'a, C, NC, A> where NC: hyper::net::Network
|
||||
/// 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) -> ActivityWatchCall<'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
|
||||
}
|
||||
}
|
||||
@@ -1578,8 +1578,8 @@ impl<'a, C, NC, A> ActivityWatchCall<'a, C, NC, A> where NC: hyper::net::Network
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate "yup-oauth2" as oauth2;
|
||||
/// # extern crate "google-admin1_reports" as admin1_reports;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_admin1_reports as admin1_reports;
|
||||
/// # #[test] fn egal() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
|
||||
@@ -1681,7 +1681,7 @@ impl<'a, C, NC, A> ActivityListCall<'a, C, NC, A> where NC: hyper::net::NetworkC
|
||||
|
||||
let mut url = "https://www.googleapis.com/admin/reports/v1/activity/users/{userKey}/applications/{applicationName}".to_string();
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::ReportAuditReadonly.as_slice().to_string(), ());
|
||||
self._scopes.insert(Scope::ReportAuditReadonly.as_ref().to_string(), ());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{userKey}", "userKey"), ("{applicationName}", "applicationName")].iter() {
|
||||
@@ -1711,7 +1711,7 @@ impl<'a, C, NC, A> ActivityListCall<'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()))));
|
||||
}
|
||||
|
||||
|
||||
@@ -1729,7 +1729,7 @@ impl<'a, C, NC, A> ActivityListCall<'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());
|
||||
|
||||
@@ -1740,7 +1740,7 @@ impl<'a, C, NC, A> ActivityListCall<'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);
|
||||
@@ -1751,7 +1751,7 @@ impl<'a, C, NC, A> ActivityListCall<'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);
|
||||
@@ -1890,8 +1890,8 @@ impl<'a, C, NC, A> ActivityListCall<'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) -> ActivityListCall<'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
|
||||
}
|
||||
|
||||
@@ -1907,8 +1907,8 @@ impl<'a, C, NC, A> ActivityListCall<'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) -> ActivityListCall<'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
|
||||
}
|
||||
}
|
||||
@@ -1925,8 +1925,8 @@ impl<'a, C, NC, A> ActivityListCall<'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-admin1_reports" as admin1_reports;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_admin1_reports as admin1_reports;
|
||||
/// # #[test] fn egal() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
|
||||
@@ -2001,7 +2001,7 @@ impl<'a, C, NC, A> CustomerUsageReportGetCall<'a, C, NC, A> where NC: hyper::net
|
||||
|
||||
let mut url = "https://www.googleapis.com/admin/reports/v1/usage/dates/{date}".to_string();
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::ReportAuditReadonly.as_slice().to_string(), ());
|
||||
self._scopes.insert(Scope::ReportAuditReadonly.as_ref().to_string(), ());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{date}", "date")].iter() {
|
||||
@@ -2031,7 +2031,7 @@ impl<'a, C, NC, A> CustomerUsageReportGetCall<'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()))));
|
||||
}
|
||||
|
||||
|
||||
@@ -2049,7 +2049,7 @@ impl<'a, C, NC, A> CustomerUsageReportGetCall<'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());
|
||||
|
||||
@@ -2060,7 +2060,7 @@ impl<'a, C, NC, A> CustomerUsageReportGetCall<'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);
|
||||
@@ -2071,7 +2071,7 @@ impl<'a, C, NC, A> CustomerUsageReportGetCall<'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);
|
||||
@@ -2160,8 +2160,8 @@ impl<'a, C, NC, A> CustomerUsageReportGetCall<'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) -> CustomerUsageReportGetCall<'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
|
||||
}
|
||||
|
||||
@@ -2177,8 +2177,8 @@ impl<'a, C, NC, A> CustomerUsageReportGetCall<'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) -> CustomerUsageReportGetCall<'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
|
||||
}
|
||||
}
|
||||
@@ -2195,8 +2195,8 @@ impl<'a, C, NC, A> CustomerUsageReportGetCall<'a, C, NC, A> where NC: hyper::net
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate "yup-oauth2" as oauth2;
|
||||
/// # extern crate "google-admin1_reports" as admin1_reports;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_admin1_reports as admin1_reports;
|
||||
/// # #[test] fn egal() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
|
||||
@@ -2283,7 +2283,7 @@ impl<'a, C, NC, A> UserUsageReportGetCall<'a, C, NC, A> where NC: hyper::net::Ne
|
||||
|
||||
let mut url = "https://www.googleapis.com/admin/reports/v1/usage/users/{userKey}/dates/{date}".to_string();
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::ReportAuditReadonly.as_slice().to_string(), ());
|
||||
self._scopes.insert(Scope::ReportAuditReadonly.as_ref().to_string(), ());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{userKey}", "userKey"), ("{date}", "date")].iter() {
|
||||
@@ -2313,7 +2313,7 @@ impl<'a, C, NC, A> UserUsageReportGetCall<'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()))));
|
||||
}
|
||||
|
||||
|
||||
@@ -2331,7 +2331,7 @@ impl<'a, C, NC, A> UserUsageReportGetCall<'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::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());
|
||||
|
||||
@@ -2342,7 +2342,7 @@ impl<'a, C, NC, A> UserUsageReportGetCall<'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);
|
||||
@@ -2353,7 +2353,7 @@ impl<'a, C, NC, A> UserUsageReportGetCall<'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);
|
||||
@@ -2468,8 +2468,8 @@ impl<'a, C, NC, A> UserUsageReportGetCall<'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) -> UserUsageReportGetCall<'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
|
||||
}
|
||||
|
||||
@@ -2485,8 +2485,8 @@ impl<'a, C, NC, A> UserUsageReportGetCall<'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) -> UserUsageReportGetCall<'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