Regen all APIs from new JSON

This commit is contained in:
Guy Taylor
2019-04-04 18:16:26 +01:00
committed by Sebastian Thiel
parent 86a884c48b
commit 2ad9f3781d
1212 changed files with 440610 additions and 142417 deletions

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 *Cloud Natural Language* crate version *1.0.8+20180930*, where *20180930* is the exact revision of the *language:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.8*.
//! This documentation was generated from *Cloud Natural Language* crate version *1.0.8+20190327*, where *20190327* is the exact revision of the *language:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.8*.
//!
//! Everything else about the *Cloud Natural Language* *v1_beta1* API can be found at the
//! [official documentation site](https://cloud.google.com/natural-language/).
@@ -377,29 +377,39 @@ impl<'a, C, A> CloudNaturalLanguage<C, A>
// ############
// SCHEMAS ###
// ##########
/// The sentiment analysis response message.
/// Represents part of speech information for a token.
///
/// # 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*).
///
/// * [analyze sentiment documents](struct.DocumentAnalyzeSentimentCall.html) (response)
/// This type is not used in any activity, and only used as *part* of another schema.
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct AnalyzeSentimentResponse {
/// The overall sentiment of the input document.
#[serde(rename="documentSentiment")]
pub document_sentiment: Option<Sentiment>,
/// The language of the text, which will be the same as the language specified
/// in the request or, if not specified, the automatically-detected language.
/// See Document.language field for more details.
pub language: Option<String>,
/// The sentiment for all the sentences in the document.
pub sentences: Option<Vec<Sentence>>,
pub struct PartOfSpeech {
/// The grammatical case.
pub case: Option<String>,
/// The grammatical mood.
pub mood: Option<String>,
/// The grammatical form.
pub form: Option<String>,
/// The grammatical gender.
pub gender: Option<String>,
/// The grammatical aspect.
pub aspect: Option<String>,
/// The grammatical number.
pub number: Option<String>,
/// The grammatical person.
pub person: Option<String>,
/// The part of speech tag.
pub tag: Option<String>,
/// The grammatical tense.
pub tense: Option<String>,
/// The grammatical reciprocity.
pub reciprocity: Option<String>,
/// The grammatical properness.
pub proper: Option<String>,
/// The grammatical voice.
pub voice: Option<String>,
}
impl ResponseResult for AnalyzeSentimentResponse {}
impl Part for PartOfSpeech {}
/// Represents the feeling associated with the entire text or entities in
@@ -413,13 +423,13 @@ pub struct Sentiment {
/// favor of score. Please refer to our documentation at
/// https://cloud.google.com/natural-language/docs for more information.
pub polarity: Option<f32>,
/// Sentiment score between -1.0 (negative sentiment) and 1.0
/// (positive sentiment).
pub score: Option<f32>,
/// A non-negative number in the [0, +inf) range, which represents
/// the absolute magnitude of sentiment regardless of score (positive or
/// negative).
pub magnitude: Option<f32>,
/// Sentiment score between -1.0 (negative sentiment) and 1.0
/// (positive sentiment).
pub score: Option<f32>,
}
impl Part for Sentiment {}
@@ -466,16 +476,16 @@ impl ResponseResult for AnnotateTextResponse {}
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Token {
/// The token text.
pub text: Option<TextSpan>,
/// [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
pub lemma: Option<String>,
/// Dependency tree parse for this token.
#[serde(rename="dependencyEdge")]
pub dependency_edge: Option<DependencyEdge>,
/// Parts of speech tag for this token.
#[serde(rename="partOfSpeech")]
pub part_of_speech: Option<PartOfSpeech>,
/// [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
pub lemma: Option<String>,
/// The token text.
pub text: Option<TextSpan>,
}
impl Part for Token {}
@@ -560,11 +570,11 @@ impl ResponseResult for AnalyzeSyntaxResponse {}
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct AnnotateTextRequest {
/// Input document.
pub document: Option<Document>,
/// The encoding type used by the API to calculate offsets.
#[serde(rename="encodingType")]
pub encoding_type: Option<String>,
/// Input document.
pub document: Option<Document>,
/// The enabled features.
pub features: Option<Features>,
}
@@ -579,15 +589,15 @@ impl RequestValue for AnnotateTextRequest {}
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Features {
/// Extract syntax information.
#[serde(rename="extractSyntax")]
pub extract_syntax: Option<bool>,
/// Extract entities.
#[serde(rename="extractEntities")]
pub extract_entities: Option<bool>,
/// Extract document-level sentiment.
#[serde(rename="extractDocumentSentiment")]
pub extract_document_sentiment: Option<bool>,
/// Extract entities.
#[serde(rename="extractEntities")]
pub extract_entities: Option<bool>,
/// Extract syntax information.
#[serde(rename="extractSyntax")]
pub extract_syntax: Option<bool>,
}
impl Part for Features {}
@@ -663,11 +673,6 @@ pub struct Entity {
/// Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if
/// available. The associated keys are "wikipedia_url" and "mid", respectively.
pub metadata: Option<HashMap<String, String>>,
/// The entity type.
#[serde(rename="type")]
pub type_: Option<String>,
/// The representative name for the entity.
pub name: Option<String>,
/// The salience score associated with the entity in the [0, 1.0] range.
///
/// The salience score for an entity provides information about the
@@ -675,11 +680,84 @@ pub struct Entity {
/// Scores closer to 0 are less salient, while scores closer to 1.0 are highly
/// salient.
pub salience: Option<f32>,
/// The representative name for the entity.
pub name: Option<String>,
/// The entity type.
#[serde(rename="type")]
pub type_: Option<String>,
}
impl Part for Entity {}
/// The syntax analysis request 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*).
///
/// * [analyze syntax documents](struct.DocumentAnalyzeSyntaxCall.html) (request)
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct AnalyzeSyntaxRequest {
/// Input document.
pub document: Option<Document>,
/// The encoding type used by the API to calculate offsets.
#[serde(rename="encodingType")]
pub encoding_type: Option<String>,
}
impl RequestValue for AnalyzeSyntaxRequest {}
/// The sentiment analysis request 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*).
///
/// * [analyze sentiment documents](struct.DocumentAnalyzeSentimentCall.html) (request)
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct AnalyzeSentimentRequest {
/// Input document.
pub document: Option<Document>,
/// The encoding type used by the API to calculate sentence offsets for the
/// sentence sentiment.
#[serde(rename="encodingType")]
pub encoding_type: Option<String>,
}
impl RequestValue for AnalyzeSentimentRequest {}
/// The sentiment analysis 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*).
///
/// * [analyze sentiment documents](struct.DocumentAnalyzeSentimentCall.html) (response)
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct AnalyzeSentimentResponse {
/// The overall sentiment of the input document.
#[serde(rename="documentSentiment")]
pub document_sentiment: Option<Sentiment>,
/// The language of the text, which will be the same as the language specified
/// in the request or, if not specified, the automatically-detected language.
/// See Document.language field for more details.
pub language: Option<String>,
/// The sentiment for all the sentences in the document.
pub sentences: Option<Vec<Sentence>>,
}
impl ResponseResult for AnalyzeSentimentResponse {}
/// Represents a mention for an entity in the text. Currently, proper noun
/// mentions are supported.
///
@@ -697,84 +775,6 @@ pub struct EntityMention {
impl Part for EntityMention {}
/// The sentiment analysis request 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*).
///
/// * [analyze sentiment documents](struct.DocumentAnalyzeSentimentCall.html) (request)
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct AnalyzeSentimentRequest {
/// The encoding type used by the API to calculate sentence offsets for the
/// sentence sentiment.
#[serde(rename="encodingType")]
pub encoding_type: Option<String>,
/// Input document.
pub document: Option<Document>,
}
impl RequestValue for AnalyzeSentimentRequest {}
/// Represents part of speech information for a token.
///
/// This type is not used in any activity, and only used as *part* of another schema.
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PartOfSpeech {
/// The grammatical case.
pub case: Option<String>,
/// The grammatical mood.
pub mood: Option<String>,
/// The grammatical form.
pub form: Option<String>,
/// The grammatical gender.
pub gender: Option<String>,
/// The grammatical aspect.
pub aspect: Option<String>,
/// The grammatical number.
pub number: Option<String>,
/// The grammatical person.
pub person: Option<String>,
/// The part of speech tag.
pub tag: Option<String>,
/// The grammatical tense.
pub tense: Option<String>,
/// The grammatical reciprocity.
pub reciprocity: Option<String>,
/// The grammatical properness.
pub proper: Option<String>,
/// The grammatical voice.
pub voice: Option<String>,
}
impl Part for PartOfSpeech {}
/// The syntax analysis request 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*).
///
/// * [analyze syntax documents](struct.DocumentAnalyzeSyntaxCall.html) (request)
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct AnalyzeSyntaxRequest {
/// The encoding type used by the API to calculate offsets.
#[serde(rename="encodingType")]
pub encoding_type: Option<String>,
/// Input document.
pub document: Option<Document>,
}
impl RequestValue for AnalyzeSyntaxRequest {}
/// The entity analysis response message.
///
/// # Activities
@@ -808,11 +808,11 @@ impl ResponseResult for AnalyzeEntitiesResponse {}
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct AnalyzeEntitiesRequest {
/// Input document.
pub document: Option<Document>,
/// The encoding type used by the API to calculate offsets.
#[serde(rename="encodingType")]
pub encoding_type: Option<String>,
/// Input document.
pub document: Option<Document>,
}
impl RequestValue for AnalyzeEntitiesRequest {}
@@ -1028,10 +1028,7 @@ impl<'a, C, A> DocumentAnalyzeSyntaxCall<'a, C, A> where C: BorrowMut<hyper::Cli
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
let url = hyper::Url::parse_with_params(&url, params).unwrap();
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
let mut request_value_reader =
@@ -1063,7 +1060,7 @@ impl<'a, C, A> DocumentAnalyzeSyntaxCall<'a, C, A> where C: BorrowMut<hyper::Cli
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)
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -1143,7 +1140,7 @@ impl<'a, C, A> DocumentAnalyzeSyntaxCall<'a, C, A> where C: BorrowMut<hyper::Cli
/// 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
/// Please note that this method must not be used to set any of the known parameters
/// which have their own setter method. If done anyway, the request will fail.
///
/// # Additional Parameters
@@ -1275,10 +1272,7 @@ impl<'a, C, A> DocumentAnalyzeEntityCall<'a, C, A> where C: BorrowMut<hyper::Cli
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
let url = hyper::Url::parse_with_params(&url, params).unwrap();
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
let mut request_value_reader =
@@ -1310,7 +1304,7 @@ impl<'a, C, A> DocumentAnalyzeEntityCall<'a, C, A> where C: BorrowMut<hyper::Cli
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)
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -1390,7 +1384,7 @@ impl<'a, C, A> DocumentAnalyzeEntityCall<'a, C, A> where C: BorrowMut<hyper::Cli
/// 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
/// Please note that this method must not be used to set any of the known parameters
/// which have their own setter method. If done anyway, the request will fail.
///
/// # Additional Parameters
@@ -1520,10 +1514,7 @@ impl<'a, C, A> DocumentAnalyzeSentimentCall<'a, C, A> where C: BorrowMut<hyper::
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
let url = hyper::Url::parse_with_params(&url, params).unwrap();
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
let mut request_value_reader =
@@ -1555,7 +1546,7 @@ impl<'a, C, A> DocumentAnalyzeSentimentCall<'a, C, A> where C: BorrowMut<hyper::
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)
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -1635,7 +1626,7 @@ impl<'a, C, A> DocumentAnalyzeSentimentCall<'a, C, A> where C: BorrowMut<hyper::
/// 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
/// Please note that this method must not be used to set any of the known parameters
/// which have their own setter method. If done anyway, the request will fail.
///
/// # Additional Parameters
@@ -1766,10 +1757,7 @@ impl<'a, C, A> DocumentAnnotateTextCall<'a, C, A> where C: BorrowMut<hyper::Clie
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
let url = hyper::Url::parse_with_params(&url, params).unwrap();
let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default());
let mut request_value_reader =
@@ -1801,7 +1789,7 @@ impl<'a, C, A> DocumentAnnotateTextCall<'a, C, A> where C: BorrowMut<hyper::Clie
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)
let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone())
.header(ContentType(json_mime_type.clone()))
@@ -1881,7 +1869,7 @@ impl<'a, C, A> DocumentAnnotateTextCall<'a, C, A> where C: BorrowMut<hyper::Clie
/// 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
/// Please note that this method must not be used to set any of the known parameters
/// which have their own setter method. If done anyway, the request will fail.
///
/// # Additional Parameters