use std::error::Error;
use std::fmt;
use async_trait::async_trait;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError};
use rusoto_core::proto;
use rusoto_core::request::HttpResponse;
use rusoto_core::signature::SignedRequest;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
impl ComprehendClient {
fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
let mut request = SignedRequest::new(http_method, "comprehend", &self.region, request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
request
}
async fn sign_and_dispatch<E>(
&self,
request: SignedRequest,
from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
) -> Result<HttpResponse, RusotoError<E>> {
let mut response = self.client.sign_and_dispatch(request).await?;
if !response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
return Err(from_response(response));
}
Ok(response)
}
}
use serde_json;
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BatchDetectDominantLanguageItemResult {
#[serde(rename = "Index")]
#[serde(skip_serializing_if = "Option::is_none")]
pub index: Option<i64>,
#[serde(rename = "Languages")]
#[serde(skip_serializing_if = "Option::is_none")]
pub languages: Option<Vec<DominantLanguage>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct BatchDetectDominantLanguageRequest {
#[serde(rename = "TextList")]
pub text_list: Vec<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BatchDetectDominantLanguageResponse {
#[serde(rename = "ErrorList")]
pub error_list: Vec<BatchItemError>,
#[serde(rename = "ResultList")]
pub result_list: Vec<BatchDetectDominantLanguageItemResult>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BatchDetectEntitiesItemResult {
#[serde(rename = "Entities")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entities: Option<Vec<Entity>>,
#[serde(rename = "Index")]
#[serde(skip_serializing_if = "Option::is_none")]
pub index: Option<i64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct BatchDetectEntitiesRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "TextList")]
pub text_list: Vec<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BatchDetectEntitiesResponse {
#[serde(rename = "ErrorList")]
pub error_list: Vec<BatchItemError>,
#[serde(rename = "ResultList")]
pub result_list: Vec<BatchDetectEntitiesItemResult>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BatchDetectKeyPhrasesItemResult {
#[serde(rename = "Index")]
#[serde(skip_serializing_if = "Option::is_none")]
pub index: Option<i64>,
#[serde(rename = "KeyPhrases")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_phrases: Option<Vec<KeyPhrase>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct BatchDetectKeyPhrasesRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "TextList")]
pub text_list: Vec<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BatchDetectKeyPhrasesResponse {
#[serde(rename = "ErrorList")]
pub error_list: Vec<BatchItemError>,
#[serde(rename = "ResultList")]
pub result_list: Vec<BatchDetectKeyPhrasesItemResult>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BatchDetectSentimentItemResult {
#[serde(rename = "Index")]
#[serde(skip_serializing_if = "Option::is_none")]
pub index: Option<i64>,
#[serde(rename = "Sentiment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sentiment: Option<String>,
#[serde(rename = "SentimentScore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sentiment_score: Option<SentimentScore>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct BatchDetectSentimentRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "TextList")]
pub text_list: Vec<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BatchDetectSentimentResponse {
#[serde(rename = "ErrorList")]
pub error_list: Vec<BatchItemError>,
#[serde(rename = "ResultList")]
pub result_list: Vec<BatchDetectSentimentItemResult>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BatchDetectSyntaxItemResult {
#[serde(rename = "Index")]
#[serde(skip_serializing_if = "Option::is_none")]
pub index: Option<i64>,
#[serde(rename = "SyntaxTokens")]
#[serde(skip_serializing_if = "Option::is_none")]
pub syntax_tokens: Option<Vec<SyntaxToken>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct BatchDetectSyntaxRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "TextList")]
pub text_list: Vec<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BatchDetectSyntaxResponse {
#[serde(rename = "ErrorList")]
pub error_list: Vec<BatchItemError>,
#[serde(rename = "ResultList")]
pub result_list: Vec<BatchDetectSyntaxItemResult>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BatchItemError {
#[serde(rename = "ErrorCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_code: Option<String>,
#[serde(rename = "ErrorMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_message: Option<String>,
#[serde(rename = "Index")]
#[serde(skip_serializing_if = "Option::is_none")]
pub index: Option<i64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ClassifierEvaluationMetrics {
#[serde(rename = "Accuracy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accuracy: Option<f64>,
#[serde(rename = "F1Score")]
#[serde(skip_serializing_if = "Option::is_none")]
pub f1_score: Option<f64>,
#[serde(rename = "HammingLoss")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hamming_loss: Option<f64>,
#[serde(rename = "MicroF1Score")]
#[serde(skip_serializing_if = "Option::is_none")]
pub micro_f1_score: Option<f64>,
#[serde(rename = "MicroPrecision")]
#[serde(skip_serializing_if = "Option::is_none")]
pub micro_precision: Option<f64>,
#[serde(rename = "MicroRecall")]
#[serde(skip_serializing_if = "Option::is_none")]
pub micro_recall: Option<f64>,
#[serde(rename = "Precision")]
#[serde(skip_serializing_if = "Option::is_none")]
pub precision: Option<f64>,
#[serde(rename = "Recall")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recall: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ClassifierMetadata {
#[serde(rename = "EvaluationMetrics")]
#[serde(skip_serializing_if = "Option::is_none")]
pub evaluation_metrics: Option<ClassifierEvaluationMetrics>,
#[serde(rename = "NumberOfLabels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_labels: Option<i64>,
#[serde(rename = "NumberOfTestDocuments")]
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_test_documents: Option<i64>,
#[serde(rename = "NumberOfTrainedDocuments")]
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_trained_documents: Option<i64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ClassifyDocumentRequest {
#[serde(rename = "EndpointArn")]
pub endpoint_arn: String,
#[serde(rename = "Text")]
pub text: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ClassifyDocumentResponse {
#[serde(rename = "Classes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub classes: Option<Vec<DocumentClass>>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<DocumentLabel>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateDocumentClassifierRequest {
#[serde(rename = "ClientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "DataAccessRoleArn")]
pub data_access_role_arn: String,
#[serde(rename = "DocumentClassifierName")]
pub document_classifier_name: String,
#[serde(rename = "InputDataConfig")]
pub input_data_config: DocumentClassifierInputDataConfig,
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "Mode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mode: Option<String>,
#[serde(rename = "OutputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_data_config: Option<DocumentClassifierOutputDataConfig>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateDocumentClassifierResponse {
#[serde(rename = "DocumentClassifierArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub document_classifier_arn: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateEndpointRequest {
#[serde(rename = "ClientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "DesiredInferenceUnits")]
pub desired_inference_units: i64,
#[serde(rename = "EndpointName")]
pub endpoint_name: String,
#[serde(rename = "ModelArn")]
pub model_arn: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateEndpointResponse {
#[serde(rename = "EndpointArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_arn: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateEntityRecognizerRequest {
#[serde(rename = "ClientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "DataAccessRoleArn")]
pub data_access_role_arn: String,
#[serde(rename = "InputDataConfig")]
pub input_data_config: EntityRecognizerInputDataConfig,
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "RecognizerName")]
pub recognizer_name: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateEntityRecognizerResponse {
#[serde(rename = "EntityRecognizerArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_recognizer_arn: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteDocumentClassifierRequest {
#[serde(rename = "DocumentClassifierArn")]
pub document_classifier_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteDocumentClassifierResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteEndpointRequest {
#[serde(rename = "EndpointArn")]
pub endpoint_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteEndpointResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteEntityRecognizerRequest {
#[serde(rename = "EntityRecognizerArn")]
pub entity_recognizer_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteEntityRecognizerResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeDocumentClassificationJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeDocumentClassificationJobResponse {
#[serde(rename = "DocumentClassificationJobProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub document_classification_job_properties: Option<DocumentClassificationJobProperties>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeDocumentClassifierRequest {
#[serde(rename = "DocumentClassifierArn")]
pub document_classifier_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeDocumentClassifierResponse {
#[serde(rename = "DocumentClassifierProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub document_classifier_properties: Option<DocumentClassifierProperties>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeDominantLanguageDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeDominantLanguageDetectionJobResponse {
#[serde(rename = "DominantLanguageDetectionJobProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dominant_language_detection_job_properties: Option<DominantLanguageDetectionJobProperties>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeEndpointRequest {
#[serde(rename = "EndpointArn")]
pub endpoint_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeEndpointResponse {
#[serde(rename = "EndpointProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_properties: Option<EndpointProperties>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeEntitiesDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeEntitiesDetectionJobResponse {
#[serde(rename = "EntitiesDetectionJobProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entities_detection_job_properties: Option<EntitiesDetectionJobProperties>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeEntityRecognizerRequest {
#[serde(rename = "EntityRecognizerArn")]
pub entity_recognizer_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeEntityRecognizerResponse {
#[serde(rename = "EntityRecognizerProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_recognizer_properties: Option<EntityRecognizerProperties>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeKeyPhrasesDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeKeyPhrasesDetectionJobResponse {
#[serde(rename = "KeyPhrasesDetectionJobProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_phrases_detection_job_properties: Option<KeyPhrasesDetectionJobProperties>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeSentimentDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeSentimentDetectionJobResponse {
#[serde(rename = "SentimentDetectionJobProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sentiment_detection_job_properties: Option<SentimentDetectionJobProperties>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeTopicsDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeTopicsDetectionJobResponse {
#[serde(rename = "TopicsDetectionJobProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub topics_detection_job_properties: Option<TopicsDetectionJobProperties>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DetectDominantLanguageRequest {
#[serde(rename = "Text")]
pub text: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DetectDominantLanguageResponse {
#[serde(rename = "Languages")]
#[serde(skip_serializing_if = "Option::is_none")]
pub languages: Option<Vec<DominantLanguage>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DetectEntitiesRequest {
#[serde(rename = "EndpointArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_arn: Option<String>,
#[serde(rename = "LanguageCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub language_code: Option<String>,
#[serde(rename = "Text")]
pub text: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DetectEntitiesResponse {
#[serde(rename = "Entities")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entities: Option<Vec<Entity>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DetectKeyPhrasesRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "Text")]
pub text: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DetectKeyPhrasesResponse {
#[serde(rename = "KeyPhrases")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_phrases: Option<Vec<KeyPhrase>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DetectSentimentRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "Text")]
pub text: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DetectSentimentResponse {
#[serde(rename = "Sentiment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sentiment: Option<String>,
#[serde(rename = "SentimentScore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sentiment_score: Option<SentimentScore>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DetectSyntaxRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "Text")]
pub text: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DetectSyntaxResponse {
#[serde(rename = "SyntaxTokens")]
#[serde(skip_serializing_if = "Option::is_none")]
pub syntax_tokens: Option<Vec<SyntaxToken>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DocumentClass {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Score")]
#[serde(skip_serializing_if = "Option::is_none")]
pub score: Option<f32>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DocumentClassificationJobFilter {
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
#[serde(rename = "SubmitTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_after: Option<f64>,
#[serde(rename = "SubmitTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_before: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DocumentClassificationJobProperties {
#[serde(rename = "DataAccessRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_access_role_arn: Option<String>,
#[serde(rename = "DocumentClassifierArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub document_classifier_arn: Option<String>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "InputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_data_config: Option<InputDataConfig>,
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "OutputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_data_config: Option<OutputDataConfig>,
#[serde(rename = "SubmitTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time: Option<f64>,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DocumentClassifierFilter {
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "SubmitTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_after: Option<f64>,
#[serde(rename = "SubmitTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_before: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct DocumentClassifierInputDataConfig {
#[serde(rename = "LabelDelimiter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub label_delimiter: Option<String>,
#[serde(rename = "S3Uri")]
pub s3_uri: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct DocumentClassifierOutputDataConfig {
#[serde(rename = "KmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_id: Option<String>,
#[serde(rename = "S3Uri")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_uri: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DocumentClassifierProperties {
#[serde(rename = "ClassifierMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub classifier_metadata: Option<ClassifierMetadata>,
#[serde(rename = "DataAccessRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_access_role_arn: Option<String>,
#[serde(rename = "DocumentClassifierArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub document_classifier_arn: Option<String>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "InputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_data_config: Option<DocumentClassifierInputDataConfig>,
#[serde(rename = "LanguageCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub language_code: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "Mode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mode: Option<String>,
#[serde(rename = "OutputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_data_config: Option<DocumentClassifierOutputDataConfig>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "SubmitTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time: Option<f64>,
#[serde(rename = "TrainingEndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_end_time: Option<f64>,
#[serde(rename = "TrainingStartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_start_time: Option<f64>,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DocumentLabel {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Score")]
#[serde(skip_serializing_if = "Option::is_none")]
pub score: Option<f32>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DominantLanguage {
#[serde(rename = "LanguageCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub language_code: Option<String>,
#[serde(rename = "Score")]
#[serde(skip_serializing_if = "Option::is_none")]
pub score: Option<f32>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DominantLanguageDetectionJobFilter {
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
#[serde(rename = "SubmitTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_after: Option<f64>,
#[serde(rename = "SubmitTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_before: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DominantLanguageDetectionJobProperties {
#[serde(rename = "DataAccessRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_access_role_arn: Option<String>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "InputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_data_config: Option<InputDataConfig>,
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "OutputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_data_config: Option<OutputDataConfig>,
#[serde(rename = "SubmitTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time: Option<f64>,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct EndpointFilter {
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "ModelArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_arn: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EndpointProperties {
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "CurrentInferenceUnits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_inference_units: Option<i64>,
#[serde(rename = "DesiredInferenceUnits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub desired_inference_units: Option<i64>,
#[serde(rename = "EndpointArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_arn: Option<String>,
#[serde(rename = "LastModifiedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time: Option<f64>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "ModelArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_arn: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct EntitiesDetectionJobFilter {
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
#[serde(rename = "SubmitTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_after: Option<f64>,
#[serde(rename = "SubmitTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_before: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EntitiesDetectionJobProperties {
#[serde(rename = "DataAccessRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_access_role_arn: Option<String>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "EntityRecognizerArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_recognizer_arn: Option<String>,
#[serde(rename = "InputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_data_config: Option<InputDataConfig>,
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
#[serde(rename = "LanguageCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub language_code: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "OutputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_data_config: Option<OutputDataConfig>,
#[serde(rename = "SubmitTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time: Option<f64>,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Entity {
#[serde(rename = "BeginOffset")]
#[serde(skip_serializing_if = "Option::is_none")]
pub begin_offset: Option<i64>,
#[serde(rename = "EndOffset")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_offset: Option<i64>,
#[serde(rename = "Score")]
#[serde(skip_serializing_if = "Option::is_none")]
pub score: Option<f32>,
#[serde(rename = "Text")]
#[serde(skip_serializing_if = "Option::is_none")]
pub text: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct EntityRecognizerAnnotations {
#[serde(rename = "S3Uri")]
pub s3_uri: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct EntityRecognizerDocuments {
#[serde(rename = "S3Uri")]
pub s3_uri: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct EntityRecognizerEntityList {
#[serde(rename = "S3Uri")]
pub s3_uri: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EntityRecognizerEvaluationMetrics {
#[serde(rename = "F1Score")]
#[serde(skip_serializing_if = "Option::is_none")]
pub f1_score: Option<f64>,
#[serde(rename = "Precision")]
#[serde(skip_serializing_if = "Option::is_none")]
pub precision: Option<f64>,
#[serde(rename = "Recall")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recall: Option<f64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct EntityRecognizerFilter {
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "SubmitTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_after: Option<f64>,
#[serde(rename = "SubmitTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_before: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct EntityRecognizerInputDataConfig {
#[serde(rename = "Annotations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub annotations: Option<EntityRecognizerAnnotations>,
#[serde(rename = "Documents")]
pub documents: EntityRecognizerDocuments,
#[serde(rename = "EntityList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_list: Option<EntityRecognizerEntityList>,
#[serde(rename = "EntityTypes")]
pub entity_types: Vec<EntityTypesListItem>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EntityRecognizerMetadata {
#[serde(rename = "EntityTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_types: Option<Vec<EntityRecognizerMetadataEntityTypesListItem>>,
#[serde(rename = "EvaluationMetrics")]
#[serde(skip_serializing_if = "Option::is_none")]
pub evaluation_metrics: Option<EntityRecognizerEvaluationMetrics>,
#[serde(rename = "NumberOfTestDocuments")]
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_test_documents: Option<i64>,
#[serde(rename = "NumberOfTrainedDocuments")]
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_trained_documents: Option<i64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EntityRecognizerMetadataEntityTypesListItem {
#[serde(rename = "EvaluationMetrics")]
#[serde(skip_serializing_if = "Option::is_none")]
pub evaluation_metrics: Option<EntityTypesEvaluationMetrics>,
#[serde(rename = "NumberOfTrainMentions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_train_mentions: Option<i64>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EntityRecognizerProperties {
#[serde(rename = "DataAccessRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_access_role_arn: Option<String>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "EntityRecognizerArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_recognizer_arn: Option<String>,
#[serde(rename = "InputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_data_config: Option<EntityRecognizerInputDataConfig>,
#[serde(rename = "LanguageCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub language_code: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "RecognizerMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recognizer_metadata: Option<EntityRecognizerMetadata>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "SubmitTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time: Option<f64>,
#[serde(rename = "TrainingEndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_end_time: Option<f64>,
#[serde(rename = "TrainingStartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_start_time: Option<f64>,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EntityTypesEvaluationMetrics {
#[serde(rename = "F1Score")]
#[serde(skip_serializing_if = "Option::is_none")]
pub f1_score: Option<f64>,
#[serde(rename = "Precision")]
#[serde(skip_serializing_if = "Option::is_none")]
pub precision: Option<f64>,
#[serde(rename = "Recall")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recall: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct EntityTypesListItem {
#[serde(rename = "Type")]
pub type_: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct InputDataConfig {
#[serde(rename = "InputFormat")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_format: Option<String>,
#[serde(rename = "S3Uri")]
pub s3_uri: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct KeyPhrase {
#[serde(rename = "BeginOffset")]
#[serde(skip_serializing_if = "Option::is_none")]
pub begin_offset: Option<i64>,
#[serde(rename = "EndOffset")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_offset: Option<i64>,
#[serde(rename = "Score")]
#[serde(skip_serializing_if = "Option::is_none")]
pub score: Option<f32>,
#[serde(rename = "Text")]
#[serde(skip_serializing_if = "Option::is_none")]
pub text: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct KeyPhrasesDetectionJobFilter {
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
#[serde(rename = "SubmitTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_after: Option<f64>,
#[serde(rename = "SubmitTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_before: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct KeyPhrasesDetectionJobProperties {
#[serde(rename = "DataAccessRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_access_role_arn: Option<String>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "InputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_data_config: Option<InputDataConfig>,
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
#[serde(rename = "LanguageCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub language_code: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "OutputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_data_config: Option<OutputDataConfig>,
#[serde(rename = "SubmitTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time: Option<f64>,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListDocumentClassificationJobsRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<DocumentClassificationJobFilter>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListDocumentClassificationJobsResponse {
#[serde(rename = "DocumentClassificationJobPropertiesList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub document_classification_job_properties_list:
Option<Vec<DocumentClassificationJobProperties>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListDocumentClassifiersRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<DocumentClassifierFilter>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListDocumentClassifiersResponse {
#[serde(rename = "DocumentClassifierPropertiesList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub document_classifier_properties_list: Option<Vec<DocumentClassifierProperties>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListDominantLanguageDetectionJobsRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<DominantLanguageDetectionJobFilter>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListDominantLanguageDetectionJobsResponse {
#[serde(rename = "DominantLanguageDetectionJobPropertiesList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dominant_language_detection_job_properties_list:
Option<Vec<DominantLanguageDetectionJobProperties>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListEndpointsRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<EndpointFilter>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListEndpointsResponse {
#[serde(rename = "EndpointPropertiesList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_properties_list: Option<Vec<EndpointProperties>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListEntitiesDetectionJobsRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<EntitiesDetectionJobFilter>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListEntitiesDetectionJobsResponse {
#[serde(rename = "EntitiesDetectionJobPropertiesList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entities_detection_job_properties_list: Option<Vec<EntitiesDetectionJobProperties>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListEntityRecognizersRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<EntityRecognizerFilter>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListEntityRecognizersResponse {
#[serde(rename = "EntityRecognizerPropertiesList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_recognizer_properties_list: Option<Vec<EntityRecognizerProperties>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListKeyPhrasesDetectionJobsRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<KeyPhrasesDetectionJobFilter>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListKeyPhrasesDetectionJobsResponse {
#[serde(rename = "KeyPhrasesDetectionJobPropertiesList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_phrases_detection_job_properties_list: Option<Vec<KeyPhrasesDetectionJobProperties>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListSentimentDetectionJobsRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<SentimentDetectionJobFilter>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListSentimentDetectionJobsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SentimentDetectionJobPropertiesList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sentiment_detection_job_properties_list: Option<Vec<SentimentDetectionJobProperties>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListTagsForResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListTagsForResourceResponse {
#[serde(rename = "ResourceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_arn: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListTopicsDetectionJobsRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<TopicsDetectionJobFilter>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListTopicsDetectionJobsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "TopicsDetectionJobPropertiesList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub topics_detection_job_properties_list: Option<Vec<TopicsDetectionJobProperties>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct OutputDataConfig {
#[serde(rename = "KmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_id: Option<String>,
#[serde(rename = "S3Uri")]
pub s3_uri: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct PartOfSpeechTag {
#[serde(rename = "Score")]
#[serde(skip_serializing_if = "Option::is_none")]
pub score: Option<f32>,
#[serde(rename = "Tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct SentimentDetectionJobFilter {
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
#[serde(rename = "SubmitTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_after: Option<f64>,
#[serde(rename = "SubmitTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_before: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SentimentDetectionJobProperties {
#[serde(rename = "DataAccessRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_access_role_arn: Option<String>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "InputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_data_config: Option<InputDataConfig>,
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
#[serde(rename = "LanguageCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub language_code: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "OutputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_data_config: Option<OutputDataConfig>,
#[serde(rename = "SubmitTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time: Option<f64>,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SentimentScore {
#[serde(rename = "Mixed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mixed: Option<f32>,
#[serde(rename = "Negative")]
#[serde(skip_serializing_if = "Option::is_none")]
pub negative: Option<f32>,
#[serde(rename = "Neutral")]
#[serde(skip_serializing_if = "Option::is_none")]
pub neutral: Option<f32>,
#[serde(rename = "Positive")]
#[serde(skip_serializing_if = "Option::is_none")]
pub positive: Option<f32>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct StartDocumentClassificationJobRequest {
#[serde(rename = "ClientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "DataAccessRoleArn")]
pub data_access_role_arn: String,
#[serde(rename = "DocumentClassifierArn")]
pub document_classifier_arn: String,
#[serde(rename = "InputDataConfig")]
pub input_data_config: InputDataConfig,
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "OutputDataConfig")]
pub output_data_config: OutputDataConfig,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct StartDocumentClassificationJobResponse {
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct StartDominantLanguageDetectionJobRequest {
#[serde(rename = "ClientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "DataAccessRoleArn")]
pub data_access_role_arn: String,
#[serde(rename = "InputDataConfig")]
pub input_data_config: InputDataConfig,
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "OutputDataConfig")]
pub output_data_config: OutputDataConfig,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct StartDominantLanguageDetectionJobResponse {
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct StartEntitiesDetectionJobRequest {
#[serde(rename = "ClientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "DataAccessRoleArn")]
pub data_access_role_arn: String,
#[serde(rename = "EntityRecognizerArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_recognizer_arn: Option<String>,
#[serde(rename = "InputDataConfig")]
pub input_data_config: InputDataConfig,
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "OutputDataConfig")]
pub output_data_config: OutputDataConfig,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct StartEntitiesDetectionJobResponse {
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct StartKeyPhrasesDetectionJobRequest {
#[serde(rename = "ClientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "DataAccessRoleArn")]
pub data_access_role_arn: String,
#[serde(rename = "InputDataConfig")]
pub input_data_config: InputDataConfig,
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "OutputDataConfig")]
pub output_data_config: OutputDataConfig,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct StartKeyPhrasesDetectionJobResponse {
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct StartSentimentDetectionJobRequest {
#[serde(rename = "ClientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "DataAccessRoleArn")]
pub data_access_role_arn: String,
#[serde(rename = "InputDataConfig")]
pub input_data_config: InputDataConfig,
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "OutputDataConfig")]
pub output_data_config: OutputDataConfig,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct StartSentimentDetectionJobResponse {
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct StartTopicsDetectionJobRequest {
#[serde(rename = "ClientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "DataAccessRoleArn")]
pub data_access_role_arn: String,
#[serde(rename = "InputDataConfig")]
pub input_data_config: InputDataConfig,
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "NumberOfTopics")]
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_topics: Option<i64>,
#[serde(rename = "OutputDataConfig")]
pub output_data_config: OutputDataConfig,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct StartTopicsDetectionJobResponse {
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct StopDominantLanguageDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct StopDominantLanguageDetectionJobResponse {
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct StopEntitiesDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct StopEntitiesDetectionJobResponse {
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct StopKeyPhrasesDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct StopKeyPhrasesDetectionJobResponse {
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct StopSentimentDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct StopSentimentDetectionJobResponse {
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct StopTrainingDocumentClassifierRequest {
#[serde(rename = "DocumentClassifierArn")]
pub document_classifier_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct StopTrainingDocumentClassifierResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct StopTrainingEntityRecognizerRequest {
#[serde(rename = "EntityRecognizerArn")]
pub entity_recognizer_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct StopTrainingEntityRecognizerResponse {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SyntaxToken {
#[serde(rename = "BeginOffset")]
#[serde(skip_serializing_if = "Option::is_none")]
pub begin_offset: Option<i64>,
#[serde(rename = "EndOffset")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_offset: Option<i64>,
#[serde(rename = "PartOfSpeech")]
#[serde(skip_serializing_if = "Option::is_none")]
pub part_of_speech: Option<PartOfSpeechTag>,
#[serde(rename = "Text")]
#[serde(skip_serializing_if = "Option::is_none")]
pub text: Option<String>,
#[serde(rename = "TokenId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub token_id: Option<i64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct Tag {
#[serde(rename = "Key")]
pub key: String,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct TagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "Tags")]
pub tags: Vec<Tag>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct TagResourceResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct TopicsDetectionJobFilter {
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
#[serde(rename = "SubmitTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_after: Option<f64>,
#[serde(rename = "SubmitTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time_before: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct TopicsDetectionJobProperties {
#[serde(rename = "DataAccessRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_access_role_arn: Option<String>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "InputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_data_config: Option<InputDataConfig>,
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_name: Option<String>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "NumberOfTopics")]
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_topics: Option<i64>,
#[serde(rename = "OutputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_data_config: Option<OutputDataConfig>,
#[serde(rename = "SubmitTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time: Option<f64>,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UntagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UntagResourceResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateEndpointRequest {
#[serde(rename = "DesiredInferenceUnits")]
pub desired_inference_units: i64,
#[serde(rename = "EndpointArn")]
pub endpoint_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateEndpointResponse {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct VpcConfig {
#[serde(rename = "SecurityGroupIds")]
pub security_group_ids: Vec<String>,
#[serde(rename = "Subnets")]
pub subnets: Vec<String>,
}
#[derive(Debug, PartialEq)]
pub enum BatchDetectDominantLanguageError {
BatchSizeLimitExceeded(String),
InternalServer(String),
InvalidRequest(String),
TextSizeLimitExceeded(String),
}
impl BatchDetectDominantLanguageError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<BatchDetectDominantLanguageError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"BatchSizeLimitExceededException" => {
return RusotoError::Service(
BatchDetectDominantLanguageError::BatchSizeLimitExceeded(err.msg),
)
}
"InternalServerException" => {
return RusotoError::Service(BatchDetectDominantLanguageError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(BatchDetectDominantLanguageError::InvalidRequest(
err.msg,
))
}
"TextSizeLimitExceededException" => {
return RusotoError::Service(
BatchDetectDominantLanguageError::TextSizeLimitExceeded(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for BatchDetectDominantLanguageError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
BatchDetectDominantLanguageError::BatchSizeLimitExceeded(ref cause) => {
write!(f, "{}", cause)
}
BatchDetectDominantLanguageError::InternalServer(ref cause) => write!(f, "{}", cause),
BatchDetectDominantLanguageError::InvalidRequest(ref cause) => write!(f, "{}", cause),
BatchDetectDominantLanguageError::TextSizeLimitExceeded(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for BatchDetectDominantLanguageError {}
#[derive(Debug, PartialEq)]
pub enum BatchDetectEntitiesError {
BatchSizeLimitExceeded(String),
InternalServer(String),
InvalidRequest(String),
TextSizeLimitExceeded(String),
UnsupportedLanguage(String),
}
impl BatchDetectEntitiesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchDetectEntitiesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"BatchSizeLimitExceededException" => {
return RusotoError::Service(BatchDetectEntitiesError::BatchSizeLimitExceeded(
err.msg,
))
}
"InternalServerException" => {
return RusotoError::Service(BatchDetectEntitiesError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(BatchDetectEntitiesError::InvalidRequest(err.msg))
}
"TextSizeLimitExceededException" => {
return RusotoError::Service(BatchDetectEntitiesError::TextSizeLimitExceeded(
err.msg,
))
}
"UnsupportedLanguageException" => {
return RusotoError::Service(BatchDetectEntitiesError::UnsupportedLanguage(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for BatchDetectEntitiesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
BatchDetectEntitiesError::BatchSizeLimitExceeded(ref cause) => write!(f, "{}", cause),
BatchDetectEntitiesError::InternalServer(ref cause) => write!(f, "{}", cause),
BatchDetectEntitiesError::InvalidRequest(ref cause) => write!(f, "{}", cause),
BatchDetectEntitiesError::TextSizeLimitExceeded(ref cause) => write!(f, "{}", cause),
BatchDetectEntitiesError::UnsupportedLanguage(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for BatchDetectEntitiesError {}
#[derive(Debug, PartialEq)]
pub enum BatchDetectKeyPhrasesError {
BatchSizeLimitExceeded(String),
InternalServer(String),
InvalidRequest(String),
TextSizeLimitExceeded(String),
UnsupportedLanguage(String),
}
impl BatchDetectKeyPhrasesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchDetectKeyPhrasesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"BatchSizeLimitExceededException" => {
return RusotoError::Service(
BatchDetectKeyPhrasesError::BatchSizeLimitExceeded(err.msg),
)
}
"InternalServerException" => {
return RusotoError::Service(BatchDetectKeyPhrasesError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(BatchDetectKeyPhrasesError::InvalidRequest(
err.msg,
))
}
"TextSizeLimitExceededException" => {
return RusotoError::Service(BatchDetectKeyPhrasesError::TextSizeLimitExceeded(
err.msg,
))
}
"UnsupportedLanguageException" => {
return RusotoError::Service(BatchDetectKeyPhrasesError::UnsupportedLanguage(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for BatchDetectKeyPhrasesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
BatchDetectKeyPhrasesError::BatchSizeLimitExceeded(ref cause) => write!(f, "{}", cause),
BatchDetectKeyPhrasesError::InternalServer(ref cause) => write!(f, "{}", cause),
BatchDetectKeyPhrasesError::InvalidRequest(ref cause) => write!(f, "{}", cause),
BatchDetectKeyPhrasesError::TextSizeLimitExceeded(ref cause) => write!(f, "{}", cause),
BatchDetectKeyPhrasesError::UnsupportedLanguage(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for BatchDetectKeyPhrasesError {}
#[derive(Debug, PartialEq)]
pub enum BatchDetectSentimentError {
BatchSizeLimitExceeded(String),
InternalServer(String),
InvalidRequest(String),
TextSizeLimitExceeded(String),
UnsupportedLanguage(String),
}
impl BatchDetectSentimentError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchDetectSentimentError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"BatchSizeLimitExceededException" => {
return RusotoError::Service(BatchDetectSentimentError::BatchSizeLimitExceeded(
err.msg,
))
}
"InternalServerException" => {
return RusotoError::Service(BatchDetectSentimentError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(BatchDetectSentimentError::InvalidRequest(err.msg))
}
"TextSizeLimitExceededException" => {
return RusotoError::Service(BatchDetectSentimentError::TextSizeLimitExceeded(
err.msg,
))
}
"UnsupportedLanguageException" => {
return RusotoError::Service(BatchDetectSentimentError::UnsupportedLanguage(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for BatchDetectSentimentError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
BatchDetectSentimentError::BatchSizeLimitExceeded(ref cause) => write!(f, "{}", cause),
BatchDetectSentimentError::InternalServer(ref cause) => write!(f, "{}", cause),
BatchDetectSentimentError::InvalidRequest(ref cause) => write!(f, "{}", cause),
BatchDetectSentimentError::TextSizeLimitExceeded(ref cause) => write!(f, "{}", cause),
BatchDetectSentimentError::UnsupportedLanguage(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for BatchDetectSentimentError {}
#[derive(Debug, PartialEq)]
pub enum BatchDetectSyntaxError {
BatchSizeLimitExceeded(String),
InternalServer(String),
InvalidRequest(String),
TextSizeLimitExceeded(String),
UnsupportedLanguage(String),
}
impl BatchDetectSyntaxError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchDetectSyntaxError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"BatchSizeLimitExceededException" => {
return RusotoError::Service(BatchDetectSyntaxError::BatchSizeLimitExceeded(
err.msg,
))
}
"InternalServerException" => {
return RusotoError::Service(BatchDetectSyntaxError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(BatchDetectSyntaxError::InvalidRequest(err.msg))
}
"TextSizeLimitExceededException" => {
return RusotoError::Service(BatchDetectSyntaxError::TextSizeLimitExceeded(
err.msg,
))
}
"UnsupportedLanguageException" => {
return RusotoError::Service(BatchDetectSyntaxError::UnsupportedLanguage(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for BatchDetectSyntaxError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
BatchDetectSyntaxError::BatchSizeLimitExceeded(ref cause) => write!(f, "{}", cause),
BatchDetectSyntaxError::InternalServer(ref cause) => write!(f, "{}", cause),
BatchDetectSyntaxError::InvalidRequest(ref cause) => write!(f, "{}", cause),
BatchDetectSyntaxError::TextSizeLimitExceeded(ref cause) => write!(f, "{}", cause),
BatchDetectSyntaxError::UnsupportedLanguage(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for BatchDetectSyntaxError {}
#[derive(Debug, PartialEq)]
pub enum ClassifyDocumentError {
InternalServer(String),
InvalidRequest(String),
ResourceUnavailable(String),
TextSizeLimitExceeded(String),
}
impl ClassifyDocumentError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ClassifyDocumentError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ClassifyDocumentError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(ClassifyDocumentError::InvalidRequest(err.msg))
}
"ResourceUnavailableException" => {
return RusotoError::Service(ClassifyDocumentError::ResourceUnavailable(
err.msg,
))
}
"TextSizeLimitExceededException" => {
return RusotoError::Service(ClassifyDocumentError::TextSizeLimitExceeded(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ClassifyDocumentError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ClassifyDocumentError::InternalServer(ref cause) => write!(f, "{}", cause),
ClassifyDocumentError::InvalidRequest(ref cause) => write!(f, "{}", cause),
ClassifyDocumentError::ResourceUnavailable(ref cause) => write!(f, "{}", cause),
ClassifyDocumentError::TextSizeLimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ClassifyDocumentError {}
#[derive(Debug, PartialEq)]
pub enum CreateDocumentClassifierError {
InternalServer(String),
InvalidRequest(String),
KmsKeyValidation(String),
ResourceInUse(String),
ResourceLimitExceeded(String),
TooManyRequests(String),
TooManyTags(String),
UnsupportedLanguage(String),
}
impl CreateDocumentClassifierError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateDocumentClassifierError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(CreateDocumentClassifierError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(CreateDocumentClassifierError::InvalidRequest(
err.msg,
))
}
"KmsKeyValidationException" => {
return RusotoError::Service(CreateDocumentClassifierError::KmsKeyValidation(
err.msg,
))
}
"ResourceInUseException" => {
return RusotoError::Service(CreateDocumentClassifierError::ResourceInUse(
err.msg,
))
}
"ResourceLimitExceededException" => {
return RusotoError::Service(
CreateDocumentClassifierError::ResourceLimitExceeded(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(CreateDocumentClassifierError::TooManyRequests(
err.msg,
))
}
"TooManyTagsException" => {
return RusotoError::Service(CreateDocumentClassifierError::TooManyTags(
err.msg,
))
}
"UnsupportedLanguageException" => {
return RusotoError::Service(
CreateDocumentClassifierError::UnsupportedLanguage(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateDocumentClassifierError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateDocumentClassifierError::InternalServer(ref cause) => write!(f, "{}", cause),
CreateDocumentClassifierError::InvalidRequest(ref cause) => write!(f, "{}", cause),
CreateDocumentClassifierError::KmsKeyValidation(ref cause) => write!(f, "{}", cause),
CreateDocumentClassifierError::ResourceInUse(ref cause) => write!(f, "{}", cause),
CreateDocumentClassifierError::ResourceLimitExceeded(ref cause) => {
write!(f, "{}", cause)
}
CreateDocumentClassifierError::TooManyRequests(ref cause) => write!(f, "{}", cause),
CreateDocumentClassifierError::TooManyTags(ref cause) => write!(f, "{}", cause),
CreateDocumentClassifierError::UnsupportedLanguage(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateDocumentClassifierError {}
#[derive(Debug, PartialEq)]
pub enum CreateEndpointError {
InternalServer(String),
InvalidRequest(String),
ResourceInUse(String),
ResourceLimitExceeded(String),
ResourceNotFound(String),
ResourceUnavailable(String),
TooManyRequests(String),
TooManyTags(String),
}
impl CreateEndpointError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateEndpointError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(CreateEndpointError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(CreateEndpointError::InvalidRequest(err.msg))
}
"ResourceInUseException" => {
return RusotoError::Service(CreateEndpointError::ResourceInUse(err.msg))
}
"ResourceLimitExceededException" => {
return RusotoError::Service(CreateEndpointError::ResourceLimitExceeded(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CreateEndpointError::ResourceNotFound(err.msg))
}
"ResourceUnavailableException" => {
return RusotoError::Service(CreateEndpointError::ResourceUnavailable(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(CreateEndpointError::TooManyRequests(err.msg))
}
"TooManyTagsException" => {
return RusotoError::Service(CreateEndpointError::TooManyTags(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateEndpointError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateEndpointError::InternalServer(ref cause) => write!(f, "{}", cause),
CreateEndpointError::InvalidRequest(ref cause) => write!(f, "{}", cause),
CreateEndpointError::ResourceInUse(ref cause) => write!(f, "{}", cause),
CreateEndpointError::ResourceLimitExceeded(ref cause) => write!(f, "{}", cause),
CreateEndpointError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
CreateEndpointError::ResourceUnavailable(ref cause) => write!(f, "{}", cause),
CreateEndpointError::TooManyRequests(ref cause) => write!(f, "{}", cause),
CreateEndpointError::TooManyTags(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateEndpointError {}
#[derive(Debug, PartialEq)]
pub enum CreateEntityRecognizerError {
InternalServer(String),
InvalidRequest(String),
KmsKeyValidation(String),
ResourceInUse(String),
ResourceLimitExceeded(String),
TooManyRequests(String),
TooManyTags(String),
UnsupportedLanguage(String),
}
impl CreateEntityRecognizerError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateEntityRecognizerError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(CreateEntityRecognizerError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(CreateEntityRecognizerError::InvalidRequest(
err.msg,
))
}
"KmsKeyValidationException" => {
return RusotoError::Service(CreateEntityRecognizerError::KmsKeyValidation(
err.msg,
))
}
"ResourceInUseException" => {
return RusotoError::Service(CreateEntityRecognizerError::ResourceInUse(
err.msg,
))
}
"ResourceLimitExceededException" => {
return RusotoError::Service(
CreateEntityRecognizerError::ResourceLimitExceeded(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(CreateEntityRecognizerError::TooManyRequests(
err.msg,
))
}
"TooManyTagsException" => {
return RusotoError::Service(CreateEntityRecognizerError::TooManyTags(err.msg))
}
"UnsupportedLanguageException" => {
return RusotoError::Service(CreateEntityRecognizerError::UnsupportedLanguage(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateEntityRecognizerError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateEntityRecognizerError::InternalServer(ref cause) => write!(f, "{}", cause),
CreateEntityRecognizerError::InvalidRequest(ref cause) => write!(f, "{}", cause),
CreateEntityRecognizerError::KmsKeyValidation(ref cause) => write!(f, "{}", cause),
CreateEntityRecognizerError::ResourceInUse(ref cause) => write!(f, "{}", cause),
CreateEntityRecognizerError::ResourceLimitExceeded(ref cause) => write!(f, "{}", cause),
CreateEntityRecognizerError::TooManyRequests(ref cause) => write!(f, "{}", cause),
CreateEntityRecognizerError::TooManyTags(ref cause) => write!(f, "{}", cause),
CreateEntityRecognizerError::UnsupportedLanguage(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateEntityRecognizerError {}
#[derive(Debug, PartialEq)]
pub enum DeleteDocumentClassifierError {
InternalServer(String),
InvalidRequest(String),
ResourceInUse(String),
ResourceNotFound(String),
ResourceUnavailable(String),
TooManyRequests(String),
}
impl DeleteDocumentClassifierError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDocumentClassifierError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DeleteDocumentClassifierError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(DeleteDocumentClassifierError::InvalidRequest(
err.msg,
))
}
"ResourceInUseException" => {
return RusotoError::Service(DeleteDocumentClassifierError::ResourceInUse(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteDocumentClassifierError::ResourceNotFound(
err.msg,
))
}
"ResourceUnavailableException" => {
return RusotoError::Service(
DeleteDocumentClassifierError::ResourceUnavailable(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(DeleteDocumentClassifierError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteDocumentClassifierError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteDocumentClassifierError::InternalServer(ref cause) => write!(f, "{}", cause),
DeleteDocumentClassifierError::InvalidRequest(ref cause) => write!(f, "{}", cause),
DeleteDocumentClassifierError::ResourceInUse(ref cause) => write!(f, "{}", cause),
DeleteDocumentClassifierError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DeleteDocumentClassifierError::ResourceUnavailable(ref cause) => write!(f, "{}", cause),
DeleteDocumentClassifierError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteDocumentClassifierError {}
#[derive(Debug, PartialEq)]
pub enum DeleteEndpointError {
InternalServer(String),
InvalidRequest(String),
ResourceInUse(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl DeleteEndpointError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteEndpointError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DeleteEndpointError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(DeleteEndpointError::InvalidRequest(err.msg))
}
"ResourceInUseException" => {
return RusotoError::Service(DeleteEndpointError::ResourceInUse(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteEndpointError::ResourceNotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(DeleteEndpointError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteEndpointError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteEndpointError::InternalServer(ref cause) => write!(f, "{}", cause),
DeleteEndpointError::InvalidRequest(ref cause) => write!(f, "{}", cause),
DeleteEndpointError::ResourceInUse(ref cause) => write!(f, "{}", cause),
DeleteEndpointError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DeleteEndpointError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteEndpointError {}
#[derive(Debug, PartialEq)]
pub enum DeleteEntityRecognizerError {
InternalServer(String),
InvalidRequest(String),
ResourceInUse(String),
ResourceNotFound(String),
ResourceUnavailable(String),
TooManyRequests(String),
}
impl DeleteEntityRecognizerError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteEntityRecognizerError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DeleteEntityRecognizerError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(DeleteEntityRecognizerError::InvalidRequest(
err.msg,
))
}
"ResourceInUseException" => {
return RusotoError::Service(DeleteEntityRecognizerError::ResourceInUse(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteEntityRecognizerError::ResourceNotFound(
err.msg,
))
}
"ResourceUnavailableException" => {
return RusotoError::Service(DeleteEntityRecognizerError::ResourceUnavailable(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(DeleteEntityRecognizerError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteEntityRecognizerError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteEntityRecognizerError::InternalServer(ref cause) => write!(f, "{}", cause),
DeleteEntityRecognizerError::InvalidRequest(ref cause) => write!(f, "{}", cause),
DeleteEntityRecognizerError::ResourceInUse(ref cause) => write!(f, "{}", cause),
DeleteEntityRecognizerError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DeleteEntityRecognizerError::ResourceUnavailable(ref cause) => write!(f, "{}", cause),
DeleteEntityRecognizerError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteEntityRecognizerError {}
#[derive(Debug, PartialEq)]
pub enum DescribeDocumentClassificationJobError {
InternalServer(String),
InvalidRequest(String),
JobNotFound(String),
TooManyRequests(String),
}
impl DescribeDocumentClassificationJobError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeDocumentClassificationJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(
DescribeDocumentClassificationJobError::InternalServer(err.msg),
)
}
"InvalidRequestException" => {
return RusotoError::Service(
DescribeDocumentClassificationJobError::InvalidRequest(err.msg),
)
}
"JobNotFoundException" => {
return RusotoError::Service(
DescribeDocumentClassificationJobError::JobNotFound(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(
DescribeDocumentClassificationJobError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeDocumentClassificationJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeDocumentClassificationJobError::InternalServer(ref cause) => {
write!(f, "{}", cause)
}
DescribeDocumentClassificationJobError::InvalidRequest(ref cause) => {
write!(f, "{}", cause)
}
DescribeDocumentClassificationJobError::JobNotFound(ref cause) => {
write!(f, "{}", cause)
}
DescribeDocumentClassificationJobError::TooManyRequests(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DescribeDocumentClassificationJobError {}
#[derive(Debug, PartialEq)]
pub enum DescribeDocumentClassifierError {
InternalServer(String),
InvalidRequest(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl DescribeDocumentClassifierError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeDocumentClassifierError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DescribeDocumentClassifierError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(DescribeDocumentClassifierError::InvalidRequest(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeDocumentClassifierError::ResourceNotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(DescribeDocumentClassifierError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeDocumentClassifierError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeDocumentClassifierError::InternalServer(ref cause) => write!(f, "{}", cause),
DescribeDocumentClassifierError::InvalidRequest(ref cause) => write!(f, "{}", cause),
DescribeDocumentClassifierError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DescribeDocumentClassifierError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeDocumentClassifierError {}
#[derive(Debug, PartialEq)]
pub enum DescribeDominantLanguageDetectionJobError {
InternalServer(String),
InvalidRequest(String),
JobNotFound(String),
TooManyRequests(String),
}
impl DescribeDominantLanguageDetectionJobError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeDominantLanguageDetectionJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(
DescribeDominantLanguageDetectionJobError::InternalServer(err.msg),
)
}
"InvalidRequestException" => {
return RusotoError::Service(
DescribeDominantLanguageDetectionJobError::InvalidRequest(err.msg),
)
}
"JobNotFoundException" => {
return RusotoError::Service(
DescribeDominantLanguageDetectionJobError::JobNotFound(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(
DescribeDominantLanguageDetectionJobError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeDominantLanguageDetectionJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeDominantLanguageDetectionJobError::InternalServer(ref cause) => {
write!(f, "{}", cause)
}
DescribeDominantLanguageDetectionJobError::InvalidRequest(ref cause) => {
write!(f, "{}", cause)
}
DescribeDominantLanguageDetectionJobError::JobNotFound(ref cause) => {
write!(f, "{}", cause)
}
DescribeDominantLanguageDetectionJobError::TooManyRequests(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DescribeDominantLanguageDetectionJobError {}
#[derive(Debug, PartialEq)]
pub enum DescribeEndpointError {
InternalServer(String),
InvalidRequest(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl DescribeEndpointError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeEndpointError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DescribeEndpointError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(DescribeEndpointError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeEndpointError::ResourceNotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(DescribeEndpointError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeEndpointError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeEndpointError::InternalServer(ref cause) => write!(f, "{}", cause),
DescribeEndpointError::InvalidRequest(ref cause) => write!(f, "{}", cause),
DescribeEndpointError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DescribeEndpointError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeEndpointError {}
#[derive(Debug, PartialEq)]
pub enum DescribeEntitiesDetectionJobError {
InternalServer(String),
InvalidRequest(String),
JobNotFound(String),
TooManyRequests(String),
}
impl DescribeEntitiesDetectionJobError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeEntitiesDetectionJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DescribeEntitiesDetectionJobError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(DescribeEntitiesDetectionJobError::InvalidRequest(
err.msg,
))
}
"JobNotFoundException" => {
return RusotoError::Service(DescribeEntitiesDetectionJobError::JobNotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(
DescribeEntitiesDetectionJobError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeEntitiesDetectionJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeEntitiesDetectionJobError::InternalServer(ref cause) => write!(f, "{}", cause),
DescribeEntitiesDetectionJobError::InvalidRequest(ref cause) => write!(f, "{}", cause),
DescribeEntitiesDetectionJobError::JobNotFound(ref cause) => write!(f, "{}", cause),
DescribeEntitiesDetectionJobError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeEntitiesDetectionJobError {}
#[derive(Debug, PartialEq)]
pub enum DescribeEntityRecognizerError {
InternalServer(String),
InvalidRequest(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl DescribeEntityRecognizerError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeEntityRecognizerError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DescribeEntityRecognizerError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(DescribeEntityRecognizerError::InvalidRequest(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeEntityRecognizerError::ResourceNotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(DescribeEntityRecognizerError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeEntityRecognizerError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeEntityRecognizerError::InternalServer(ref cause) => write!(f, "{}", cause),
DescribeEntityRecognizerError::InvalidRequest(ref cause) => write!(f, "{}", cause),
DescribeEntityRecognizerError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DescribeEntityRecognizerError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeEntityRecognizerError {}
#[derive(Debug, PartialEq)]
pub enum DescribeKeyPhrasesDetectionJobError {
InternalServer(String),
InvalidRequest(String),
JobNotFound(String),
TooManyRequests(String),
}
impl DescribeKeyPhrasesDetectionJobError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeKeyPhrasesDetectionJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(
DescribeKeyPhrasesDetectionJobError::InternalServer(err.msg),
)
}
"InvalidRequestException" => {
return RusotoError::Service(
DescribeKeyPhrasesDetectionJobError::InvalidRequest(err.msg),
)
}
"JobNotFoundException" => {
return RusotoError::Service(DescribeKeyPhrasesDetectionJobError::JobNotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(
DescribeKeyPhrasesDetectionJobError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeKeyPhrasesDetectionJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeKeyPhrasesDetectionJobError::InternalServer(ref cause) => {
write!(f, "{}", cause)
}
DescribeKeyPhrasesDetectionJobError::InvalidRequest(ref cause) => {
write!(f, "{}", cause)
}
DescribeKeyPhrasesDetectionJobError::JobNotFound(ref cause) => write!(f, "{}", cause),
DescribeKeyPhrasesDetectionJobError::TooManyRequests(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DescribeKeyPhrasesDetectionJobError {}
#[derive(Debug, PartialEq)]
pub enum DescribeSentimentDetectionJobError {
InternalServer(String),
InvalidRequest(String),
JobNotFound(String),
TooManyRequests(String),
}
impl DescribeSentimentDetectionJobError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeSentimentDetectionJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(
DescribeSentimentDetectionJobError::InternalServer(err.msg),
)
}
"InvalidRequestException" => {
return RusotoError::Service(
DescribeSentimentDetectionJobError::InvalidRequest(err.msg),
)
}
"JobNotFoundException" => {
return RusotoError::Service(DescribeSentimentDetectionJobError::JobNotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(
DescribeSentimentDetectionJobError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeSentimentDetectionJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeSentimentDetectionJobError::InternalServer(ref cause) => write!(f, "{}", cause),
DescribeSentimentDetectionJobError::InvalidRequest(ref cause) => write!(f, "{}", cause),
DescribeSentimentDetectionJobError::JobNotFound(ref cause) => write!(f, "{}", cause),
DescribeSentimentDetectionJobError::TooManyRequests(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DescribeSentimentDetectionJobError {}
#[derive(Debug, PartialEq)]
pub enum DescribeTopicsDetectionJobError {
InternalServer(String),
InvalidRequest(String),
JobNotFound(String),
TooManyRequests(String),
}
impl DescribeTopicsDetectionJobError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeTopicsDetectionJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DescribeTopicsDetectionJobError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(DescribeTopicsDetectionJobError::InvalidRequest(
err.msg,
))
}
"JobNotFoundException" => {
return RusotoError::Service(DescribeTopicsDetectionJobError::JobNotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(DescribeTopicsDetectionJobError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeTopicsDetectionJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeTopicsDetectionJobError::InternalServer(ref cause) => write!(f, "{}", cause),
DescribeTopicsDetectionJobError::InvalidRequest(ref cause) => write!(f, "{}", cause),
DescribeTopicsDetectionJobError::JobNotFound(ref cause) => write!(f, "{}", cause),
DescribeTopicsDetectionJobError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeTopicsDetectionJobError {}
#[derive(Debug, PartialEq)]
pub enum DetectDominantLanguageError {
InternalServer(String),
InvalidRequest(String),
TextSizeLimitExceeded(String),
}
impl DetectDominantLanguageError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DetectDominantLanguageError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DetectDominantLanguageError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(DetectDominantLanguageError::InvalidRequest(
err.msg,
))
}
"TextSizeLimitExceededException" => {
return RusotoError::Service(
DetectDominantLanguageError::TextSizeLimitExceeded(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DetectDominantLanguageError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DetectDominantLanguageError::InternalServer(ref cause) => write!(f, "{}", cause),
DetectDominantLanguageError::InvalidRequest(ref cause) => write!(f, "{}", cause),
DetectDominantLanguageError::TextSizeLimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DetectDominantLanguageError {}
#[derive(Debug, PartialEq)]
pub enum DetectEntitiesError {
InternalServer(String),
InvalidRequest(String),
ResourceUnavailable(String),
TextSizeLimitExceeded(String),
UnsupportedLanguage(String),
}
impl DetectEntitiesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DetectEntitiesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DetectEntitiesError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(DetectEntitiesError::InvalidRequest(err.msg))
}
"ResourceUnavailableException" => {
return RusotoError::Service(DetectEntitiesError::ResourceUnavailable(err.msg))
}
"TextSizeLimitExceededException" => {
return RusotoError::Service(DetectEntitiesError::TextSizeLimitExceeded(
err.msg,
))
}
"UnsupportedLanguageException" => {
return RusotoError::Service(DetectEntitiesError::UnsupportedLanguage(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DetectEntitiesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DetectEntitiesError::InternalServer(ref cause) => write!(f, "{}", cause),
DetectEntitiesError::InvalidRequest(ref cause) => write!(f, "{}", cause),
DetectEntitiesError::ResourceUnavailable(ref cause) => write!(f, "{}", cause),
DetectEntitiesError::TextSizeLimitExceeded(ref cause) => write!(f, "{}", cause),
DetectEntitiesError::UnsupportedLanguage(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DetectEntitiesError {}
#[derive(Debug, PartialEq)]
pub enum DetectKeyPhrasesError {
InternalServer(String),
InvalidRequest(String),
TextSizeLimitExceeded(String),
UnsupportedLanguage(String),
}
impl DetectKeyPhrasesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DetectKeyPhrasesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DetectKeyPhrasesError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(DetectKeyPhrasesError::InvalidRequest(err.msg))
}
"TextSizeLimitExceededException" => {
return RusotoError::Service(DetectKeyPhrasesError::TextSizeLimitExceeded(
err.msg,
))
}
"UnsupportedLanguageException" => {
return RusotoError::Service(DetectKeyPhrasesError::UnsupportedLanguage(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DetectKeyPhrasesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DetectKeyPhrasesError::InternalServer(ref cause) => write!(f, "{}", cause),
DetectKeyPhrasesError::InvalidRequest(ref cause) => write!(f, "{}", cause),
DetectKeyPhrasesError::TextSizeLimitExceeded(ref cause) => write!(f, "{}", cause),
DetectKeyPhrasesError::UnsupportedLanguage(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DetectKeyPhrasesError {}
#[derive(Debug, PartialEq)]
pub enum DetectSentimentError {
InternalServer(String),
InvalidRequest(String),
TextSizeLimitExceeded(String),
UnsupportedLanguage(String),
}
impl DetectSentimentError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DetectSentimentError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DetectSentimentError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(DetectSentimentError::InvalidRequest(err.msg))
}
"TextSizeLimitExceededException" => {
return RusotoError::Service(DetectSentimentError::TextSizeLimitExceeded(
err.msg,
))
}
"UnsupportedLanguageException" => {
return RusotoError::Service(DetectSentimentError::UnsupportedLanguage(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DetectSentimentError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DetectSentimentError::InternalServer(ref cause) => write!(f, "{}", cause),
DetectSentimentError::InvalidRequest(ref cause) => write!(f, "{}", cause),
DetectSentimentError::TextSizeLimitExceeded(ref cause) => write!(f, "{}", cause),
DetectSentimentError::UnsupportedLanguage(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DetectSentimentError {}
#[derive(Debug, PartialEq)]
pub enum DetectSyntaxError {
InternalServer(String),
InvalidRequest(String),
TextSizeLimitExceeded(String),
UnsupportedLanguage(String),
}
impl DetectSyntaxError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DetectSyntaxError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DetectSyntaxError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(DetectSyntaxError::InvalidRequest(err.msg))
}
"TextSizeLimitExceededException" => {
return RusotoError::Service(DetectSyntaxError::TextSizeLimitExceeded(err.msg))
}
"UnsupportedLanguageException" => {
return RusotoError::Service(DetectSyntaxError::UnsupportedLanguage(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DetectSyntaxError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DetectSyntaxError::InternalServer(ref cause) => write!(f, "{}", cause),
DetectSyntaxError::InvalidRequest(ref cause) => write!(f, "{}", cause),
DetectSyntaxError::TextSizeLimitExceeded(ref cause) => write!(f, "{}", cause),
DetectSyntaxError::UnsupportedLanguage(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DetectSyntaxError {}
#[derive(Debug, PartialEq)]
pub enum ListDocumentClassificationJobsError {
InternalServer(String),
InvalidFilter(String),
InvalidRequest(String),
TooManyRequests(String),
}
impl ListDocumentClassificationJobsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListDocumentClassificationJobsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(
ListDocumentClassificationJobsError::InternalServer(err.msg),
)
}
"InvalidFilterException" => {
return RusotoError::Service(
ListDocumentClassificationJobsError::InvalidFilter(err.msg),
)
}
"InvalidRequestException" => {
return RusotoError::Service(
ListDocumentClassificationJobsError::InvalidRequest(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(
ListDocumentClassificationJobsError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListDocumentClassificationJobsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListDocumentClassificationJobsError::InternalServer(ref cause) => {
write!(f, "{}", cause)
}
ListDocumentClassificationJobsError::InvalidFilter(ref cause) => write!(f, "{}", cause),
ListDocumentClassificationJobsError::InvalidRequest(ref cause) => {
write!(f, "{}", cause)
}
ListDocumentClassificationJobsError::TooManyRequests(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for ListDocumentClassificationJobsError {}
#[derive(Debug, PartialEq)]
pub enum ListDocumentClassifiersError {
InternalServer(String),
InvalidFilter(String),
InvalidRequest(String),
TooManyRequests(String),
}
impl ListDocumentClassifiersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListDocumentClassifiersError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListDocumentClassifiersError::InternalServer(
err.msg,
))
}
"InvalidFilterException" => {
return RusotoError::Service(ListDocumentClassifiersError::InvalidFilter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(ListDocumentClassifiersError::InvalidRequest(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListDocumentClassifiersError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListDocumentClassifiersError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListDocumentClassifiersError::InternalServer(ref cause) => write!(f, "{}", cause),
ListDocumentClassifiersError::InvalidFilter(ref cause) => write!(f, "{}", cause),
ListDocumentClassifiersError::InvalidRequest(ref cause) => write!(f, "{}", cause),
ListDocumentClassifiersError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListDocumentClassifiersError {}
#[derive(Debug, PartialEq)]
pub enum ListDominantLanguageDetectionJobsError {
InternalServer(String),
InvalidFilter(String),
InvalidRequest(String),
TooManyRequests(String),
}
impl ListDominantLanguageDetectionJobsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListDominantLanguageDetectionJobsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(
ListDominantLanguageDetectionJobsError::InternalServer(err.msg),
)
}
"InvalidFilterException" => {
return RusotoError::Service(
ListDominantLanguageDetectionJobsError::InvalidFilter(err.msg),
)
}
"InvalidRequestException" => {
return RusotoError::Service(
ListDominantLanguageDetectionJobsError::InvalidRequest(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(
ListDominantLanguageDetectionJobsError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListDominantLanguageDetectionJobsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListDominantLanguageDetectionJobsError::InternalServer(ref cause) => {
write!(f, "{}", cause)
}
ListDominantLanguageDetectionJobsError::InvalidFilter(ref cause) => {
write!(f, "{}", cause)
}
ListDominantLanguageDetectionJobsError::InvalidRequest(ref cause) => {
write!(f, "{}", cause)
}
ListDominantLanguageDetectionJobsError::TooManyRequests(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for ListDominantLanguageDetectionJobsError {}
#[derive(Debug, PartialEq)]
pub enum ListEndpointsError {
InternalServer(String),
InvalidRequest(String),
TooManyRequests(String),
}
impl ListEndpointsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListEndpointsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListEndpointsError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(ListEndpointsError::InvalidRequest(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListEndpointsError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListEndpointsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListEndpointsError::InternalServer(ref cause) => write!(f, "{}", cause),
ListEndpointsError::InvalidRequest(ref cause) => write!(f, "{}", cause),
ListEndpointsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListEndpointsError {}
#[derive(Debug, PartialEq)]
pub enum ListEntitiesDetectionJobsError {
InternalServer(String),
InvalidFilter(String),
InvalidRequest(String),
TooManyRequests(String),
}
impl ListEntitiesDetectionJobsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListEntitiesDetectionJobsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListEntitiesDetectionJobsError::InternalServer(
err.msg,
))
}
"InvalidFilterException" => {
return RusotoError::Service(ListEntitiesDetectionJobsError::InvalidFilter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(ListEntitiesDetectionJobsError::InvalidRequest(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListEntitiesDetectionJobsError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListEntitiesDetectionJobsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListEntitiesDetectionJobsError::InternalServer(ref cause) => write!(f, "{}", cause),
ListEntitiesDetectionJobsError::InvalidFilter(ref cause) => write!(f, "{}", cause),
ListEntitiesDetectionJobsError::InvalidRequest(ref cause) => write!(f, "{}", cause),
ListEntitiesDetectionJobsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListEntitiesDetectionJobsError {}
#[derive(Debug, PartialEq)]
pub enum ListEntityRecognizersError {
InternalServer(String),
InvalidFilter(String),
InvalidRequest(String),
TooManyRequests(String),
}
impl ListEntityRecognizersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListEntityRecognizersError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListEntityRecognizersError::InternalServer(
err.msg,
))
}
"InvalidFilterException" => {
return RusotoError::Service(ListEntityRecognizersError::InvalidFilter(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(ListEntityRecognizersError::InvalidRequest(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListEntityRecognizersError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListEntityRecognizersError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListEntityRecognizersError::InternalServer(ref cause) => write!(f, "{}", cause),
ListEntityRecognizersError::InvalidFilter(ref cause) => write!(f, "{}", cause),
ListEntityRecognizersError::InvalidRequest(ref cause) => write!(f, "{}", cause),
ListEntityRecognizersError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListEntityRecognizersError {}
#[derive(Debug, PartialEq)]
pub enum ListKeyPhrasesDetectionJobsError {
InternalServer(String),
InvalidFilter(String),
InvalidRequest(String),
TooManyRequests(String),
}
impl ListKeyPhrasesDetectionJobsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListKeyPhrasesDetectionJobsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListKeyPhrasesDetectionJobsError::InternalServer(
err.msg,
))
}
"InvalidFilterException" => {
return RusotoError::Service(ListKeyPhrasesDetectionJobsError::InvalidFilter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(ListKeyPhrasesDetectionJobsError::InvalidRequest(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListKeyPhrasesDetectionJobsError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListKeyPhrasesDetectionJobsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListKeyPhrasesDetectionJobsError::InternalServer(ref cause) => write!(f, "{}", cause),
ListKeyPhrasesDetectionJobsError::InvalidFilter(ref cause) => write!(f, "{}", cause),
ListKeyPhrasesDetectionJobsError::InvalidRequest(ref cause) => write!(f, "{}", cause),
ListKeyPhrasesDetectionJobsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListKeyPhrasesDetectionJobsError {}
#[derive(Debug, PartialEq)]
pub enum ListSentimentDetectionJobsError {
InternalServer(String),
InvalidFilter(String),
InvalidRequest(String),
TooManyRequests(String),
}
impl ListSentimentDetectionJobsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListSentimentDetectionJobsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListSentimentDetectionJobsError::InternalServer(
err.msg,
))
}
"InvalidFilterException" => {
return RusotoError::Service(ListSentimentDetectionJobsError::InvalidFilter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(ListSentimentDetectionJobsError::InvalidRequest(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListSentimentDetectionJobsError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListSentimentDetectionJobsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListSentimentDetectionJobsError::InternalServer(ref cause) => write!(f, "{}", cause),
ListSentimentDetectionJobsError::InvalidFilter(ref cause) => write!(f, "{}", cause),
ListSentimentDetectionJobsError::InvalidRequest(ref cause) => write!(f, "{}", cause),
ListSentimentDetectionJobsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListSentimentDetectionJobsError {}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {
InternalServer(String),
InvalidRequest(String),
ResourceNotFound(String),
}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListTagsForResourceError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(ListTagsForResourceError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListTagsForResourceError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListTagsForResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListTagsForResourceError::InternalServer(ref cause) => write!(f, "{}", cause),
ListTagsForResourceError::InvalidRequest(ref cause) => write!(f, "{}", cause),
ListTagsForResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListTagsForResourceError {}
#[derive(Debug, PartialEq)]
pub enum ListTopicsDetectionJobsError {
InternalServer(String),
InvalidFilter(String),
InvalidRequest(String),
TooManyRequests(String),
}
impl ListTopicsDetectionJobsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTopicsDetectionJobsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListTopicsDetectionJobsError::InternalServer(
err.msg,
))
}
"InvalidFilterException" => {
return RusotoError::Service(ListTopicsDetectionJobsError::InvalidFilter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(ListTopicsDetectionJobsError::InvalidRequest(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListTopicsDetectionJobsError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListTopicsDetectionJobsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListTopicsDetectionJobsError::InternalServer(ref cause) => write!(f, "{}", cause),
ListTopicsDetectionJobsError::InvalidFilter(ref cause) => write!(f, "{}", cause),
ListTopicsDetectionJobsError::InvalidRequest(ref cause) => write!(f, "{}", cause),
ListTopicsDetectionJobsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListTopicsDetectionJobsError {}
#[derive(Debug, PartialEq)]
pub enum StartDocumentClassificationJobError {
InternalServer(String),
InvalidRequest(String),
KmsKeyValidation(String),
ResourceNotFound(String),
ResourceUnavailable(String),
TooManyRequests(String),
}
impl StartDocumentClassificationJobError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<StartDocumentClassificationJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(
StartDocumentClassificationJobError::InternalServer(err.msg),
)
}
"InvalidRequestException" => {
return RusotoError::Service(
StartDocumentClassificationJobError::InvalidRequest(err.msg),
)
}
"KmsKeyValidationException" => {
return RusotoError::Service(
StartDocumentClassificationJobError::KmsKeyValidation(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
StartDocumentClassificationJobError::ResourceNotFound(err.msg),
)
}
"ResourceUnavailableException" => {
return RusotoError::Service(
StartDocumentClassificationJobError::ResourceUnavailable(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(
StartDocumentClassificationJobError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for StartDocumentClassificationJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
StartDocumentClassificationJobError::InternalServer(ref cause) => {
write!(f, "{}", cause)
}
StartDocumentClassificationJobError::InvalidRequest(ref cause) => {
write!(f, "{}", cause)
}
StartDocumentClassificationJobError::KmsKeyValidation(ref cause) => {
write!(f, "{}", cause)
}
StartDocumentClassificationJobError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
StartDocumentClassificationJobError::ResourceUnavailable(ref cause) => {
write!(f, "{}", cause)
}
StartDocumentClassificationJobError::TooManyRequests(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for StartDocumentClassificationJobError {}
#[derive(Debug, PartialEq)]
pub enum StartDominantLanguageDetectionJobError {
InternalServer(String),
InvalidRequest(String),
KmsKeyValidation(String),
TooManyRequests(String),
}
impl StartDominantLanguageDetectionJobError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<StartDominantLanguageDetectionJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(
StartDominantLanguageDetectionJobError::InternalServer(err.msg),
)
}
"InvalidRequestException" => {
return RusotoError::Service(
StartDominantLanguageDetectionJobError::InvalidRequest(err.msg),
)
}
"KmsKeyValidationException" => {
return RusotoError::Service(
StartDominantLanguageDetectionJobError::KmsKeyValidation(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(
StartDominantLanguageDetectionJobError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for StartDominantLanguageDetectionJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
StartDominantLanguageDetectionJobError::InternalServer(ref cause) => {
write!(f, "{}", cause)
}
StartDominantLanguageDetectionJobError::InvalidRequest(ref cause) => {
write!(f, "{}", cause)
}
StartDominantLanguageDetectionJobError::KmsKeyValidation(ref cause) => {
write!(f, "{}", cause)
}
StartDominantLanguageDetectionJobError::TooManyRequests(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for StartDominantLanguageDetectionJobError {}
#[derive(Debug, PartialEq)]
pub enum StartEntitiesDetectionJobError {
InternalServer(String),
InvalidRequest(String),
KmsKeyValidation(String),
ResourceNotFound(String),
ResourceUnavailable(String),
TooManyRequests(String),
}
impl StartEntitiesDetectionJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartEntitiesDetectionJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(StartEntitiesDetectionJobError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(StartEntitiesDetectionJobError::InvalidRequest(
err.msg,
))
}
"KmsKeyValidationException" => {
return RusotoError::Service(StartEntitiesDetectionJobError::KmsKeyValidation(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(StartEntitiesDetectionJobError::ResourceNotFound(
err.msg,
))
}
"ResourceUnavailableException" => {
return RusotoError::Service(
StartEntitiesDetectionJobError::ResourceUnavailable(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(StartEntitiesDetectionJobError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for StartEntitiesDetectionJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
StartEntitiesDetectionJobError::InternalServer(ref cause) => write!(f, "{}", cause),
StartEntitiesDetectionJobError::InvalidRequest(ref cause) => write!(f, "{}", cause),
StartEntitiesDetectionJobError::KmsKeyValidation(ref cause) => write!(f, "{}", cause),
StartEntitiesDetectionJobError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
StartEntitiesDetectionJobError::ResourceUnavailable(ref cause) => {
write!(f, "{}", cause)
}
StartEntitiesDetectionJobError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for StartEntitiesDetectionJobError {}
#[derive(Debug, PartialEq)]
pub enum StartKeyPhrasesDetectionJobError {
InternalServer(String),
InvalidRequest(String),
KmsKeyValidation(String),
TooManyRequests(String),
}
impl StartKeyPhrasesDetectionJobError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<StartKeyPhrasesDetectionJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(StartKeyPhrasesDetectionJobError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(StartKeyPhrasesDetectionJobError::InvalidRequest(
err.msg,
))
}
"KmsKeyValidationException" => {
return RusotoError::Service(
StartKeyPhrasesDetectionJobError::KmsKeyValidation(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(StartKeyPhrasesDetectionJobError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for StartKeyPhrasesDetectionJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
StartKeyPhrasesDetectionJobError::InternalServer(ref cause) => write!(f, "{}", cause),
StartKeyPhrasesDetectionJobError::InvalidRequest(ref cause) => write!(f, "{}", cause),
StartKeyPhrasesDetectionJobError::KmsKeyValidation(ref cause) => write!(f, "{}", cause),
StartKeyPhrasesDetectionJobError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for StartKeyPhrasesDetectionJobError {}
#[derive(Debug, PartialEq)]
pub enum StartSentimentDetectionJobError {
InternalServer(String),
InvalidRequest(String),
KmsKeyValidation(String),
TooManyRequests(String),
}
impl StartSentimentDetectionJobError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<StartSentimentDetectionJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(StartSentimentDetectionJobError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(StartSentimentDetectionJobError::InvalidRequest(
err.msg,
))
}
"KmsKeyValidationException" => {
return RusotoError::Service(StartSentimentDetectionJobError::KmsKeyValidation(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(StartSentimentDetectionJobError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for StartSentimentDetectionJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
StartSentimentDetectionJobError::InternalServer(ref cause) => write!(f, "{}", cause),
StartSentimentDetectionJobError::InvalidRequest(ref cause) => write!(f, "{}", cause),
StartSentimentDetectionJobError::KmsKeyValidation(ref cause) => write!(f, "{}", cause),
StartSentimentDetectionJobError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for StartSentimentDetectionJobError {}
#[derive(Debug, PartialEq)]
pub enum StartTopicsDetectionJobError {
InternalServer(String),
InvalidRequest(String),
KmsKeyValidation(String),
TooManyRequests(String),
}
impl StartTopicsDetectionJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartTopicsDetectionJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(StartTopicsDetectionJobError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(StartTopicsDetectionJobError::InvalidRequest(
err.msg,
))
}
"KmsKeyValidationException" => {
return RusotoError::Service(StartTopicsDetectionJobError::KmsKeyValidation(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(StartTopicsDetectionJobError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for StartTopicsDetectionJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
StartTopicsDetectionJobError::InternalServer(ref cause) => write!(f, "{}", cause),
StartTopicsDetectionJobError::InvalidRequest(ref cause) => write!(f, "{}", cause),
StartTopicsDetectionJobError::KmsKeyValidation(ref cause) => write!(f, "{}", cause),
StartTopicsDetectionJobError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for StartTopicsDetectionJobError {}
#[derive(Debug, PartialEq)]
pub enum StopDominantLanguageDetectionJobError {
InternalServer(String),
InvalidRequest(String),
JobNotFound(String),
}
impl StopDominantLanguageDetectionJobError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<StopDominantLanguageDetectionJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(
StopDominantLanguageDetectionJobError::InternalServer(err.msg),
)
}
"InvalidRequestException" => {
return RusotoError::Service(
StopDominantLanguageDetectionJobError::InvalidRequest(err.msg),
)
}
"JobNotFoundException" => {
return RusotoError::Service(
StopDominantLanguageDetectionJobError::JobNotFound(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for StopDominantLanguageDetectionJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
StopDominantLanguageDetectionJobError::InternalServer(ref cause) => {
write!(f, "{}", cause)
}
StopDominantLanguageDetectionJobError::InvalidRequest(ref cause) => {
write!(f, "{}", cause)
}
StopDominantLanguageDetectionJobError::JobNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for StopDominantLanguageDetectionJobError {}
#[derive(Debug, PartialEq)]
pub enum StopEntitiesDetectionJobError {
InternalServer(String),
InvalidRequest(String),
JobNotFound(String),
}
impl StopEntitiesDetectionJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StopEntitiesDetectionJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(StopEntitiesDetectionJobError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(StopEntitiesDetectionJobError::InvalidRequest(
err.msg,
))
}
"JobNotFoundException" => {
return RusotoError::Service(StopEntitiesDetectionJobError::JobNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for StopEntitiesDetectionJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
StopEntitiesDetectionJobError::InternalServer(ref cause) => write!(f, "{}", cause),
StopEntitiesDetectionJobError::InvalidRequest(ref cause) => write!(f, "{}", cause),
StopEntitiesDetectionJobError::JobNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for StopEntitiesDetectionJobError {}
#[derive(Debug, PartialEq)]
pub enum StopKeyPhrasesDetectionJobError {
InternalServer(String),
InvalidRequest(String),
JobNotFound(String),
}
impl StopKeyPhrasesDetectionJobError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<StopKeyPhrasesDetectionJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(StopKeyPhrasesDetectionJobError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(StopKeyPhrasesDetectionJobError::InvalidRequest(
err.msg,
))
}
"JobNotFoundException" => {
return RusotoError::Service(StopKeyPhrasesDetectionJobError::JobNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for StopKeyPhrasesDetectionJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
StopKeyPhrasesDetectionJobError::InternalServer(ref cause) => write!(f, "{}", cause),
StopKeyPhrasesDetectionJobError::InvalidRequest(ref cause) => write!(f, "{}", cause),
StopKeyPhrasesDetectionJobError::JobNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for StopKeyPhrasesDetectionJobError {}
#[derive(Debug, PartialEq)]
pub enum StopSentimentDetectionJobError {
InternalServer(String),
InvalidRequest(String),
JobNotFound(String),
}
impl StopSentimentDetectionJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StopSentimentDetectionJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(StopSentimentDetectionJobError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(StopSentimentDetectionJobError::InvalidRequest(
err.msg,
))
}
"JobNotFoundException" => {
return RusotoError::Service(StopSentimentDetectionJobError::JobNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for StopSentimentDetectionJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
StopSentimentDetectionJobError::InternalServer(ref cause) => write!(f, "{}", cause),
StopSentimentDetectionJobError::InvalidRequest(ref cause) => write!(f, "{}", cause),
StopSentimentDetectionJobError::JobNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for StopSentimentDetectionJobError {}
#[derive(Debug, PartialEq)]
pub enum StopTrainingDocumentClassifierError {
InternalServer(String),
InvalidRequest(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl StopTrainingDocumentClassifierError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<StopTrainingDocumentClassifierError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(
StopTrainingDocumentClassifierError::InternalServer(err.msg),
)
}
"InvalidRequestException" => {
return RusotoError::Service(
StopTrainingDocumentClassifierError::InvalidRequest(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
StopTrainingDocumentClassifierError::ResourceNotFound(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(
StopTrainingDocumentClassifierError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for StopTrainingDocumentClassifierError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
StopTrainingDocumentClassifierError::InternalServer(ref cause) => {
write!(f, "{}", cause)
}
StopTrainingDocumentClassifierError::InvalidRequest(ref cause) => {
write!(f, "{}", cause)
}
StopTrainingDocumentClassifierError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
StopTrainingDocumentClassifierError::TooManyRequests(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for StopTrainingDocumentClassifierError {}
#[derive(Debug, PartialEq)]
pub enum StopTrainingEntityRecognizerError {
InternalServer(String),
InvalidRequest(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl StopTrainingEntityRecognizerError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<StopTrainingEntityRecognizerError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(StopTrainingEntityRecognizerError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(StopTrainingEntityRecognizerError::InvalidRequest(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(
StopTrainingEntityRecognizerError::ResourceNotFound(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(
StopTrainingEntityRecognizerError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for StopTrainingEntityRecognizerError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
StopTrainingEntityRecognizerError::InternalServer(ref cause) => write!(f, "{}", cause),
StopTrainingEntityRecognizerError::InvalidRequest(ref cause) => write!(f, "{}", cause),
StopTrainingEntityRecognizerError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
StopTrainingEntityRecognizerError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for StopTrainingEntityRecognizerError {}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
ConcurrentModification(String),
InternalServer(String),
InvalidRequest(String),
ResourceNotFound(String),
TooManyTags(String),
}
impl TagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(TagResourceError::ConcurrentModification(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(TagResourceError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(TagResourceError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(TagResourceError::ResourceNotFound(err.msg))
}
"TooManyTagsException" => {
return RusotoError::Service(TagResourceError::TooManyTags(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for TagResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
TagResourceError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
TagResourceError::InternalServer(ref cause) => write!(f, "{}", cause),
TagResourceError::InvalidRequest(ref cause) => write!(f, "{}", cause),
TagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
TagResourceError::TooManyTags(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for TagResourceError {}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
ConcurrentModification(String),
InternalServer(String),
InvalidRequest(String),
ResourceNotFound(String),
TooManyTagKeys(String),
}
impl UntagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(UntagResourceError::ConcurrentModification(
err.msg,
))
}
"InternalServerException" => {
return RusotoError::Service(UntagResourceError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(UntagResourceError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UntagResourceError::ResourceNotFound(err.msg))
}
"TooManyTagKeysException" => {
return RusotoError::Service(UntagResourceError::TooManyTagKeys(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UntagResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UntagResourceError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
UntagResourceError::InternalServer(ref cause) => write!(f, "{}", cause),
UntagResourceError::InvalidRequest(ref cause) => write!(f, "{}", cause),
UntagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UntagResourceError::TooManyTagKeys(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UntagResourceError {}
#[derive(Debug, PartialEq)]
pub enum UpdateEndpointError {
InternalServer(String),
InvalidRequest(String),
ResourceInUse(String),
ResourceLimitExceeded(String),
ResourceNotFound(String),
ResourceUnavailable(String),
TooManyRequests(String),
}
impl UpdateEndpointError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateEndpointError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(UpdateEndpointError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(UpdateEndpointError::InvalidRequest(err.msg))
}
"ResourceInUseException" => {
return RusotoError::Service(UpdateEndpointError::ResourceInUse(err.msg))
}
"ResourceLimitExceededException" => {
return RusotoError::Service(UpdateEndpointError::ResourceLimitExceeded(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateEndpointError::ResourceNotFound(err.msg))
}
"ResourceUnavailableException" => {
return RusotoError::Service(UpdateEndpointError::ResourceUnavailable(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(UpdateEndpointError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateEndpointError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateEndpointError::InternalServer(ref cause) => write!(f, "{}", cause),
UpdateEndpointError::InvalidRequest(ref cause) => write!(f, "{}", cause),
UpdateEndpointError::ResourceInUse(ref cause) => write!(f, "{}", cause),
UpdateEndpointError::ResourceLimitExceeded(ref cause) => write!(f, "{}", cause),
UpdateEndpointError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UpdateEndpointError::ResourceUnavailable(ref cause) => write!(f, "{}", cause),
UpdateEndpointError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateEndpointError {}
#[async_trait]
pub trait Comprehend {
async fn batch_detect_dominant_language(
&self,
input: BatchDetectDominantLanguageRequest,
) -> Result<BatchDetectDominantLanguageResponse, RusotoError<BatchDetectDominantLanguageError>>;
async fn batch_detect_entities(
&self,
input: BatchDetectEntitiesRequest,
) -> Result<BatchDetectEntitiesResponse, RusotoError<BatchDetectEntitiesError>>;
async fn batch_detect_key_phrases(
&self,
input: BatchDetectKeyPhrasesRequest,
) -> Result<BatchDetectKeyPhrasesResponse, RusotoError<BatchDetectKeyPhrasesError>>;
async fn batch_detect_sentiment(
&self,
input: BatchDetectSentimentRequest,
) -> Result<BatchDetectSentimentResponse, RusotoError<BatchDetectSentimentError>>;
async fn batch_detect_syntax(
&self,
input: BatchDetectSyntaxRequest,
) -> Result<BatchDetectSyntaxResponse, RusotoError<BatchDetectSyntaxError>>;
async fn classify_document(
&self,
input: ClassifyDocumentRequest,
) -> Result<ClassifyDocumentResponse, RusotoError<ClassifyDocumentError>>;
async fn create_document_classifier(
&self,
input: CreateDocumentClassifierRequest,
) -> Result<CreateDocumentClassifierResponse, RusotoError<CreateDocumentClassifierError>>;
async fn create_endpoint(
&self,
input: CreateEndpointRequest,
) -> Result<CreateEndpointResponse, RusotoError<CreateEndpointError>>;
async fn create_entity_recognizer(
&self,
input: CreateEntityRecognizerRequest,
) -> Result<CreateEntityRecognizerResponse, RusotoError<CreateEntityRecognizerError>>;
async fn delete_document_classifier(
&self,
input: DeleteDocumentClassifierRequest,
) -> Result<DeleteDocumentClassifierResponse, RusotoError<DeleteDocumentClassifierError>>;
async fn delete_endpoint(
&self,
input: DeleteEndpointRequest,
) -> Result<DeleteEndpointResponse, RusotoError<DeleteEndpointError>>;
async fn delete_entity_recognizer(
&self,
input: DeleteEntityRecognizerRequest,
) -> Result<DeleteEntityRecognizerResponse, RusotoError<DeleteEntityRecognizerError>>;
async fn describe_document_classification_job(
&self,
input: DescribeDocumentClassificationJobRequest,
) -> Result<
DescribeDocumentClassificationJobResponse,
RusotoError<DescribeDocumentClassificationJobError>,
>;
async fn describe_document_classifier(
&self,
input: DescribeDocumentClassifierRequest,
) -> Result<DescribeDocumentClassifierResponse, RusotoError<DescribeDocumentClassifierError>>;
async fn describe_dominant_language_detection_job(
&self,
input: DescribeDominantLanguageDetectionJobRequest,
) -> Result<
DescribeDominantLanguageDetectionJobResponse,
RusotoError<DescribeDominantLanguageDetectionJobError>,
>;
async fn describe_endpoint(
&self,
input: DescribeEndpointRequest,
) -> Result<DescribeEndpointResponse, RusotoError<DescribeEndpointError>>;
async fn describe_entities_detection_job(
&self,
input: DescribeEntitiesDetectionJobRequest,
) -> Result<DescribeEntitiesDetectionJobResponse, RusotoError<DescribeEntitiesDetectionJobError>>;
async fn describe_entity_recognizer(
&self,
input: DescribeEntityRecognizerRequest,
) -> Result<DescribeEntityRecognizerResponse, RusotoError<DescribeEntityRecognizerError>>;
async fn describe_key_phrases_detection_job(
&self,
input: DescribeKeyPhrasesDetectionJobRequest,
) -> Result<
DescribeKeyPhrasesDetectionJobResponse,
RusotoError<DescribeKeyPhrasesDetectionJobError>,
>;
async fn describe_sentiment_detection_job(
&self,
input: DescribeSentimentDetectionJobRequest,
) -> Result<
DescribeSentimentDetectionJobResponse,
RusotoError<DescribeSentimentDetectionJobError>,
>;
async fn describe_topics_detection_job(
&self,
input: DescribeTopicsDetectionJobRequest,
) -> Result<DescribeTopicsDetectionJobResponse, RusotoError<DescribeTopicsDetectionJobError>>;
async fn detect_dominant_language(
&self,
input: DetectDominantLanguageRequest,
) -> Result<DetectDominantLanguageResponse, RusotoError<DetectDominantLanguageError>>;
async fn detect_entities(
&self,
input: DetectEntitiesRequest,
) -> Result<DetectEntitiesResponse, RusotoError<DetectEntitiesError>>;
async fn detect_key_phrases(
&self,
input: DetectKeyPhrasesRequest,
) -> Result<DetectKeyPhrasesResponse, RusotoError<DetectKeyPhrasesError>>;
async fn detect_sentiment(
&self,
input: DetectSentimentRequest,
) -> Result<DetectSentimentResponse, RusotoError<DetectSentimentError>>;
async fn detect_syntax(
&self,
input: DetectSyntaxRequest,
) -> Result<DetectSyntaxResponse, RusotoError<DetectSyntaxError>>;
async fn list_document_classification_jobs(
&self,
input: ListDocumentClassificationJobsRequest,
) -> Result<
ListDocumentClassificationJobsResponse,
RusotoError<ListDocumentClassificationJobsError>,
>;
async fn list_document_classifiers(
&self,
input: ListDocumentClassifiersRequest,
) -> Result<ListDocumentClassifiersResponse, RusotoError<ListDocumentClassifiersError>>;
async fn list_dominant_language_detection_jobs(
&self,
input: ListDominantLanguageDetectionJobsRequest,
) -> Result<
ListDominantLanguageDetectionJobsResponse,
RusotoError<ListDominantLanguageDetectionJobsError>,
>;
async fn list_endpoints(
&self,
input: ListEndpointsRequest,
) -> Result<ListEndpointsResponse, RusotoError<ListEndpointsError>>;
async fn list_entities_detection_jobs(
&self,
input: ListEntitiesDetectionJobsRequest,
) -> Result<ListEntitiesDetectionJobsResponse, RusotoError<ListEntitiesDetectionJobsError>>;
async fn list_entity_recognizers(
&self,
input: ListEntityRecognizersRequest,
) -> Result<ListEntityRecognizersResponse, RusotoError<ListEntityRecognizersError>>;
async fn list_key_phrases_detection_jobs(
&self,
input: ListKeyPhrasesDetectionJobsRequest,
) -> Result<ListKeyPhrasesDetectionJobsResponse, RusotoError<ListKeyPhrasesDetectionJobsError>>;
async fn list_sentiment_detection_jobs(
&self,
input: ListSentimentDetectionJobsRequest,
) -> Result<ListSentimentDetectionJobsResponse, RusotoError<ListSentimentDetectionJobsError>>;
async fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>>;
async fn list_topics_detection_jobs(
&self,
input: ListTopicsDetectionJobsRequest,
) -> Result<ListTopicsDetectionJobsResponse, RusotoError<ListTopicsDetectionJobsError>>;
async fn start_document_classification_job(
&self,
input: StartDocumentClassificationJobRequest,
) -> Result<
StartDocumentClassificationJobResponse,
RusotoError<StartDocumentClassificationJobError>,
>;
async fn start_dominant_language_detection_job(
&self,
input: StartDominantLanguageDetectionJobRequest,
) -> Result<
StartDominantLanguageDetectionJobResponse,
RusotoError<StartDominantLanguageDetectionJobError>,
>;
async fn start_entities_detection_job(
&self,
input: StartEntitiesDetectionJobRequest,
) -> Result<StartEntitiesDetectionJobResponse, RusotoError<StartEntitiesDetectionJobError>>;
async fn start_key_phrases_detection_job(
&self,
input: StartKeyPhrasesDetectionJobRequest,
) -> Result<StartKeyPhrasesDetectionJobResponse, RusotoError<StartKeyPhrasesDetectionJobError>>;
async fn start_sentiment_detection_job(
&self,
input: StartSentimentDetectionJobRequest,
) -> Result<StartSentimentDetectionJobResponse, RusotoError<StartSentimentDetectionJobError>>;
async fn start_topics_detection_job(
&self,
input: StartTopicsDetectionJobRequest,
) -> Result<StartTopicsDetectionJobResponse, RusotoError<StartTopicsDetectionJobError>>;
async fn stop_dominant_language_detection_job(
&self,
input: StopDominantLanguageDetectionJobRequest,
) -> Result<
StopDominantLanguageDetectionJobResponse,
RusotoError<StopDominantLanguageDetectionJobError>,
>;
async fn stop_entities_detection_job(
&self,
input: StopEntitiesDetectionJobRequest,
) -> Result<StopEntitiesDetectionJobResponse, RusotoError<StopEntitiesDetectionJobError>>;
async fn stop_key_phrases_detection_job(
&self,
input: StopKeyPhrasesDetectionJobRequest,
) -> Result<StopKeyPhrasesDetectionJobResponse, RusotoError<StopKeyPhrasesDetectionJobError>>;
async fn stop_sentiment_detection_job(
&self,
input: StopSentimentDetectionJobRequest,
) -> Result<StopSentimentDetectionJobResponse, RusotoError<StopSentimentDetectionJobError>>;
async fn stop_training_document_classifier(
&self,
input: StopTrainingDocumentClassifierRequest,
) -> Result<
StopTrainingDocumentClassifierResponse,
RusotoError<StopTrainingDocumentClassifierError>,
>;
async fn stop_training_entity_recognizer(
&self,
input: StopTrainingEntityRecognizerRequest,
) -> Result<StopTrainingEntityRecognizerResponse, RusotoError<StopTrainingEntityRecognizerError>>;
async fn tag_resource(
&self,
input: TagResourceRequest,
) -> Result<TagResourceResponse, RusotoError<TagResourceError>>;
async fn untag_resource(
&self,
input: UntagResourceRequest,
) -> Result<UntagResourceResponse, RusotoError<UntagResourceError>>;
async fn update_endpoint(
&self,
input: UpdateEndpointRequest,
) -> Result<UpdateEndpointResponse, RusotoError<UpdateEndpointError>>;
}
#[derive(Clone)]
pub struct ComprehendClient {
client: Client,
region: region::Region,
}
impl ComprehendClient {
pub fn new(region: region::Region) -> ComprehendClient {
ComprehendClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> ComprehendClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
D: DispatchSignedRequest + Send + Sync + 'static,
{
ComprehendClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
pub fn new_with_client(client: Client, region: region::Region) -> ComprehendClient {
ComprehendClient { client, region }
}
}
#[async_trait]
impl Comprehend for ComprehendClient {
async fn batch_detect_dominant_language(
&self,
input: BatchDetectDominantLanguageRequest,
) -> Result<BatchDetectDominantLanguageResponse, RusotoError<BatchDetectDominantLanguageError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.BatchDetectDominantLanguage",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, BatchDetectDominantLanguageError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<BatchDetectDominantLanguageResponse, _>()
}
async fn batch_detect_entities(
&self,
input: BatchDetectEntitiesRequest,
) -> Result<BatchDetectEntitiesResponse, RusotoError<BatchDetectEntitiesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.BatchDetectEntities");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, BatchDetectEntitiesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<BatchDetectEntitiesResponse, _>()
}
async fn batch_detect_key_phrases(
&self,
input: BatchDetectKeyPhrasesRequest,
) -> Result<BatchDetectKeyPhrasesResponse, RusotoError<BatchDetectKeyPhrasesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.BatchDetectKeyPhrases");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, BatchDetectKeyPhrasesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<BatchDetectKeyPhrasesResponse, _>()
}
async fn batch_detect_sentiment(
&self,
input: BatchDetectSentimentRequest,
) -> Result<BatchDetectSentimentResponse, RusotoError<BatchDetectSentimentError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.BatchDetectSentiment");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, BatchDetectSentimentError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<BatchDetectSentimentResponse, _>()
}
async fn batch_detect_syntax(
&self,
input: BatchDetectSyntaxRequest,
) -> Result<BatchDetectSyntaxResponse, RusotoError<BatchDetectSyntaxError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.BatchDetectSyntax");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, BatchDetectSyntaxError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<BatchDetectSyntaxResponse, _>()
}
async fn classify_document(
&self,
input: ClassifyDocumentRequest,
) -> Result<ClassifyDocumentResponse, RusotoError<ClassifyDocumentError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.ClassifyDocument");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ClassifyDocumentError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ClassifyDocumentResponse, _>()
}
async fn create_document_classifier(
&self,
input: CreateDocumentClassifierRequest,
) -> Result<CreateDocumentClassifierResponse, RusotoError<CreateDocumentClassifierError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.CreateDocumentClassifier",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateDocumentClassifierError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateDocumentClassifierResponse, _>()
}
async fn create_endpoint(
&self,
input: CreateEndpointRequest,
) -> Result<CreateEndpointResponse, RusotoError<CreateEndpointError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.CreateEndpoint");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateEndpointError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<CreateEndpointResponse, _>()
}
async fn create_entity_recognizer(
&self,
input: CreateEntityRecognizerRequest,
) -> Result<CreateEntityRecognizerResponse, RusotoError<CreateEntityRecognizerError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.CreateEntityRecognizer");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateEntityRecognizerError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateEntityRecognizerResponse, _>()
}
async fn delete_document_classifier(
&self,
input: DeleteDocumentClassifierRequest,
) -> Result<DeleteDocumentClassifierResponse, RusotoError<DeleteDocumentClassifierError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.DeleteDocumentClassifier",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteDocumentClassifierError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteDocumentClassifierResponse, _>()
}
async fn delete_endpoint(
&self,
input: DeleteEndpointRequest,
) -> Result<DeleteEndpointResponse, RusotoError<DeleteEndpointError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.DeleteEndpoint");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteEndpointError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DeleteEndpointResponse, _>()
}
async fn delete_entity_recognizer(
&self,
input: DeleteEntityRecognizerRequest,
) -> Result<DeleteEntityRecognizerResponse, RusotoError<DeleteEntityRecognizerError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.DeleteEntityRecognizer");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteEntityRecognizerError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteEntityRecognizerResponse, _>()
}
async fn describe_document_classification_job(
&self,
input: DescribeDocumentClassificationJobRequest,
) -> Result<
DescribeDocumentClassificationJobResponse,
RusotoError<DescribeDocumentClassificationJobError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeDocumentClassificationJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(
request,
DescribeDocumentClassificationJobError::from_response,
)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeDocumentClassificationJobResponse, _>()
}
async fn describe_document_classifier(
&self,
input: DescribeDocumentClassifierRequest,
) -> Result<DescribeDocumentClassifierResponse, RusotoError<DescribeDocumentClassifierError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeDocumentClassifier",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeDocumentClassifierError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeDocumentClassifierResponse, _>()
}
async fn describe_dominant_language_detection_job(
&self,
input: DescribeDominantLanguageDetectionJobRequest,
) -> Result<
DescribeDominantLanguageDetectionJobResponse,
RusotoError<DescribeDominantLanguageDetectionJobError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeDominantLanguageDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(
request,
DescribeDominantLanguageDetectionJobError::from_response,
)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeDominantLanguageDetectionJobResponse, _>()
}
async fn describe_endpoint(
&self,
input: DescribeEndpointRequest,
) -> Result<DescribeEndpointResponse, RusotoError<DescribeEndpointError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.DescribeEndpoint");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeEndpointError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DescribeEndpointResponse, _>()
}
async fn describe_entities_detection_job(
&self,
input: DescribeEntitiesDetectionJobRequest,
) -> Result<DescribeEntitiesDetectionJobResponse, RusotoError<DescribeEntitiesDetectionJobError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeEntitiesDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeEntitiesDetectionJobError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeEntitiesDetectionJobResponse, _>()
}
async fn describe_entity_recognizer(
&self,
input: DescribeEntityRecognizerRequest,
) -> Result<DescribeEntityRecognizerResponse, RusotoError<DescribeEntityRecognizerError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeEntityRecognizer",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeEntityRecognizerError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeEntityRecognizerResponse, _>()
}
async fn describe_key_phrases_detection_job(
&self,
input: DescribeKeyPhrasesDetectionJobRequest,
) -> Result<
DescribeKeyPhrasesDetectionJobResponse,
RusotoError<DescribeKeyPhrasesDetectionJobError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeKeyPhrasesDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeKeyPhrasesDetectionJobError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeKeyPhrasesDetectionJobResponse, _>()
}
async fn describe_sentiment_detection_job(
&self,
input: DescribeSentimentDetectionJobRequest,
) -> Result<
DescribeSentimentDetectionJobResponse,
RusotoError<DescribeSentimentDetectionJobError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeSentimentDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeSentimentDetectionJobError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeSentimentDetectionJobResponse, _>()
}
async fn describe_topics_detection_job(
&self,
input: DescribeTopicsDetectionJobRequest,
) -> Result<DescribeTopicsDetectionJobResponse, RusotoError<DescribeTopicsDetectionJobError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeTopicsDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeTopicsDetectionJobError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeTopicsDetectionJobResponse, _>()
}
async fn detect_dominant_language(
&self,
input: DetectDominantLanguageRequest,
) -> Result<DetectDominantLanguageResponse, RusotoError<DetectDominantLanguageError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.DetectDominantLanguage");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DetectDominantLanguageError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DetectDominantLanguageResponse, _>()
}
async fn detect_entities(
&self,
input: DetectEntitiesRequest,
) -> Result<DetectEntitiesResponse, RusotoError<DetectEntitiesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.DetectEntities");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DetectEntitiesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DetectEntitiesResponse, _>()
}
async fn detect_key_phrases(
&self,
input: DetectKeyPhrasesRequest,
) -> Result<DetectKeyPhrasesResponse, RusotoError<DetectKeyPhrasesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.DetectKeyPhrases");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DetectKeyPhrasesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DetectKeyPhrasesResponse, _>()
}
async fn detect_sentiment(
&self,
input: DetectSentimentRequest,
) -> Result<DetectSentimentResponse, RusotoError<DetectSentimentError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.DetectSentiment");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DetectSentimentError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DetectSentimentResponse, _>()
}
async fn detect_syntax(
&self,
input: DetectSyntaxRequest,
) -> Result<DetectSyntaxResponse, RusotoError<DetectSyntaxError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.DetectSyntax");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DetectSyntaxError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DetectSyntaxResponse, _>()
}
async fn list_document_classification_jobs(
&self,
input: ListDocumentClassificationJobsRequest,
) -> Result<
ListDocumentClassificationJobsResponse,
RusotoError<ListDocumentClassificationJobsError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.ListDocumentClassificationJobs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListDocumentClassificationJobsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<ListDocumentClassificationJobsResponse, _>()
}
async fn list_document_classifiers(
&self,
input: ListDocumentClassifiersRequest,
) -> Result<ListDocumentClassifiersResponse, RusotoError<ListDocumentClassifiersError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.ListDocumentClassifiers",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListDocumentClassifiersError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<ListDocumentClassifiersResponse, _>()
}
async fn list_dominant_language_detection_jobs(
&self,
input: ListDominantLanguageDetectionJobsRequest,
) -> Result<
ListDominantLanguageDetectionJobsResponse,
RusotoError<ListDominantLanguageDetectionJobsError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.ListDominantLanguageDetectionJobs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(
request,
ListDominantLanguageDetectionJobsError::from_response,
)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<ListDominantLanguageDetectionJobsResponse, _>()
}
async fn list_endpoints(
&self,
input: ListEndpointsRequest,
) -> Result<ListEndpointsResponse, RusotoError<ListEndpointsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.ListEndpoints");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListEndpointsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListEndpointsResponse, _>()
}
async fn list_entities_detection_jobs(
&self,
input: ListEntitiesDetectionJobsRequest,
) -> Result<ListEntitiesDetectionJobsResponse, RusotoError<ListEntitiesDetectionJobsError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.ListEntitiesDetectionJobs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListEntitiesDetectionJobsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<ListEntitiesDetectionJobsResponse, _>()
}
async fn list_entity_recognizers(
&self,
input: ListEntityRecognizersRequest,
) -> Result<ListEntityRecognizersResponse, RusotoError<ListEntityRecognizersError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.ListEntityRecognizers");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListEntityRecognizersError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<ListEntityRecognizersResponse, _>()
}
async fn list_key_phrases_detection_jobs(
&self,
input: ListKeyPhrasesDetectionJobsRequest,
) -> Result<ListKeyPhrasesDetectionJobsResponse, RusotoError<ListKeyPhrasesDetectionJobsError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.ListKeyPhrasesDetectionJobs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListKeyPhrasesDetectionJobsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<ListKeyPhrasesDetectionJobsResponse, _>()
}
async fn list_sentiment_detection_jobs(
&self,
input: ListSentimentDetectionJobsRequest,
) -> Result<ListSentimentDetectionJobsResponse, RusotoError<ListSentimentDetectionJobsError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.ListSentimentDetectionJobs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListSentimentDetectionJobsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<ListSentimentDetectionJobsResponse, _>()
}
async fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.ListTagsForResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListTagsForResourceError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListTagsForResourceResponse, _>()
}
async fn list_topics_detection_jobs(
&self,
input: ListTopicsDetectionJobsRequest,
) -> Result<ListTopicsDetectionJobsResponse, RusotoError<ListTopicsDetectionJobsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.ListTopicsDetectionJobs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListTopicsDetectionJobsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<ListTopicsDetectionJobsResponse, _>()
}
async fn start_document_classification_job(
&self,
input: StartDocumentClassificationJobRequest,
) -> Result<
StartDocumentClassificationJobResponse,
RusotoError<StartDocumentClassificationJobError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.StartDocumentClassificationJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, StartDocumentClassificationJobError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<StartDocumentClassificationJobResponse, _>()
}
async fn start_dominant_language_detection_job(
&self,
input: StartDominantLanguageDetectionJobRequest,
) -> Result<
StartDominantLanguageDetectionJobResponse,
RusotoError<StartDominantLanguageDetectionJobError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.StartDominantLanguageDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(
request,
StartDominantLanguageDetectionJobError::from_response,
)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<StartDominantLanguageDetectionJobResponse, _>()
}
async fn start_entities_detection_job(
&self,
input: StartEntitiesDetectionJobRequest,
) -> Result<StartEntitiesDetectionJobResponse, RusotoError<StartEntitiesDetectionJobError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.StartEntitiesDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, StartEntitiesDetectionJobError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<StartEntitiesDetectionJobResponse, _>()
}
async fn start_key_phrases_detection_job(
&self,
input: StartKeyPhrasesDetectionJobRequest,
) -> Result<StartKeyPhrasesDetectionJobResponse, RusotoError<StartKeyPhrasesDetectionJobError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.StartKeyPhrasesDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, StartKeyPhrasesDetectionJobError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<StartKeyPhrasesDetectionJobResponse, _>()
}
async fn start_sentiment_detection_job(
&self,
input: StartSentimentDetectionJobRequest,
) -> Result<StartSentimentDetectionJobResponse, RusotoError<StartSentimentDetectionJobError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.StartSentimentDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, StartSentimentDetectionJobError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<StartSentimentDetectionJobResponse, _>()
}
async fn start_topics_detection_job(
&self,
input: StartTopicsDetectionJobRequest,
) -> Result<StartTopicsDetectionJobResponse, RusotoError<StartTopicsDetectionJobError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.StartTopicsDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, StartTopicsDetectionJobError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<StartTopicsDetectionJobResponse, _>()
}
async fn stop_dominant_language_detection_job(
&self,
input: StopDominantLanguageDetectionJobRequest,
) -> Result<
StopDominantLanguageDetectionJobResponse,
RusotoError<StopDominantLanguageDetectionJobError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.StopDominantLanguageDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(
request,
StopDominantLanguageDetectionJobError::from_response,
)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<StopDominantLanguageDetectionJobResponse, _>()
}
async fn stop_entities_detection_job(
&self,
input: StopEntitiesDetectionJobRequest,
) -> Result<StopEntitiesDetectionJobResponse, RusotoError<StopEntitiesDetectionJobError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.StopEntitiesDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, StopEntitiesDetectionJobError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<StopEntitiesDetectionJobResponse, _>()
}
async fn stop_key_phrases_detection_job(
&self,
input: StopKeyPhrasesDetectionJobRequest,
) -> Result<StopKeyPhrasesDetectionJobResponse, RusotoError<StopKeyPhrasesDetectionJobError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.StopKeyPhrasesDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, StopKeyPhrasesDetectionJobError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<StopKeyPhrasesDetectionJobResponse, _>()
}
async fn stop_sentiment_detection_job(
&self,
input: StopSentimentDetectionJobRequest,
) -> Result<StopSentimentDetectionJobResponse, RusotoError<StopSentimentDetectionJobError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.StopSentimentDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, StopSentimentDetectionJobError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<StopSentimentDetectionJobResponse, _>()
}
async fn stop_training_document_classifier(
&self,
input: StopTrainingDocumentClassifierRequest,
) -> Result<
StopTrainingDocumentClassifierResponse,
RusotoError<StopTrainingDocumentClassifierError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.StopTrainingDocumentClassifier",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, StopTrainingDocumentClassifierError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<StopTrainingDocumentClassifierResponse, _>()
}
async fn stop_training_entity_recognizer(
&self,
input: StopTrainingEntityRecognizerRequest,
) -> Result<StopTrainingEntityRecognizerResponse, RusotoError<StopTrainingEntityRecognizerError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"Comprehend_20171127.StopTrainingEntityRecognizer",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, StopTrainingEntityRecognizerError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<StopTrainingEntityRecognizerResponse, _>()
}
async fn tag_resource(
&self,
input: TagResourceRequest,
) -> Result<TagResourceResponse, RusotoError<TagResourceError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.TagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, TagResourceError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<TagResourceResponse, _>()
}
async fn untag_resource(
&self,
input: UntagResourceRequest,
) -> Result<UntagResourceResponse, RusotoError<UntagResourceError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.UntagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UntagResourceError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UntagResourceResponse, _>()
}
async fn update_endpoint(
&self,
input: UpdateEndpointRequest,
) -> Result<UpdateEndpointResponse, RusotoError<UpdateEndpointError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "Comprehend_20171127.UpdateEndpoint");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateEndpointError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UpdateEndpointResponse, _>()
}
}