remove generated libs

This commit is contained in:
OMGeeky
2024-05-12 22:15:06 +02:00
4862 changed files with 0 additions and 6416267 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,112 +0,0 @@
use super::*;
/// Central instance to access all CloudNaturalLanguage related resource activities
///
/// # Examples
///
/// Instantiate a new hub
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_language1_beta1 as language1_beta1;
/// use language1_beta1::api::AnalyzeEntitiesRequest;
/// use language1_beta1::{Result, Error};
/// # async fn dox() {
/// use std::default::Default;
/// use language1_beta1::{CloudNaturalLanguage, oauth2, hyper, hyper_rustls, chrono, FieldMask};
///
/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
/// // `client_secret`, among other things.
/// let secret: oauth2::ApplicationSecret = Default::default();
/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
/// // unless you replace `None` with the desired Flow.
/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
/// // retrieve them from storage.
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
/// secret,
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
/// ).build().await.unwrap();
/// let mut hub = CloudNaturalLanguage::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), 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 = AnalyzeEntitiesRequest::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.documents().analyze_entities(req)
/// .doit().await;
///
/// match result {
/// Err(e) => match e {
/// // The Error enum provides details about what exactly happened.
/// // You can also just use its `Debug`, `Display` or `Error` traits
/// Error::HttpError(_)
/// |Error::Io(_)
/// |Error::MissingAPIKey
/// |Error::MissingToken(_)
/// |Error::Cancelled
/// |Error::UploadSizeLimitExceeded(_, _)
/// |Error::Failure(_)
/// |Error::BadRequest(_)
/// |Error::FieldClash(_)
/// |Error::JsonDecodeError(_, _) => println!("{}", e),
/// },
/// Ok(res) => println!("Success: {:?}", res),
/// }
/// # }
/// ```
#[derive(Clone)]
pub struct CloudNaturalLanguage<S> {
pub client: hyper::Client<S, hyper::body::Body>,
pub auth: Box<dyn client::GetToken>,
pub(super) _user_agent: String,
pub(super) _base_url: String,
pub(super) _root_url: String,
}
impl<'a, S> client::Hub for CloudNaturalLanguage<S> {}
impl<'a, S> CloudNaturalLanguage<S> {
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> CloudNaturalLanguage<S> {
CloudNaturalLanguage {
client,
auth: Box::new(auth),
_user_agent: "google-api-rust-client/5.0.3".to_string(),
_base_url: "https://language.googleapis.com/".to_string(),
_root_url: "https://language.googleapis.com/".to_string(),
}
}
pub fn documents(&'a self) -> DocumentMethods<'a, S> {
DocumentMethods { hub: &self }
}
/// Set the user-agent header field to use in all requests to the server.
/// It defaults to `google-api-rust-client/5.0.3`.
///
/// Returns the previously set user-agent.
pub fn user_agent(&mut self, agent_name: String) -> String {
mem::replace(&mut self._user_agent, agent_name)
}
/// Set the base url to use in all requests to the server.
/// It defaults to `https://language.googleapis.com/`.
///
/// 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://language.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)
}
}

View File

