chore(regen-apis

This commit is contained in:
Sebastian Thiel
2017-05-22 21:02:08 +02:00
parent dd4bfe3de0
commit 390ce7f9d8
106 changed files with 5891 additions and 3983 deletions

View File

@@ -174,7 +174,7 @@
// 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
// 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)]
@@ -202,6 +202,7 @@ use std::collections::BTreeMap;
use serde_json as json;
use std::io;
use std::fs;
use std::mem;
use std::thread::sleep;
use std::time::Duration;
@@ -277,6 +278,8 @@ pub struct Translate<C, A> {
client: RefCell<C>,
auth: RefCell<A>,
_user_agent: String,
_base_url: String,
_root_url: String,
}
impl<'a, C, A> Hub for Translate<C, A> {}
@@ -289,6 +292,8 @@ impl<'a, C, A> Translate<C, A>
client: RefCell::new(client),
auth: RefCell::new(authenticator),
_user_agent: "google-api-rust-client/1.0.4".to_string(),
_base_url: "https://www.googleapis.com/language/translate/".to_string(),
_root_url: "https://www.googleapis.com/".to_string(),
}
}
@@ -307,9 +312,23 @@ impl<'a, C, A> Translate<C, A>
///
/// Returns the previously set user-agent.
pub fn user_agent(&mut self, agent_name: String) -> String {
let prev = self._user_agent.clone();
self._user_agent = agent_name;
prev
mem::replace(&mut self._user_agent, agent_name)
}
/// Set the base url to use in all requests to the server.
/// It defaults to `https://www.googleapis.com/language/translate/`.
///
/// Returns the previously set base url.
pub fn base_url(&mut self, new_base_url: String) -> String {
mem::replace(&mut self._base_url, new_base_url)
}
/// Set the root url to use in all requests to the server.
/// It defaults to `https://www.googleapis.com/`.
///
/// Returns the previously set root url.
pub fn root_url(&mut self, new_root_url: String) -> String {
mem::replace(&mut self._root_url, new_root_url)
}
}
@@ -697,7 +716,7 @@ impl<'a, C, A> LanguageListCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
params.push(("alt", "json".to_string()));
let mut url = "https://www.googleapis.com/language/translate/v2/languages".to_string();
let mut url = self.hub._base_url.clone() + "v2/languages";
let mut key = self.hub.auth.borrow_mut().api_key();
if key.is_none() {
@@ -890,7 +909,7 @@ impl<'a, C, A> DetectionListCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
params.push(("alt", "json".to_string()));
let mut url = "https://www.googleapis.com/language/translate/v2/detect".to_string();
let mut url = self.hub._base_url.clone() + "v2/detect";
let mut key = self.hub.auth.borrow_mut().api_key();
if key.is_none() {
@@ -1106,7 +1125,7 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut<hyper::Client>,
params.push(("alt", "json".to_string()));
let mut url = "https://www.googleapis.com/language/translate/v2".to_string();
let mut url = self.hub._base_url.clone() + "v2";
let mut key = self.hub.auth.borrow_mut().api_key();
if key.is_none() {
@@ -1262,4 +1281,3 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut<hyper::Client>,
}