Update to latest versions of API declarations

This commit is contained in:
Sebastian Thiel
2018-10-13 13:49:14 +02:00
parent 5a67475b54
commit 255c7f5ad5
1508 changed files with 819225 additions and 838421 deletions

View File

@@ -69,6 +69,14 @@
//! ```toml
//! [dependencies]
//! google-translate2 = "*"
//! # This project intentionally uses an old version of Hyper. See
//! # https://github.com/Byron/google-apis-rs/issues/173 for more
//! # information.
//! hyper = "^0.10"
//! hyper-rustls = "^0.6"
//! serde = "^1.0"
//! serde_json = "^1.0"
//! yup-oauth2 = "^1.0"
//! ```
//!
//! ## A complete example
@@ -396,22 +404,23 @@ pub struct DetectionsListResponse {
impl ResponseResult for DetectionsListResponse {}
/// There is no detailed description.
/// The main language translation response message.
///
/// # 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*).
///
/// * [list languages](struct.LanguageListCall.html) (response)
/// * [translate translations](struct.TranslationTranslateCall.html) (response)
/// * [list translations](struct.TranslationListCall.html) (response)
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct LanguagesListResponse {
/// List of source/target languages supported by the translation API. If target parameter is unspecified, the list is sorted by the ASCII code point order of the language code. If target parameter is specified, the list is sorted by the collation order of the language name in the target language.
pub languages: Option<Vec<LanguagesResource>>,
pub struct TranslationsListResponse {
/// Translations contains list of translation results of given text
pub translations: Option<Vec<TranslationsResource>>,
}
impl ResponseResult for LanguagesListResponse {}
impl ResponseResult for TranslationsListResponse {}
/// An array of languages which we detect for the given text The most likely language list first.
@@ -528,41 +537,40 @@ impl RequestValue for TranslateTextRequest {}
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct TranslationsResource {
/// Text translated into the target language.
#[serde(rename="translatedText")]
pub translated_text: Option<String>,
/// The `model` type used for this translation. Valid values are
/// listed in public documentation. Can be different from requested `model`.
/// Present only if specific model type was explicitly requested.
pub model: Option<String>,
/// The source language of the initial request, detected automatically, if
/// no source language was passed within the initial request. If the
/// source language was passed, auto-detection of the language will not
/// occur and this field will be empty.
#[serde(rename="detectedSourceLanguage")]
pub detected_source_language: Option<String>,
/// The `model` type used for this translation. Valid values are
/// listed in public documentation. Can be different from requested `model`.
/// Present only if specific model type was explicitly requested.
pub model: Option<String>,
/// Text translated into the target language.
#[serde(rename="translatedText")]
pub translated_text: Option<String>,
}
impl Part for TranslationsResource {}
/// The main language translation response message.
/// There is no detailed description.
///
/// # 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*).
///
/// * [translate translations](struct.TranslationTranslateCall.html) (response)
/// * [list translations](struct.TranslationListCall.html) (response)
/// * [list languages](struct.LanguageListCall.html) (response)
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct TranslationsListResponse {
/// Translations contains list of translation results of given text
pub translations: Option<Vec<TranslationsResource>>,
pub struct LanguagesListResponse {
/// List of source/target languages supported by the translation API. If target parameter is unspecified, the list is sorted by the ASCII code point order of the language code. If target parameter is specified, the list is sorted by the collation order of the language name in the target language.
pub languages: Option<Vec<LanguagesResource>>,
}
impl ResponseResult for TranslationsListResponse {}
impl ResponseResult for LanguagesListResponse {}
@@ -853,7 +861,7 @@ impl<'a, C, A> LanguageListCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
};
dlg.begin(MethodInfo { id: "language.languages.list",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len()));
let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len());
if let Some(value) = self._target {
params.push(("target", value.to_string()));
}
@@ -989,17 +997,17 @@ impl<'a, C, A> LanguageListCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
///
/// # Additional Parameters
///
/// * *bearer_token* (query-string) - OAuth bearer token.
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
/// * *pp* (query-boolean) - Pretty-print response.
/// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
/// * *bearer_token* (query-string) - OAuth bearer token.
/// * *access_token* (query-string) - OAuth access token.
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *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.
/// * *callback* (query-string) - JSONP
/// * *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.
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
/// * *alt* (query-string) - Data format for response.
/// * *$.xgafv* (query-string) - V1 error format.
pub fn param<T>(mut self, name: T, value: T) -> LanguageListCall<'a, C, A>
@@ -1097,7 +1105,7 @@ impl<'a, C, A> DetectionDetectCall<'a, C, A> where C: BorrowMut<hyper::Client>,
};
dlg.begin(MethodInfo { id: "language.detections.detect",
http_method: hyper::method::Method::Post });
let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len()));
let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len());
for &field in ["alt"].iter() {
if self._additional_params.contains_key(field) {
dlg.finished(false);
@@ -1236,17 +1244,17 @@ impl<'a, C, A> DetectionDetectCall<'a, C, A> where C: BorrowMut<hyper::Client>,
///
/// # Additional Parameters
///
/// * *bearer_token* (query-string) - OAuth bearer token.
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
/// * *pp* (query-boolean) - Pretty-print response.
/// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
/// * *bearer_token* (query-string) - OAuth bearer token.
/// * *access_token* (query-string) - OAuth access token.
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *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.
/// * *callback* (query-string) - JSONP
/// * *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.
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
/// * *alt* (query-string) - Data format for response.
/// * *$.xgafv* (query-string) - V1 error format.
pub fn param<T>(mut self, name: T, value: T) -> DetectionDetectCall<'a, C, A>
@@ -1338,7 +1346,7 @@ impl<'a, C, A> DetectionListCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
};
dlg.begin(MethodInfo { id: "language.detections.list",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len()));
let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len());
if self._q.len() > 0 {
for f in self._q.iter() {
params.push(("q", f.to_string()));
@@ -1470,17 +1478,17 @@ impl<'a, C, A> DetectionListCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
///
/// # Additional Parameters
///
/// * *bearer_token* (query-string) - OAuth bearer token.
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
/// * *pp* (query-boolean) - Pretty-print response.
/// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
/// * *bearer_token* (query-string) - OAuth bearer token.
/// * *access_token* (query-string) - OAuth access token.
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *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.
/// * *callback* (query-string) - JSONP
/// * *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.
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
/// * *alt* (query-string) - Data format for response.
/// * *$.xgafv* (query-string) - V1 error format.
pub fn param<T>(mut self, name: T, value: T) -> DetectionListCall<'a, C, A>
@@ -1578,7 +1586,7 @@ impl<'a, C, A> TranslationTranslateCall<'a, C, A> where C: BorrowMut<hyper::Clie
};
dlg.begin(MethodInfo { id: "language.translations.translate",
http_method: hyper::method::Method::Post });
let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len()));
let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len());
for &field in ["alt"].iter() {
if self._additional_params.contains_key(field) {
dlg.finished(false);
@@ -1717,17 +1725,17 @@ impl<'a, C, A> TranslationTranslateCall<'a, C, A> where C: BorrowMut<hyper::Clie
///
/// # Additional Parameters
///
/// * *bearer_token* (query-string) - OAuth bearer token.
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
/// * *pp* (query-boolean) - Pretty-print response.
/// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
/// * *bearer_token* (query-string) - OAuth bearer token.
/// * *access_token* (query-string) - OAuth access token.
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *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.
/// * *callback* (query-string) - JSONP
/// * *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.
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
/// * *alt* (query-string) - Data format for response.
/// * *$.xgafv* (query-string) - V1 error format.
pub fn param<T>(mut self, name: T, value: T) -> TranslationTranslateCall<'a, C, A>
@@ -1828,7 +1836,7 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut<hyper::Client>,
};
dlg.begin(MethodInfo { id: "language.translations.list",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len()));
let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len());
if self._q.len() > 0 {
for f in self._q.iter() {
params.push(("q", f.to_string()));
@@ -2020,17 +2028,17 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut<hyper::Client>,
///
/// # Additional Parameters
///
/// * *bearer_token* (query-string) - OAuth bearer token.
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
/// * *pp* (query-boolean) - Pretty-print response.
/// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
/// * *bearer_token* (query-string) - OAuth bearer token.
/// * *access_token* (query-string) - OAuth access token.
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *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.
/// * *callback* (query-string) - JSONP
/// * *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.
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
/// * *alt* (query-string) - Data format for response.
/// * *$.xgafv* (query-string) - V1 error format.
pub fn param<T>(mut self, name: T, value: T) -> TranslationListCall<'a, C, A>