chore(code): updated to latest state

This commit is contained in:
Sebastian Thiel
2016-01-30 14:08:25 +01:00
parent 5cba22f0c6
commit 75076acf16
1164 changed files with 241839 additions and 123033 deletions

View File

@@ -5,7 +5,8 @@ use std;
use std::fmt::{self, Display};
use std::str::FromStr;
use std::error;
use std::thread::sleep_ms;
use std::thread::sleep;
use std::time::Duration;
use mime::{Mime, TopLevel, SubLevel, Attr, Value};
use oauth2::{TokenType, Retry, self};
@@ -43,7 +44,7 @@ pub trait RequestValue {}
/// This might be a bug within the google API schema.
pub trait UnusedType {}
/// Identifies types which are only used as part of other types, which
/// Identifies types which are only used as part of other types, which
/// usually are carrying the `Resource` trait.
pub trait Part {}
@@ -78,7 +79,7 @@ pub struct ErrorResponse {
pub struct ServerError {
errors: Vec<ServerMessage>,
code: u16,
message: String,
message: String,
}
#[derive(Deserialize, Serialize, Debug)]
@@ -115,11 +116,11 @@ impl hyper::net::NetworkStream for DummyNetworkStream {
Ok("127.0.0.1:1337".parse().unwrap())
}
fn set_read_timeout(&self, _dur: Option<std::time::Duration>) -> io::Result<()> {
fn set_read_timeout(&self, _dur: Option<Duration>) -> io::Result<()> {
Ok(())
}
fn set_write_timeout(&self, _dur: Option<std::time::Duration>) -> io::Result<()> {
fn set_write_timeout(&self, _dur: Option<Duration>) -> io::Result<()> {
Ok(())
}
}
@@ -128,7 +129,7 @@ impl hyper::net::NetworkStream for DummyNetworkStream {
/// A trait specifying functionality to help controlling any request performed by the API.
/// The trait has a conservative default implementation.
///
/// It contains methods to deal with all common issues, as well with the ones related to
/// It contains methods to deal with all common issues, as well with the ones related to
/// uploading media
pub trait Delegate {
@@ -136,12 +137,12 @@ pub trait Delegate {
/// information if he is interesting in knowing more context when further calls to it
/// are made.
/// The matching `finished()` call will always be made, no matter whether or not the API
/// request was successful. That way, the delegate may easily maintain a clean state
/// request was successful. That way, the delegate may easily maintain a clean state
/// between various API calls.
fn begin(&mut self, MethodInfo) {}
/// Called whenever there is an [HttpError](http://hyperium.github.io/hyper/hyper/error/enum.HttpError.html), usually if there are network problems.
///
///
/// If you choose to retry after a duration, the duration should be chosen using the
/// [exponential backoff algorithm](http://en.wikipedia.org/wiki/Exponential_backoff).
///
@@ -150,7 +151,7 @@ pub trait Delegate {
Retry::Abort
}
/// Called whenever there is the need for your applications API key after
/// Called whenever there is the need for your applications API key after
/// the official authenticator implementation didn't provide one, for some reason.
/// If this method returns None as well, the underlying operation will fail
fn api_key(&mut self) -> Option<String> {
@@ -179,7 +180,7 @@ pub trait Delegate {
}
/// Called after we have retrieved a new upload URL for a resumable upload to store it
/// in case we fail or cancel. That way, we can attempt to resume the upload later,
/// in case we fail or cancel. That way, we can attempt to resume the upload later,
/// see `upload_url()`.
/// It will also be called with None after a successful upload, which allows the delegate
/// to forget the URL. That way, we will not attempt to resume an upload that has already
@@ -191,7 +192,7 @@ pub trait Delegate {
/// Called whenever a server response could not be decoded from json.
/// It's for informational purposes only, the caller will return with an error
/// accordingly.
///
///
/// # Arguments
///
/// * `json_encoded_value` - The json-encoded value which failed to decode.
@@ -202,7 +203,7 @@ pub trait Delegate {
}
/// Called whenever the http request returns with a non-success status code.
/// This can involve authentication issues, or anything else that very much
/// This can involve authentication issues, or anything else that very much
/// depends on the used API method.
/// The delegate should check the status, header and decoded json error to decide
/// whether to retry or not. In the latter case, the underlying call will fail.
@@ -213,7 +214,7 @@ pub trait Delegate {
Retry::Abort
}
/// Called prior to sending the main request of the given method. It can be used to time
/// Called prior to sending the main request of the given method. It can be used to time
/// the call or to print progress information.
/// It's also useful as you can be sure that a request will definitely be made.
fn pre_request(&mut self) { }
@@ -232,14 +233,14 @@ pub trait Delegate {
fn cancel_chunk_upload(&mut self, chunk: &ContentRange) -> bool {
let _ = chunk;
false
}
}
/// Called before the API request method returns, in every case. It can be used to clean up
/// internal state between calls to the API.
/// This call always has a matching call to `begin(...)`.
///
/// # Arguments
///
///
/// * `is_success` - a true value indicates the operation was successful. If false, you should
/// discard all values stored during `store_upload_url`.
fn finished(&mut self, is_success: bool) {
@@ -304,9 +305,9 @@ impl Display for Error {
Error::BadRequest(ref err) => {
try!(writeln!(f, "Bad Requst ({}): {}", err.error.code, err.error.message));
for err in err.error.errors.iter() {
try!(writeln!(f, " {}: {}, {}{}",
err.domain,
err.message,
try!(writeln!(f, " {}: {}, {}{}",
err.domain,
err.message,
err.reason,
match &err.location {
&Some(ref loc) => format!("@{}", loc),
@@ -317,13 +318,13 @@ impl Display for Error {
},
Error::MissingToken(ref err) =>
writeln!(f, "Token retrieval failed with error: {}", err),
Error::Cancelled =>
Error::Cancelled =>
writeln!(f, "Operation cancelled by delegate"),
Error::FieldClash(field) =>
writeln!(f, "The custom parameter '{}' is already provided natively by the CallBuilder.", field),
Error::JsonDecodeError(ref json_str, ref err)
Error::JsonDecodeError(ref json_str, ref err)
=> writeln!(f, "{}: {}", err, json_str),
Error::Failure(ref response) =>
Error::Failure(ref response) =>
writeln!(f, "Http status indicates failure: {:?}", response),
}
}
@@ -418,8 +419,8 @@ impl<'a> MultiPartReader<'a> {
impl<'a> Read for MultiPartReader<'a> {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
match (self.raw_parts.len(),
self.current_part.is_none(),
match (self.raw_parts.len(),
self.current_part.is_none(),
self.last_part_boundary.is_none()) {
(_, _, false) => {
let br = self.last_part_boundary.as_mut().unwrap().read(buf).unwrap_or(0);
@@ -432,7 +433,7 @@ impl<'a> Read for MultiPartReader<'a> {
(n, true, _) if n > 0 => {
let (headers, reader) = self.raw_parts.remove(0);
let mut c = Cursor::new(Vec::<u8>::new());
(write!(&mut c, "{}--{}{}{}{}", LINE_ENDING, BOUNDARY, LINE_ENDING,
(write!(&mut c, "{}--{}{}{}{}", LINE_ENDING, BOUNDARY, LINE_ENDING,
headers, LINE_ENDING)).unwrap();
c.seek(SeekFrom::Start(0)).unwrap();
self.current_part = Some((c, reader));
@@ -446,12 +447,12 @@ impl<'a> Read for MultiPartReader<'a> {
let b = c.read(buf).unwrap_or(0);
(b, reader.read(&mut buf[b..]))
};
match rr {
Ok(bytes_read) => {
if hb < buf.len() && bytes_read == 0 {
if self.is_last_part() {
// before clearing the last part, we will add the boundary that
// before clearing the last part, we will add the boundary that
// will be written last
self.last_part_boundary = Some(Cursor::new(
format!("{}--{}--", LINE_ENDING, BOUNDARY).into_bytes()))
@@ -498,7 +499,7 @@ impl<'a> Read for MultiPartReader<'a> {
/// The `X-Upload-Content-Type` header.
///
/// Generated via rustc --pretty expanded -Z unstable-options, and manually
/// Generated via rustc --pretty expanded -Z unstable-options, and manually
/// processed to be more readable.
#[derive(PartialEq, Debug, Clone)]
pub struct XUploadContentType(pub Mime);
@@ -657,7 +658,7 @@ impl<'a, A> ResumableUploadHelper<'a, A>
Some(hh) if r.status == StatusCode::PermanentRedirect => hh,
None|Some(_) => {
if let Retry::After(d) = self.delegate.http_failure(&r, None, None) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
return Err(Ok(r))
@@ -667,7 +668,7 @@ impl<'a, A> ResumableUploadHelper<'a, A>
}
Err(err) => {
if let Retry::After(d) = self.delegate.http_error(&err) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
return Err(Err(err))
@@ -725,10 +726,10 @@ impl<'a, A> ResumableUploadHelper<'a, A>
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let Retry::After(d) = self.delegate.http_failure(&res,
if let Retry::After(d) = self.delegate.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
}
@@ -736,7 +737,7 @@ impl<'a, A> ResumableUploadHelper<'a, A>
},
Err(err) => {
if let Retry::After(d) = self.delegate.http_error(&err) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
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 *DoubleClick Bid Manager* crate version *0.1.10+20150925*, where *20150925* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.10*.
//! This documentation was generated from *DoubleClick Bid Manager* crate version *0.1.11+20160120*, where *20160120* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.11*.
//!
//! Everything else about the *DoubleClick Bid Manager* *v1* API can be found at the
//! [official documentation site](https://developers.google.com/bid-manager/).
@@ -17,6 +17,8 @@
//! * [*createquery*](struct.QueryCreatequeryCall.html), [*deletequery*](struct.QueryDeletequeryCall.html), [*getquery*](struct.QueryGetqueryCall.html), [*listqueries*](struct.QueryListqueryCall.html) and [*runquery*](struct.QueryRunqueryCall.html)
//! * [reports](struct.Report.html)
//! * [*listreports*](struct.ReportListreportCall.html)
//! * rubicon
//! * [*notifyproposalchange*](struct.RubiconNotifyproposalchangeCall.html)
//!
//!
//!

View File

@@ -19,10 +19,11 @@ use std::collections::BTreeMap;
use serde_json as json;
use std::io;
use std::fs;
use std::thread::sleep_ms;
use std::thread::sleep;
use std::time::Duration;
pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, Hub, ReadSeek, Part,
ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder,
ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder,
Resource, ErrorResponse, remove_json_null_values};
@@ -104,7 +105,7 @@ impl<'a, C, A> DoubleClickBidManager<C, A>
DoubleClickBidManager {
client: RefCell::new(client),
auth: RefCell::new(authenticator),
_user_agent: "google-api-rust-client/0.1.10".to_string(),
_user_agent: "google-api-rust-client/0.1.11".to_string(),
}
}
@@ -117,9 +118,12 @@ impl<'a, C, A> DoubleClickBidManager<C, A>
pub fn reports(&'a self) -> ReportMethods<'a, C, A> {
ReportMethods { hub: &self }
}
pub fn rubicon(&'a self) -> RubiconMethods<'a, C, A> {
RubiconMethods { hub: &self }
}
/// Set the user-agent header field to use in all requests to the server.
/// It defaults to `google-api-rust-client/0.1.10`.
/// It defaults to `google-api-rust-client/0.1.11`.
///
/// Returns the previously set user-agent.
pub fn user_agent(&mut self, agent_name: String) -> String {
@@ -133,6 +137,32 @@ impl<'a, C, A> DoubleClickBidManager<C, A>
// ############
// SCHEMAS ###
// ##########
/// NotifyProposalChange request.
///
/// # Activities
///
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
///
/// * [notifyproposalchange rubicon](struct.RubiconNotifyproposalchangeCall.html) (request)
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct NotifyProposalChangeRequest {
/// Action taken by publisher. One of: Accept, Decline, Append
pub action: Option<String>,
/// Notes from publisher
pub notes: Option<Vec<Note>>,
/// URL to access proposal detail.
pub href: Option<String>,
/// Below are contents of notification from Rubicon. Proposal id.
pub id: Option<String>,
/// Deal token, available when proposal is accepted by publisher.
pub token: Option<String>,
}
impl RequestValue for NotifyProposalChangeRequest {}
/// Request to fetch stored line items.
///
/// # Activities
@@ -198,6 +228,27 @@ pub struct Parameters {
impl Part for Parameters {}
/// Publisher comment from Rubicon.
///
/// This type is not used in any activity, and only used as *part* of another schema.
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Note {
/// Publisher user name.
pub username: Option<String>,
/// Equals "publisher" for notification from Rubicon.
pub source: Option<String>,
/// Message from publisher.
pub message: Option<String>,
/// Note id.
pub id: Option<String>,
/// Time when the note was added, e.g. "2015-12-16T17:25:35.000-08:00".
pub timestamp: Option<String>,
}
impl Part for Note {}
/// Key used to identify a report.
///
/// This type is not used in any activity, and only used as *part* of another schema.
@@ -574,6 +625,63 @@ impl Part for UploadStatus {}
// MethodBuilders ###
// #################
/// A builder providing access to all methods supported on *rubicon* resources.
/// It is not used directly, but through the `DoubleClickBidManager` hub.
///
/// # Example
///
/// Instantiate a resource builder
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate yup_oauth2 as oauth2;
/// extern crate google_doubleclickbidmanager1 as doubleclickbidmanager1;
///
/// # #[test] fn egal() {
/// use std::default::Default;
/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
/// use doubleclickbidmanager1::DoubleClickBidManager;
///
/// let secret: ApplicationSecret = Default::default();
/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
/// hyper::Client::new(),
/// <MemoryStorage as Default>::default(), None);
/// let mut hub = DoubleClickBidManager::new(hyper::Client::new(), auth);
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
/// // like `notifyproposalchange(...)`
/// // to build up your call.
/// let rb = hub.rubicon();
/// # }
/// ```
pub struct RubiconMethods<'a, C, A>
where C: 'a, A: 'a {
hub: &'a DoubleClickBidManager<C, A>,
}
impl<'a, C, A> MethodsBuilder for RubiconMethods<'a, C, A> {}
impl<'a, C, A> RubiconMethods<'a, C, A> {
/// Create a builder to help you perform the following task:
///
/// Update proposal upon actions of Rubicon publisher.
///
/// # Arguments
///
/// * `request` - No description provided.
pub fn notifyproposalchange(&self, request: NotifyProposalChangeRequest) -> RubiconNotifyproposalchangeCall<'a, C, A> {
RubiconNotifyproposalchangeCall {
hub: self.hub,
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
}
}
}
/// A builder providing access to all methods supported on *lineitem* resources.
/// It is not used directly, but through the `DoubleClickBidManager` hub.
///
@@ -828,6 +936,206 @@ impl<'a, C, A> QueryMethods<'a, C, A> {
// CallBuilders ###
// #################
/// Update proposal upon actions of Rubicon publisher.
///
/// A builder for the *notifyproposalchange* method supported by a *rubicon* resource.
/// It is not used directly, but through a `RubiconMethods` instance.
///
/// # Example
///
/// Instantiate a resource method builder
///
/// ```test_harness,no_run
/// # extern crate hyper;
/// # extern crate yup_oauth2 as oauth2;
/// # extern crate google_doubleclickbidmanager1 as doubleclickbidmanager1;
/// use doubleclickbidmanager1::NotifyProposalChangeRequest;
/// # #[test] fn egal() {
/// # use std::default::Default;
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
/// # use doubleclickbidmanager1::DoubleClickBidManager;
///
/// # let secret: ApplicationSecret = Default::default();
/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
/// # hyper::Client::new(),
/// # <MemoryStorage as Default>::default(), None);
/// # let mut hub = DoubleClickBidManager::new(hyper::Client::new(), auth);
/// // As the method needs a request, you would usually fill it with the desired information
/// // into the respective structure. Some of the parts shown here might not be applicable !
/// // Values shown here are possibly random and not representative !
/// let mut req = NotifyProposalChangeRequest::default();
///
/// // You can configure optional parameters by calling the respective setters at will, and
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.rubicon().notifyproposalchange(req)
/// .doit();
/// # }
/// ```
pub struct RubiconNotifyproposalchangeCall<'a, C, A>
where C: 'a, A: 'a {
hub: &'a DoubleClickBidManager<C, A>,
_request: NotifyProposalChangeRequest,
_delegate: Option<&'a mut Delegate>,
_additional_params: HashMap<String, String>,
}
impl<'a, C, A> CallBuilder for RubiconNotifyproposalchangeCall<'a, C, A> {}
impl<'a, C, A> RubiconNotifyproposalchangeCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: oauth2::GetToken {
/// Perform the operation you have build so far.
pub fn doit(mut self) -> Result<hyper::client::Response> {
use std::io::{Read, Seek};
use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location};
let mut dd = DefaultDelegate;
let mut dlg: &mut Delegate = match self._delegate {
Some(d) => d,
None => &mut dd
};
dlg.begin(MethodInfo { id: "doubleclickbidmanager.rubicon.notifyproposalchange",
http_method: hyper::method::Method::Post });
let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len()));
for &field in [].iter() {
if self._additional_params.contains_key(field) {
dlg.finished(false);
return Err(Error::FieldClash(field));
}
}
for (name, value) in self._additional_params.iter() {
params.push((&name, value.clone()));
}
let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/rubicon/notifyproposalchange".to_string();
let mut key = self.hub.auth.borrow_mut().api_key();
if key.is_none() {
key = dlg.api_key();
}
match key {
Some(value) => params.push(("key", value)),
None => {
dlg.finished(false);
return Err(Error::MissingAPIKey)
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
let mut request_value_reader =
{
let mut value = json::value::to_value(&self._request);
remove_json_null_values(&mut value);
let mut dst = io::Cursor::new(Vec::with_capacity(128));
json::to_writer(&mut dst, &value).unwrap();
dst
};
let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
loop {
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
let mut req_result = {
let mut client = &mut *self.hub.client.borrow_mut();
let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url)
.header(UserAgent(self.hub._user_agent.clone()))
.header(ContentType(json_mime_type.clone()))
.header(ContentLength(request_size as u64))
.body(&mut request_value_reader);
dlg.pre_request();
req.send()
};
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
continue;
}
dlg.finished(false);
return Err(Error::HttpError(err))
}
Ok(mut res) => {
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep(d);
continue;
}
dlg.finished(false);
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = res;
dlg.finished(true);
return Ok(result_value)
}
}
}
}
///
/// Sets the *request* property to the given value.
///
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: NotifyProposalChangeRequest) -> RubiconNotifyproposalchangeCall<'a, C, A> {
self._request = new_value;
self
}
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
/// while executing the actual API request.
///
/// It should be used to handle progress information, and to implement a certain level of resilience.
///
/// Sets the *delegate* property to the given value.
pub fn delegate(mut self, new_value: &'a mut Delegate) -> RubiconNotifyproposalchangeCall<'a, C, A> {
self._delegate = Some(new_value);
self
}
/// Set any additional parameter of the query string used in the request.
/// It should be used to set parameters which are not yet available through their own
/// setters.
///
/// Please note that this method must not be used to set any of the known paramters
/// which have their own setter method. If done anyway, the request will fail.
///
/// # Additional Parameters
///
/// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
/// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
/// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
/// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
/// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits.
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *alt* (query-string) - Data format for the response.
pub fn param<T>(mut self, name: T, value: T) -> RubiconNotifyproposalchangeCall<'a, C, A>
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
}
/// Uploads line items in CSV format.
///
/// A builder for the *uploadlineitems* method supported by a *lineitem* resource.
@@ -887,7 +1195,7 @@ impl<'a, C, A> LineitemUploadlineitemCall<'a, C, A> where C: BorrowMut<hyper::Cl
Some(d) => d,
None => &mut dd
};
dlg.begin(MethodInfo { id: "doubleclickbidmanager.lineitems.uploadlineitems",
dlg.begin(MethodInfo { id: "doubleclickbidmanager.lineitems.uploadlineitems",
http_method: hyper::method::Method::Post });
let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len()));
for &field in ["alt"].iter() {
@@ -916,14 +1224,14 @@ impl<'a, C, A> LineitemUploadlineitemCall<'a, C, A> where C: BorrowMut<hyper::Cl
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
let mut request_value_reader =
let mut request_value_reader =
{
let mut value = json::value::to_value(&self._request);
remove_json_null_values(&mut value);
@@ -952,7 +1260,7 @@ impl<'a, C, A> LineitemUploadlineitemCall<'a, C, A> where C: BorrowMut<hyper::Cl
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -962,10 +1270,10 @@ impl<'a, C, A> LineitemUploadlineitemCall<'a, C, A> where C: BorrowMut<hyper::Cl
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -997,7 +1305,7 @@ impl<'a, C, A> LineitemUploadlineitemCall<'a, C, A> where C: BorrowMut<hyper::Cl
///
/// Sets the *request* property to the given value.
///
/// Even though the property as already been set when instantiating this call,
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: UploadLineItemsRequest) -> LineitemUploadlineitemCall<'a, C, A> {
self._request = new_value;
@@ -1015,12 +1323,12 @@ impl<'a, C, A> LineitemUploadlineitemCall<'a, C, A> where C: BorrowMut<hyper::Cl
}
/// Set any additional parameter of the query string used in the request.
/// It should be used to set parameters which are not yet available through their own
/// It should be used to set parameters which are not yet available through their own
/// setters.
///
/// Please note that this method must not be used to set any of the known paramters
/// which have their own setter method. If done anyway, the request will fail.
///
///
/// # Additional Parameters
///
/// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
@@ -1098,7 +1406,7 @@ impl<'a, C, A> LineitemDownloadlineitemCall<'a, C, A> where C: BorrowMut<hyper::
Some(d) => d,
None => &mut dd
};
dlg.begin(MethodInfo { id: "doubleclickbidmanager.lineitems.downloadlineitems",
dlg.begin(MethodInfo { id: "doubleclickbidmanager.lineitems.downloadlineitems",
http_method: hyper::method::Method::Post });
let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len()));
for &field in ["alt"].iter() {
@@ -1127,14 +1435,14 @@ impl<'a, C, A> LineitemDownloadlineitemCall<'a, C, A> where C: BorrowMut<hyper::
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
let mut request_value_reader =
let mut request_value_reader =
{
let mut value = json::value::to_value(&self._request);
remove_json_null_values(&mut value);
@@ -1163,7 +1471,7 @@ impl<'a, C, A> LineitemDownloadlineitemCall<'a, C, A> where C: BorrowMut<hyper::
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -1173,10 +1481,10 @@ impl<'a, C, A> LineitemDownloadlineitemCall<'a, C, A> where C: BorrowMut<hyper::
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -1208,7 +1516,7 @@ impl<'a, C, A> LineitemDownloadlineitemCall<'a, C, A> where C: BorrowMut<hyper::
///
/// Sets the *request* property to the given value.
///
/// Even though the property as already been set when instantiating this call,
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: DownloadLineItemsRequest) -> LineitemDownloadlineitemCall<'a, C, A> {
self._request = new_value;
@@ -1226,12 +1534,12 @@ impl<'a, C, A> LineitemDownloadlineitemCall<'a, C, A> where C: BorrowMut<hyper::
}
/// Set any additional parameter of the query string used in the request.
/// It should be used to set parameters which are not yet available through their own
/// It should be used to set parameters which are not yet available through their own
/// setters.
///
/// Please note that this method must not be used to set any of the known paramters
/// which have their own setter method. If done anyway, the request will fail.
///
///
/// # Additional Parameters
///
/// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
@@ -1303,7 +1611,7 @@ impl<'a, C, A> ReportListreportCall<'a, C, A> where C: BorrowMut<hyper::Client>,
Some(d) => d,
None => &mut dd
};
dlg.begin(MethodInfo { id: "doubleclickbidmanager.reports.listreports",
dlg.begin(MethodInfo { id: "doubleclickbidmanager.reports.listreports",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len()));
params.push(("queryId", self._query_id.to_string()));
@@ -1354,7 +1662,7 @@ impl<'a, C, A> ReportListreportCall<'a, C, A> where C: BorrowMut<hyper::Client>,
params.remove(index);
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
@@ -1375,7 +1683,7 @@ impl<'a, C, A> ReportListreportCall<'a, C, A> where C: BorrowMut<hyper::Client>,
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -1385,10 +1693,10 @@ impl<'a, C, A> ReportListreportCall<'a, C, A> where C: BorrowMut<hyper::Client>,
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -1421,7 +1729,7 @@ impl<'a, C, A> ReportListreportCall<'a, C, A> where C: BorrowMut<hyper::Client>,
///
/// Sets the *query id* path property to the given value.
///
/// Even though the property as already been set when instantiating this call,
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn query_id(mut self, new_value: &str) -> ReportListreportCall<'a, C, A> {
self._query_id = new_value.to_string();
@@ -1439,12 +1747,12 @@ impl<'a, C, A> ReportListreportCall<'a, C, A> where C: BorrowMut<hyper::Client>,
}
/// Set any additional parameter of the query string used in the request.
/// It should be used to set parameters which are not yet available through their own
/// It should be used to set parameters which are not yet available through their own
/// setters.
///
/// Please note that this method must not be used to set any of the known paramters
/// which have their own setter method. If done anyway, the request will fail.
///
///
/// # Additional Parameters
///
/// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
@@ -1515,7 +1823,7 @@ impl<'a, C, A> QueryListqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A
Some(d) => d,
None => &mut dd
};
dlg.begin(MethodInfo { id: "doubleclickbidmanager.queries.listqueries",
dlg.begin(MethodInfo { id: "doubleclickbidmanager.queries.listqueries",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len()));
for &field in ["alt"].iter() {
@@ -1544,7 +1852,7 @@ impl<'a, C, A> QueryListqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
@@ -1565,7 +1873,7 @@ impl<'a, C, A> QueryListqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -1575,10 +1883,10 @@ impl<'a, C, A> QueryListqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -1619,12 +1927,12 @@ impl<'a, C, A> QueryListqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A
}
/// Set any additional parameter of the query string used in the request.
/// It should be used to set parameters which are not yet available through their own
/// It should be used to set parameters which are not yet available through their own
/// setters.
///
/// Please note that this method must not be used to set any of the known paramters
/// which have their own setter method. If done anyway, the request will fail.
///
///
/// # Additional Parameters
///
/// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
@@ -1696,7 +2004,7 @@ impl<'a, C, A> QueryGetqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
Some(d) => d,
None => &mut dd
};
dlg.begin(MethodInfo { id: "doubleclickbidmanager.queries.getquery",
dlg.begin(MethodInfo { id: "doubleclickbidmanager.queries.getquery",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len()));
params.push(("queryId", self._query_id.to_string()));
@@ -1747,7 +2055,7 @@ impl<'a, C, A> QueryGetqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
params.remove(index);
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
@@ -1768,7 +2076,7 @@ impl<'a, C, A> QueryGetqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -1778,10 +2086,10 @@ impl<'a, C, A> QueryGetqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -1814,7 +2122,7 @@ impl<'a, C, A> QueryGetqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
///
/// Sets the *query id* path property to the given value.
///
/// Even though the property as already been set when instantiating this call,
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn query_id(mut self, new_value: &str) -> QueryGetqueryCall<'a, C, A> {
self._query_id = new_value.to_string();
@@ -1832,12 +2140,12 @@ impl<'a, C, A> QueryGetqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
}
/// Set any additional parameter of the query string used in the request.
/// It should be used to set parameters which are not yet available through their own
/// It should be used to set parameters which are not yet available through their own
/// setters.
///
/// Please note that this method must not be used to set any of the known paramters
/// which have their own setter method. If done anyway, the request will fail.
///
///
/// # Additional Parameters
///
/// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
@@ -1915,7 +2223,7 @@ impl<'a, C, A> QueryCreatequeryCall<'a, C, A> where C: BorrowMut<hyper::Client>,
Some(d) => d,
None => &mut dd
};
dlg.begin(MethodInfo { id: "doubleclickbidmanager.queries.createquery",
dlg.begin(MethodInfo { id: "doubleclickbidmanager.queries.createquery",
http_method: hyper::method::Method::Post });
let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len()));
for &field in ["alt"].iter() {
@@ -1944,14 +2252,14 @@ impl<'a, C, A> QueryCreatequeryCall<'a, C, A> where C: BorrowMut<hyper::Client>,
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
let mut request_value_reader =
let mut request_value_reader =
{
let mut value = json::value::to_value(&self._request);
remove_json_null_values(&mut value);
@@ -1980,7 +2288,7 @@ impl<'a, C, A> QueryCreatequeryCall<'a, C, A> where C: BorrowMut<hyper::Client>,
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -1990,10 +2298,10 @@ impl<'a, C, A> QueryCreatequeryCall<'a, C, A> where C: BorrowMut<hyper::Client>,
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -2025,7 +2333,7 @@ impl<'a, C, A> QueryCreatequeryCall<'a, C, A> where C: BorrowMut<hyper::Client>,
///
/// Sets the *request* property to the given value.
///
/// Even though the property as already been set when instantiating this call,
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: Query) -> QueryCreatequeryCall<'a, C, A> {
self._request = new_value;
@@ -2043,12 +2351,12 @@ impl<'a, C, A> QueryCreatequeryCall<'a, C, A> where C: BorrowMut<hyper::Client>,
}
/// Set any additional parameter of the query string used in the request.
/// It should be used to set parameters which are not yet available through their own
/// It should be used to set parameters which are not yet available through their own
/// setters.
///
/// Please note that this method must not be used to set any of the known paramters
/// which have their own setter method. If done anyway, the request will fail.
///
///
/// # Additional Parameters
///
/// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
@@ -2120,7 +2428,7 @@ impl<'a, C, A> QueryDeletequeryCall<'a, C, A> where C: BorrowMut<hyper::Client>,
Some(d) => d,
None => &mut dd
};
dlg.begin(MethodInfo { id: "doubleclickbidmanager.queries.deletequery",
dlg.begin(MethodInfo { id: "doubleclickbidmanager.queries.deletequery",
http_method: hyper::method::Method::Delete });
let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len()));
params.push(("queryId", self._query_id.to_string()));
@@ -2170,7 +2478,7 @@ impl<'a, C, A> QueryDeletequeryCall<'a, C, A> where C: BorrowMut<hyper::Client>,
params.remove(index);
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
@@ -2191,7 +2499,7 @@ impl<'a, C, A> QueryDeletequeryCall<'a, C, A> where C: BorrowMut<hyper::Client>,
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -2201,10 +2509,10 @@ impl<'a, C, A> QueryDeletequeryCall<'a, C, A> where C: BorrowMut<hyper::Client>,
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -2227,7 +2535,7 @@ impl<'a, C, A> QueryDeletequeryCall<'a, C, A> where C: BorrowMut<hyper::Client>,
///
/// Sets the *query id* path property to the given value.
///
/// Even though the property as already been set when instantiating this call,
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn query_id(mut self, new_value: &str) -> QueryDeletequeryCall<'a, C, A> {
self._query_id = new_value.to_string();
@@ -2245,12 +2553,12 @@ impl<'a, C, A> QueryDeletequeryCall<'a, C, A> where C: BorrowMut<hyper::Client>,
}
/// Set any additional parameter of the query string used in the request.
/// It should be used to set parameters which are not yet available through their own
/// It should be used to set parameters which are not yet available through their own
/// setters.
///
/// Please note that this method must not be used to set any of the known paramters
/// which have their own setter method. If done anyway, the request will fail.
///
///
/// # Additional Parameters
///
/// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
@@ -2329,7 +2637,7 @@ impl<'a, C, A> QueryRunqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
Some(d) => d,
None => &mut dd
};
dlg.begin(MethodInfo { id: "doubleclickbidmanager.queries.runquery",
dlg.begin(MethodInfo { id: "doubleclickbidmanager.queries.runquery",
http_method: hyper::method::Method::Post });
let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len()));
params.push(("queryId", self._query_id.to_string()));
@@ -2379,14 +2687,14 @@ impl<'a, C, A> QueryRunqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
params.remove(index);
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
let mut request_value_reader =
let mut request_value_reader =
{
let mut value = json::value::to_value(&self._request);
remove_json_null_values(&mut value);
@@ -2415,7 +2723,7 @@ impl<'a, C, A> QueryRunqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -2425,10 +2733,10 @@ impl<'a, C, A> QueryRunqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
sleep(d);
continue;
}
dlg.finished(false);
@@ -2450,7 +2758,7 @@ impl<'a, C, A> QueryRunqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
///
/// Sets the *request* property to the given value.
///
/// Even though the property as already been set when instantiating this call,
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: RunQueryRequest) -> QueryRunqueryCall<'a, C, A> {
self._request = new_value;
@@ -2460,7 +2768,7 @@ impl<'a, C, A> QueryRunqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
///
/// Sets the *query id* path property to the given value.
///
/// Even though the property as already been set when instantiating this call,
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn query_id(mut self, new_value: &str) -> QueryRunqueryCall<'a, C, A> {
self._query_id = new_value.to_string();
@@ -2478,12 +2786,12 @@ impl<'a, C, A> QueryRunqueryCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
}
/// Set any additional parameter of the query string used in the request.
/// It should be used to set parameters which are not yet available through their own
/// It should be used to set parameters which are not yet available through their own
/// setters.
///
/// Please note that this method must not be used to set any of the known paramters
/// which have their own setter method. If done anyway, the request will fail.
///
///
/// # Additional Parameters
///
/// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.