@@ -1,110 +0,0 @@
use super::*;
/// A builder providing access to all methods supported on *document* resources.
/// It is not used directly, but through the [`CloudNaturalLanguage`] hub.
///
/// # Example
///
/// Instantiate a resource builder
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_language1_beta1 as language1_beta1;
///
/// # async fn dox() {
/// use std::default::Default;
/// use language1_beta1::{CloudNaturalLanguage, oauth2, hyper, hyper_rustls, chrono, FieldMask};
///
/// let secret: oauth2::ApplicationSecret = Default::default();
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
/// secret,
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
/// ).build().await.unwrap();
/// let mut hub = CloudNaturalLanguage::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
/// // like `analyze_entities(...)`, `analyze_sentiment(...)`, `analyze_syntax(...)` and `annotate_text(...)`
/// // to build up your call.
/// let rb = hub.documents();
/// # }
/// ```
pub struct DocumentMethods<'a, S>
where S: 'a {
pub(super) hub: &'a CloudNaturalLanguage<S>,
}
impl<'a, S> client::MethodsBuilder for DocumentMethods<'a, S> {}
impl<'a, S> DocumentMethods<'a, S> {
/// Create a builder to help you perform the following task:
///
/// Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties.
///
/// # Arguments
///
/// * `request` - No description provided.
pub fn analyze_entities(&self, request: AnalyzeEntitiesRequest) -> DocumentAnalyzeEntityCall<'a, S> {
DocumentAnalyzeEntityCall {
hub: self.hub,
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Analyzes the sentiment of the provided text.
///
/// # Arguments
///
/// * `request` - No description provided.
pub fn analyze_sentiment(&self, request: AnalyzeSentimentRequest) -> DocumentAnalyzeSentimentCall<'a, S> {
DocumentAnalyzeSentimentCall {
hub: self.hub,
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.
///
/// # Arguments
///
/// * `request` - No description provided.
pub fn analyze_syntax(&self, request: AnalyzeSyntaxRequest) -> DocumentAnalyzeSyntaxCall<'a, S> {
DocumentAnalyzeSyntaxCall {
hub: self.hub,
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call.
///
/// # Arguments
///
/// * `request` - No description provided.
pub fn annotate_text(&self, request: AnnotateTextRequest) -> DocumentAnnotateTextCall<'a, S> {
DocumentAnnotateTextCall {
hub: self.hub,
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
}

View File

@@ -1,35 +0,0 @@
use std::collections::HashMap;
use std::cell::RefCell;
use std::default::Default;
use std::collections::BTreeSet;
use std::error::Error as StdError;
use serde_json as json;
use std::io;
use std::fs;
use std::mem;
use hyper::client::connect;
use tokio::io::{AsyncRead, AsyncWrite};
use tokio::time::sleep;
use tower_service;
use serde::{Serialize, Deserialize};
use crate::{client, client::GetToken, client::serde_with};
mod utilities;
pub use utilities::*;
mod hub;
pub use hub::*;
mod schemas;
pub use schemas::*;
mod method_builders;
pub use method_builders::*;
mod call_builders;
pub use call_builders::*;
mod enums;
pub use enums::*;

View File

@@ -1,456 +0,0 @@
use super::*;
/// The entity 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 entities documents](DocumentAnalyzeEntityCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[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<AnalyzeEntitiesRequestEncodingTypeEnum>,
}
impl client::RequestValue for AnalyzeEntitiesRequest {}
/// The entity 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 entities documents](DocumentAnalyzeEntityCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct AnalyzeEntitiesResponse {
/// The recognized entities in the input document.
pub entities: Option<Vec<Entity>>,
/// 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>,
}
impl client::ResponseResult for AnalyzeEntitiesResponse {}
/// 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](DocumentAnalyzeSentimentCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[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<AnalyzeSentimentRequestEncodingTypeEnum>,
}
impl client::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](DocumentAnalyzeSentimentCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[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 client::ResponseResult for AnalyzeSentimentResponse {}
/// 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](DocumentAnalyzeSyntaxCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[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<AnalyzeSyntaxRequestEncodingTypeEnum>,
}
impl client::RequestValue for AnalyzeSyntaxRequest {}
/// The syntax 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 syntax documents](DocumentAnalyzeSyntaxCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct AnalyzeSyntaxResponse {
/// 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>,
/// Sentences in the input document.
pub sentences: Option<Vec<Sentence>>,
/// Tokens, along with their syntactic information, in the input document.
pub tokens: Option<Vec<Token>>,
}
impl client::ResponseResult for AnalyzeSyntaxResponse {}
/// The request message for the text annotation API, which can perform multiple analysis types (sentiment, entities, and syntax) in one call.
///
/// # 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*).
///
/// * [annotate text documents](DocumentAnnotateTextCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[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<AnnotateTextRequestEncodingTypeEnum>,
/// The enabled features.
pub features: Option<Features>,
}
impl client::RequestValue for AnnotateTextRequest {}
/// The text annotations 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*).
///
/// * [annotate text documents](DocumentAnnotateTextCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct AnnotateTextResponse {
/// The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.
#[serde(rename="documentSentiment")]
pub document_sentiment: Option<Sentiment>,
/// Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities.
pub entities: Option<Vec<Entity>>,
/// 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>,
/// Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.
pub sentences: Option<Vec<Sentence>>,
/// Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax.
pub tokens: Option<Vec<Token>>,
}
impl client::ResponseResult for AnnotateTextResponse {}
/// Represents dependency parse tree information for a token.
///
/// This type is not used in any activity, and only used as *part* of another schema.
///
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct DependencyEdge {
/// Represents the head of this token in the dependency tree. This is the index of the token which has an arc going to this token. The index is the position of the token in the array of tokens returned by the API method. If this token is a root token, then the `head_token_index` is its own index.
#[serde(rename="headTokenIndex")]
pub head_token_index: Option<i32>,
/// The parse label for the token.
pub label: Option<DependencyEdgeLabelEnum>,
}
impl client::Part for DependencyEdge {}
/// \################################################################ # Represents the input to API methods.
///
/// # 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 entities documents](DocumentAnalyzeEntityCall) (none)
/// * [analyze sentiment documents](DocumentAnalyzeSentimentCall) (none)
/// * [analyze syntax documents](DocumentAnalyzeSyntaxCall) (none)
/// * [annotate text documents](DocumentAnnotateTextCall) (none)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Document {
/// The content of the input in string format. Cloud audit logging exempt since it is based on user data.
pub content: Option<String>,
/// The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.
#[serde(rename="gcsContentUri")]
pub gcs_content_uri: Option<String>,
/// The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. [Language Support](https://cloud.google.com/natural-language/docs/languages) lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an `INVALID_ARGUMENT` error is returned.
pub language: Option<String>,
/// Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
#[serde(rename="type")]
pub type_: Option<DocumentTypeEnum>,
}
impl client::Resource for Document {}
/// Represents a phrase in the text that is a known entity, such as a person, an organization, or location. The API associates information, such as salience and mentions, with entities.
///
/// This type is not used in any activity, and only used as *part* of another schema.
///
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Entity {
/// The mentions of this entity in the input document. The API currently supports proper noun mentions.
pub mentions: Option<Vec<EntityMention>>,
/// Metadata associated with the 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 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 importance or centrality of that entity to the entire document text. Scores closer to 0 are less salient, while scores closer to 1.0 are highly salient.
pub salience: Option<f32>,
/// The entity type.
#[serde(rename="type")]
pub type_: Option<EntityTypeEnum>,
}
impl client::Part for Entity {}
/// Represents a mention for an entity in the text. Currently, proper noun mentions are supported.
///
/// This type is not used in any activity, and only used as *part* of another schema.
///
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct EntityMention {
/// The mention text.
pub text: Option<TextSpan>,
/// The type of the entity mention.
#[serde(rename="type")]
pub type_: Option<EntityMentionTypeEnum>,
}
impl client::Part for EntityMention {}
/// All available features for sentiment, syntax, and semantic analysis. Setting each one to true will enable that specific analysis for the input.
///
/// This type is not used in any activity, and only used as *part* of another schema.
///
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Features {
/// 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 client::Part for Features {}
/// Represents part of speech information for a token.
///
/// This type is not used in any activity, and only used as *part* of another schema.
///
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PartOfSpeech {
/// The grammatical aspect.
pub aspect: Option<PartOfSpeechAspectEnum>,
/// The grammatical case.
pub case: Option<PartOfSpeechCaseEnum>,
/// The grammatical form.
pub form: Option<PartOfSpeechFormEnum>,
/// The grammatical gender.
pub gender: Option<PartOfSpeechGenderEnum>,
/// The grammatical mood.
pub mood: Option<PartOfSpeechMoodEnum>,
/// The grammatical number.
pub number: Option<PartOfSpeechNumberEnum>,
/// The grammatical person.
pub person: Option<PartOfSpeechPersonEnum>,
/// The grammatical properness.
pub proper: Option<PartOfSpeechProperEnum>,
/// The grammatical reciprocity.
pub reciprocity: Option<PartOfSpeechReciprocityEnum>,
/// The part of speech tag.
pub tag: Option<PartOfSpeechTagEnum>,
/// The grammatical tense.
pub tense: Option<PartOfSpeechTenseEnum>,
/// The grammatical voice.
pub voice: Option<PartOfSpeechVoiceEnum>,
}
impl client::Part for PartOfSpeech {}
/// Represents a sentence in the input document.
///
/// This type is not used in any activity, and only used as *part* of another schema.
///
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Sentence {
/// For calls to AnalyzeSentiment or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.
pub sentiment: Option<Sentiment>,
/// The sentence text.
pub text: Option<TextSpan>,
}
impl client::Part for Sentence {}
/// Represents the feeling associated with the entire text or entities in the text.
///
/// This type is not used in any activity, and only used as *part* of another schema.
///
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Sentiment {
/// 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>,
/// DEPRECATED FIELD - This field is being deprecated in 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>,
}
impl client::Part for Sentiment {}
/// Represents an output piece of text.
///
/// This type is not used in any activity, and only used as *part* of another schema.
///
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct TextSpan {
/// The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.
#[serde(rename="beginOffset")]
pub begin_offset: Option<i32>,
/// The content of the output text.
pub content: Option<String>,
}
impl client::Part for TextSpan {}
/// Represents the smallest syntactic building block of the text.
///
/// This type is not used in any activity, and only used as *part* of another schema.
///
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Token {
/// Dependency tree parse for this token.
#[serde(rename="dependencyEdge")]
pub dependency_edge: Option<DependencyEdge>,
/// [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
pub lemma: Option<String>,
/// Parts of speech tag for this token.
#[serde(rename="partOfSpeech")]
pub part_of_speech: Option<PartOfSpeech>,
/// The token text.
pub text: Option<TextSpan>,
}
impl client::Part for Token {}

View File

@@ -1,28 +0,0 @@
use super::*;
/// Identifies the an OAuth2 authorization scope.
/// A scope is needed when requesting an
/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
#[derive(PartialEq, Eq, Hash, Debug, Clone)]
pub enum Scope {
/// Apply machine learning models to reveal the structure and meaning of text
CloudLanguage,
/// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
CloudPlatform,
}
impl AsRef<str> for Scope {
fn as_ref(&self) -> &str {
match *self {
Scope::CloudLanguage => "https://www.googleapis.com/auth/cloud-language",
Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform",
}
}
}
impl Default for Scope {
fn default() -> Scope {
Scope::CloudLanguage
}
}

View File

@@ -1,206 +0,0 @@
// DO NOT EDIT !
// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
// DO NOT EDIT !
//! This documentation was generated from *Cloud Natural Language* crate version *5.0.4+20220218*, where *20220218* is the exact revision of the *language:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.4*.
//!
//! Everything else about the *Cloud Natural Language* *v1_beta1* API can be found at the
//! [official documentation site](https://cloud.google.com/natural-language/).
//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/language1_beta1).
//! # Features
//!
//! Handle the following *Resources* with ease from the central [hub](CloudNaturalLanguage) ...
//!
//! * [documents](api::Document)
//! * [*analyze entities*](api::DocumentAnalyzeEntityCall), [*analyze sentiment*](api::DocumentAnalyzeSentimentCall), [*analyze syntax*](api::DocumentAnalyzeSyntaxCall) and [*annotate text*](api::DocumentAnnotateTextCall)
//!
//!
//!
//!
//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
//!
//! # Structure of this Library
//!
//! The API is structured into the following primary items:
//!
//! * **[Hub](CloudNaturalLanguage)**
//! * a central object to maintain state and allow accessing all *Activities*
//! * creates [*Method Builders*](client::MethodsBuilder) which in turn
//! allow access to individual [*Call Builders*](client::CallBuilder)
//! * **[Resources](client::Resource)**
//! * primary types that you can apply *Activities* to
//! * a collection of properties and *Parts*
//! * **[Parts](client::Part)**
//! * a collection of properties
//! * never directly used in *Activities*
//! * **[Activities](client::CallBuilder)**
//! * operations to apply to *Resources*
//!
//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
//!
//! Generally speaking, you can invoke *Activities* like this:
//!
//! ```Rust,ignore
//! let r = hub.resource().activity(...).doit().await
//! ```
//!
//! Or specifically ...
//!
//! ```ignore
//! let r = hub.documents().analyze_entities(...).doit().await
//! let r = hub.documents().analyze_sentiment(...).doit().await
//! let r = hub.documents().analyze_syntax(...).doit().await
//! let r = hub.documents().annotate_text(...).doit().await
//! ```
//!
//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
//! The `doit()` method performs the actual communication with the server and returns the respective result.
//!
//! # Usage
//!
//! ## Setting up your Project
//!
//! To use this library, you would put the following lines into your `Cargo.toml` file:
//!
//! ```toml
//! [dependencies]
//! google-language1_beta1 = "*"
//! serde = "^1.0"
//! serde_json = "^1.0"
//! ```
//!
//! ## A complete example
//!
//! ```test_harness,no_run
//! extern crate hyper;
//! extern crate hyper_rustls;
//! extern crate google_language1_beta1 as language1_beta1;
//! use language1_beta1::api::AnalyzeEntitiesRequest;
//! use language1_beta1::{Result, Error};
//! # async fn dox() {
//! use std::default::Default;
//! use language1_beta1::{CloudNaturalLanguage, oauth2, hyper, hyper_rustls, chrono, FieldMask};
//!
//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
//! // `client_secret`, among other things.
//! let secret: oauth2::ApplicationSecret = Default::default();
//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
//! // unless you replace `None` with the desired Flow.
//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
//! // retrieve them from storage.
//! let auth = oauth2::InstalledFlowAuthenticator::builder(
//! secret,
//! oauth2::InstalledFlowReturnMethod::HTTPRedirect,
//! ).build().await.unwrap();
//! let mut hub = CloudNaturalLanguage::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), 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 = AnalyzeEntitiesRequest::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.documents().analyze_entities(req)
//! .doit().await;
//!
//! match result {
//! Err(e) => match e {
//! // The Error enum provides details about what exactly happened.
//! // You can also just use its `Debug`, `Display` or `Error` traits
//! Error::HttpError(_)
//! |Error::Io(_)
//! |Error::MissingAPIKey
//! |Error::MissingToken(_)
//! |Error::Cancelled
//! |Error::UploadSizeLimitExceeded(_, _)
//! |Error::Failure(_)
//! |Error::BadRequest(_)
//! |Error::FieldClash(_)
//! |Error::JsonDecodeError(_, _) => println!("{}", e),
//! },
//! Ok(res) => println!("Success: {:?}", res),
//! }
//! # }
//! ```
//! ## Handling Errors
//!
//! All errors produced by the system are provided either as [Result](client::Result) enumeration as return value of
//! the doit() methods, or handed as possibly intermediate results to either the
//! [Hub Delegate](client::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
//!
//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
//! makes the system potentially resilient to all kinds of errors.
//!
//! ## Uploads and Downloads
//! If a method supports downloads, the response body, which is part of the [Result](client::Result), should be
//! read by you to obtain the media.
//! If such a method also supports a [Response Result](client::ResponseResult), it will return that by default.
//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
//! this call: `.param("alt", "media")`.
//!
//! Methods supporting uploads can do so using up to 2 different protocols:
//! *simple* and *resumable*. The distinctiveness of each is represented by customized
//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
//!
//! ## Customization and Callbacks
//!
//! You may alter the way an `doit()` method is called by providing a [delegate](client::Delegate) to the
//! [Method Builder](client::CallBuilder) before making the final `doit()` call.
//! Respective methods will be called to provide progress information, as well as determine whether the system should
//! retry on failure.
//!
//! The [delegate trait](client::Delegate) is default-implemented, allowing you to customize it with minimal effort.
//!
//! ## Optional Parts in Server-Requests
//!
//! All structures provided by this library are made to be [encodable](client::RequestValue) and
//! [decodable](client::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
//! are valid.
//! Most optionals are are considered [Parts](client::Part) which are identifiable by name, which will be sent to
//! the server to indicate either the set parts of the request or the desired parts in the response.
//!
//! ## Builder Arguments
//!
//! Using [method builders](client::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
//! These will always take a single argument, for which the following statements are true.
//!
//! * [PODs][wiki-pod] are handed by copy
//! * strings are passed as `&str`
//! * [request values](client::RequestValue) are moved
//!
//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
//!
//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
//! [google-go-api]: https://github.com/google/google-api-go-client
//!
//!
// 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
// unused imports in fully featured APIs. Same with unused_mut ... .
#![allow(unused_imports, unused_mut, dead_code)]
// DO NOT EDIT !
// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
// DO NOT EDIT !
// Re-export the hyper and hyper_rustls crate, they are required to build the hub
pub use hyper;
pub use hyper_rustls;
pub extern crate google_apis_common as client;
pub use client::chrono;
pub mod api;
// Re-export the hub type and some basic client structs
pub use api::CloudNaturalLanguage;
pub use client::{Result, Error, Delegate, FieldMask};
// Re-export the yup_oauth2 crate, that is required to call some methods of the hub and the client
#[cfg(feature = "yup-oauth2")]
pub use client::oauth2;