fix(all): update all code to latest version

* add new APIs
* remove old ones
* add latest json files
This commit is contained in:
Sebastian Thiel
2015-04-24 20:07:12 +02:00
parent 845a568b25
commit f8689be451
650 changed files with 80776 additions and 88805 deletions

View File

@@ -127,9 +127,12 @@ pub trait Delegate {
}
/// Called whenever the Authenticator didn't yield a token. The delegate
/// may attempt to provide one, or just take is a general information about the
/// pending impending failure
fn token(&mut self) -> Option<oauth2::Token> {
/// may attempt to provide one, or just take it as a general information about the
/// impending failure.
/// The given Error provides information about why the token couldn't be acquired in the
/// first place
fn token(&mut self, err: &error::Error) -> Option<oauth2::Token> {
let _ = err;
None
}
@@ -232,7 +235,7 @@ pub enum Error {
MissingAPIKey,
/// We required a Token, but didn't get one from the Authenticator
MissingToken,
MissingToken(Box<error::Error>),
/// The delgate instructed to cancel the operation
Cancelled,
@@ -260,8 +263,8 @@ impl Display for Error {
writeln!(f, "The application's API key was not found in the configuration").ok();
writeln!(f, "It is used as there are no Scopes defined for this method.")
},
Error::MissingToken =>
writeln!(f, "Didn't obtain authentication token from authenticator"),
Error::MissingToken(ref err) =>
writeln!(f, "Token retrieval failed with error: {}", err),
Error::Cancelled =>
writeln!(f, "Operation cancelled by delegate"),
Error::FieldClash(field) =>

View File

@@ -320,7 +320,7 @@ impl<'a, C, A> Translate<C, A>
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct DetectionsListResponse {
/// A detections contains detection results of several text
pub detections: Vec<DetectionsResource>,
pub detections: Option<Vec<DetectionsResource>>,
}
impl ResponseResult for DetectionsListResponse {}
@@ -338,7 +338,7 @@ impl ResponseResult for DetectionsListResponse {}
#[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: Vec<LanguagesResource>,
pub languages: Option<Vec<LanguagesResource>>,
}
impl ResponseResult for LanguagesListResponse {}
@@ -354,11 +354,11 @@ impl ResponseResult for LanguagesListResponse {}
pub struct DetectionsResource {
/// A boolean to indicate is the language detection result reliable.
#[serde(rename="isReliable")]
pub is_reliable: bool,
pub is_reliable: Option<bool>,
/// The confidence of the detection resul of this language.
pub confidence: f32,
pub confidence: Option<f32>,
/// The language we detect
pub language: String,
pub language: Option<String>,
}
impl Part for DetectionsResource {}
@@ -372,10 +372,10 @@ impl Part for DetectionsResource {}
pub struct TranslationsResource {
/// Detected source language if source parameter is unspecified.
#[serde(rename="detectedSourceLanguage")]
pub detected_source_language: String,
pub detected_source_language: Option<String>,
/// The translation.
#[serde(rename="translatedText")]
pub translated_text: String,
pub translated_text: Option<String>,
}
impl Part for TranslationsResource {}
@@ -388,9 +388,9 @@ impl Part for TranslationsResource {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct LanguagesResource {
/// The localized name of the language if target parameter is given.
pub name: String,
pub name: Option<String>,
/// The language code.
pub language: String,
pub language: Option<String>,
}
impl Part for LanguagesResource {}
@@ -404,11 +404,11 @@ impl Part for LanguagesResource {}
pub struct DetectionsResourceNested {
/// A boolean to indicate is the language detection result reliable.
#[serde(rename="isReliable")]
pub is_reliable: bool,
pub is_reliable: Option<bool>,
/// The confidence of the detection resul of this language.
pub confidence: f32,
pub confidence: Option<f32>,
/// The language we detect
pub language: String,
pub language: Option<String>,
}
impl NestedType for DetectionsResourceNested {}
@@ -427,7 +427,7 @@ impl Part for DetectionsResourceNested {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct TranslationsListResponse {
/// Translations contains list of translation results of given text
pub translations: Vec<TranslationsResource>,
pub translations: Option<Vec<TranslationsResource>>,
}
impl ResponseResult for TranslationsListResponse {}