use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct BatchDetectDominantLanguageRequest {
#[serde(rename = "TextList")]
pub text_list: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BatchDetectDominantLanguageResponse {
#[serde(rename = "ErrorList")]
pub error_list: Vec<BatchItemError>,
#[serde(rename = "ResultList")]
pub result_list: Vec<BatchDetectDominantLanguageItemResult>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct BatchDetectEntitiesRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "TextList")]
pub text_list: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BatchDetectEntitiesResponse {
#[serde(rename = "ErrorList")]
pub error_list: Vec<BatchItemError>,
#[serde(rename = "ResultList")]
pub result_list: Vec<BatchDetectEntitiesItemResult>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct BatchDetectKeyPhrasesRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "TextList")]
pub text_list: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BatchDetectKeyPhrasesResponse {
#[serde(rename = "ErrorList")]
pub error_list: Vec<BatchItemError>,
#[serde(rename = "ResultList")]
pub result_list: Vec<BatchDetectKeyPhrasesItemResult>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct BatchDetectSentimentRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "TextList")]
pub text_list: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BatchDetectSentimentResponse {
#[serde(rename = "ErrorList")]
pub error_list: Vec<BatchItemError>,
#[serde(rename = "ResultList")]
pub result_list: Vec<BatchDetectSentimentItemResult>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct BatchDetectSyntaxRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "TextList")]
pub text_list: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BatchDetectSyntaxResponse {
#[serde(rename = "ErrorList")]
pub error_list: Vec<BatchItemError>,
#[serde(rename = "ResultList")]
pub result_list: Vec<BatchDetectSyntaxItemResult>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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 = "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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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 = "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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateDocumentClassifierResponse {
#[serde(rename = "DocumentClassifierArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub document_classifier_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateEntityRecognizerResponse {
#[serde(rename = "EntityRecognizerArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_recognizer_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteDocumentClassifierRequest {
#[serde(rename = "DocumentClassifierArn")]
pub document_classifier_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteDocumentClassifierResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteEntityRecognizerRequest {
#[serde(rename = "EntityRecognizerArn")]
pub entity_recognizer_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteEntityRecognizerResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeDocumentClassificationJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeDocumentClassificationJobResponse {
#[serde(rename = "DocumentClassificationJobProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub document_classification_job_properties: Option<DocumentClassificationJobProperties>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeDocumentClassifierRequest {
#[serde(rename = "DocumentClassifierArn")]
pub document_classifier_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeDocumentClassifierResponse {
#[serde(rename = "DocumentClassifierProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub document_classifier_properties: Option<DocumentClassifierProperties>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeDominantLanguageDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeDominantLanguageDetectionJobResponse {
#[serde(rename = "DominantLanguageDetectionJobProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dominant_language_detection_job_properties: Option<DominantLanguageDetectionJobProperties>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeEntitiesDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeEntitiesDetectionJobResponse {
#[serde(rename = "EntitiesDetectionJobProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entities_detection_job_properties: Option<EntitiesDetectionJobProperties>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeEntityRecognizerRequest {
#[serde(rename = "EntityRecognizerArn")]
pub entity_recognizer_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeEntityRecognizerResponse {
#[serde(rename = "EntityRecognizerProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_recognizer_properties: Option<EntityRecognizerProperties>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeKeyPhrasesDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeKeyPhrasesDetectionJobResponse {
#[serde(rename = "KeyPhrasesDetectionJobProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_phrases_detection_job_properties: Option<KeyPhrasesDetectionJobProperties>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeSentimentDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeSentimentDetectionJobResponse {
#[serde(rename = "SentimentDetectionJobProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sentiment_detection_job_properties: Option<SentimentDetectionJobProperties>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeTopicsDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeTopicsDetectionJobResponse {
#[serde(rename = "TopicsDetectionJobProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub topics_detection_job_properties: Option<TopicsDetectionJobProperties>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DetectDominantLanguageRequest {
#[serde(rename = "Text")]
pub text: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DetectDominantLanguageResponse {
#[serde(rename = "Languages")]
#[serde(skip_serializing_if = "Option::is_none")]
pub languages: Option<Vec<DominantLanguage>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DetectEntitiesRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "Text")]
pub text: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DetectEntitiesResponse {
#[serde(rename = "Entities")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entities: Option<Vec<Entity>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DetectKeyPhrasesRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "Text")]
pub text: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DetectKeyPhrasesResponse {
#[serde(rename = "KeyPhrases")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_phrases: Option<Vec<KeyPhrase>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DetectSentimentRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "Text")]
pub text: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DetectSyntaxRequest {
#[serde(rename = "LanguageCode")]
pub language_code: String,
#[serde(rename = "Text")]
pub text: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DetectSyntaxResponse {
#[serde(rename = "SyntaxTokens")]
#[serde(skip_serializing_if = "Option::is_none")]
pub syntax_tokens: Option<Vec<SyntaxToken>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DocumentClassifierInputDataConfig {
#[serde(rename = "S3Uri")]
pub s3_uri: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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 = "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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EntityRecognizerAnnotations {
#[serde(rename = "S3Uri")]
pub s3_uri: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EntityRecognizerDocuments {
#[serde(rename = "S3Uri")]
pub s3_uri: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EntityRecognizerEntityList {
#[serde(rename = "S3Uri")]
pub s3_uri: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct EntityRecognizerMetadataEntityTypesListItem {
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EntityTypesListItem {
#[serde(rename = "Type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsForResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopDominantLanguageDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopEntitiesDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopKeyPhrasesDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopSentimentDetectionJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopTrainingDocumentClassifierRequest {
#[serde(rename = "DocumentClassifierArn")]
pub document_classifier_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StopTrainingDocumentClassifierResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopTrainingEntityRecognizerRequest {
#[serde(rename = "EntityRecognizerArn")]
pub entity_recognizer_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StopTrainingEntityRecognizerResponse {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Tag {
#[serde(rename = "Key")]
pub key: String,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "Tags")]
pub tags: Vec<Tag>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TagResourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UntagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UntagResourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for BatchDetectDominantLanguageError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchDetectDominantLanguageError {
fn description(&self) -> &str {
match *self {
BatchDetectDominantLanguageError::BatchSizeLimitExceeded(ref cause) => cause,
BatchDetectDominantLanguageError::InternalServer(ref cause) => cause,
BatchDetectDominantLanguageError::InvalidRequest(ref cause) => cause,
BatchDetectDominantLanguageError::TextSizeLimitExceeded(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for BatchDetectEntitiesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchDetectEntitiesError {
fn description(&self) -> &str {
match *self {
BatchDetectEntitiesError::BatchSizeLimitExceeded(ref cause) => cause,
BatchDetectEntitiesError::InternalServer(ref cause) => cause,
BatchDetectEntitiesError::InvalidRequest(ref cause) => cause,
BatchDetectEntitiesError::TextSizeLimitExceeded(ref cause) => cause,
BatchDetectEntitiesError::UnsupportedLanguage(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for BatchDetectKeyPhrasesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchDetectKeyPhrasesError {
fn description(&self) -> &str {
match *self {
BatchDetectKeyPhrasesError::BatchSizeLimitExceeded(ref cause) => cause,
BatchDetectKeyPhrasesError::InternalServer(ref cause) => cause,
BatchDetectKeyPhrasesError::InvalidRequest(ref cause) => cause,
BatchDetectKeyPhrasesError::TextSizeLimitExceeded(ref cause) => cause,
BatchDetectKeyPhrasesError::UnsupportedLanguage(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for BatchDetectSentimentError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchDetectSentimentError {
fn description(&self) -> &str {
match *self {
BatchDetectSentimentError::BatchSizeLimitExceeded(ref cause) => cause,
BatchDetectSentimentError::InternalServer(ref cause) => cause,
BatchDetectSentimentError::InvalidRequest(ref cause) => cause,
BatchDetectSentimentError::TextSizeLimitExceeded(ref cause) => cause,
BatchDetectSentimentError::UnsupportedLanguage(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for BatchDetectSyntaxError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchDetectSyntaxError {
fn description(&self) -> &str {
match *self {
BatchDetectSyntaxError::BatchSizeLimitExceeded(ref cause) => cause,
BatchDetectSyntaxError::InternalServer(ref cause) => cause,
BatchDetectSyntaxError::InvalidRequest(ref cause) => cause,
BatchDetectSyntaxError::TextSizeLimitExceeded(ref cause) => cause,
BatchDetectSyntaxError::UnsupportedLanguage(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateDocumentClassifierError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateDocumentClassifierError {
fn description(&self) -> &str {
match *self {
CreateDocumentClassifierError::InternalServer(ref cause) => cause,
CreateDocumentClassifierError::InvalidRequest(ref cause) => cause,
CreateDocumentClassifierError::KmsKeyValidation(ref cause) => cause,
CreateDocumentClassifierError::ResourceInUse(ref cause) => cause,
CreateDocumentClassifierError::ResourceLimitExceeded(ref cause) => cause,
CreateDocumentClassifierError::TooManyRequests(ref cause) => cause,
CreateDocumentClassifierError::TooManyTags(ref cause) => cause,
CreateDocumentClassifierError::UnsupportedLanguage(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateEntityRecognizerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateEntityRecognizerError {
fn description(&self) -> &str {
match *self {
CreateEntityRecognizerError::InternalServer(ref cause) => cause,
CreateEntityRecognizerError::InvalidRequest(ref cause) => cause,
CreateEntityRecognizerError::KmsKeyValidation(ref cause) => cause,
CreateEntityRecognizerError::ResourceInUse(ref cause) => cause,
CreateEntityRecognizerError::ResourceLimitExceeded(ref cause) => cause,
CreateEntityRecognizerError::TooManyRequests(ref cause) => cause,
CreateEntityRecognizerError::TooManyTags(ref cause) => cause,
CreateEntityRecognizerError::UnsupportedLanguage(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteDocumentClassifierError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteDocumentClassifierError {
fn description(&self) -> &str {
match *self {
DeleteDocumentClassifierError::InternalServer(ref cause) => cause,
DeleteDocumentClassifierError::InvalidRequest(ref cause) => cause,
DeleteDocumentClassifierError::ResourceInUse(ref cause) => cause,
DeleteDocumentClassifierError::ResourceNotFound(ref cause) => cause,
DeleteDocumentClassifierError::ResourceUnavailable(ref cause) => cause,
DeleteDocumentClassifierError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteEntityRecognizerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteEntityRecognizerError {
fn description(&self) -> &str {
match *self {
DeleteEntityRecognizerError::InternalServer(ref cause) => cause,
DeleteEntityRecognizerError::InvalidRequest(ref cause) => cause,
DeleteEntityRecognizerError::ResourceInUse(ref cause) => cause,
DeleteEntityRecognizerError::ResourceNotFound(ref cause) => cause,
DeleteEntityRecognizerError::ResourceUnavailable(ref cause) => cause,
DeleteEntityRecognizerError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeDocumentClassificationJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeDocumentClassificationJobError {
fn description(&self) -> &str {
match *self {
DescribeDocumentClassificationJobError::InternalServer(ref cause) => cause,
DescribeDocumentClassificationJobError::InvalidRequest(ref cause) => cause,
DescribeDocumentClassificationJobError::JobNotFound(ref cause) => cause,
DescribeDocumentClassificationJobError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeDocumentClassifierError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeDocumentClassifierError {
fn description(&self) -> &str {
match *self {
DescribeDocumentClassifierError::InternalServer(ref cause) => cause,
DescribeDocumentClassifierError::InvalidRequest(ref cause) => cause,
DescribeDocumentClassifierError::ResourceNotFound(ref cause) => cause,
DescribeDocumentClassifierError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeDominantLanguageDetectionJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeDominantLanguageDetectionJobError {
fn description(&self) -> &str {
match *self {
DescribeDominantLanguageDetectionJobError::InternalServer(ref cause) => cause,
DescribeDominantLanguageDetectionJobError::InvalidRequest(ref cause) => cause,
DescribeDominantLanguageDetectionJobError::JobNotFound(ref cause) => cause,
DescribeDominantLanguageDetectionJobError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeEntitiesDetectionJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeEntitiesDetectionJobError {
fn description(&self) -> &str {
match *self {
DescribeEntitiesDetectionJobError::InternalServer(ref cause) => cause,
DescribeEntitiesDetectionJobError::InvalidRequest(ref cause) => cause,
DescribeEntitiesDetectionJobError::JobNotFound(ref cause) => cause,
DescribeEntitiesDetectionJobError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeEntityRecognizerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeEntityRecognizerError {
fn description(&self) -> &str {
match *self {
DescribeEntityRecognizerError::InternalServer(ref cause) => cause,
DescribeEntityRecognizerError::InvalidRequest(ref cause) => cause,
DescribeEntityRecognizerError::ResourceNotFound(ref cause) => cause,
DescribeEntityRecognizerError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeKeyPhrasesDetectionJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeKeyPhrasesDetectionJobError {
fn description(&self) -> &str {
match *self {
DescribeKeyPhrasesDetectionJobError::InternalServer(ref cause) => cause,
DescribeKeyPhrasesDetectionJobError::InvalidRequest(ref cause) => cause,
DescribeKeyPhrasesDetectionJobError::JobNotFound(ref cause) => cause,
DescribeKeyPhrasesDetectionJobError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeSentimentDetectionJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeSentimentDetectionJobError {
fn description(&self) -> &str {
match *self {
DescribeSentimentDetectionJobError::InternalServer(ref cause) => cause,
DescribeSentimentDetectionJobError::InvalidRequest(ref cause) => cause,
DescribeSentimentDetectionJobError::JobNotFound(ref cause) => cause,
DescribeSentimentDetectionJobError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeTopicsDetectionJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeTopicsDetectionJobError {
fn description(&self) -> &str {
match *self {
DescribeTopicsDetectionJobError::InternalServer(ref cause) => cause,
DescribeTopicsDetectionJobError::InvalidRequest(ref cause) => cause,
DescribeTopicsDetectionJobError::JobNotFound(ref cause) => cause,
DescribeTopicsDetectionJobError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DetectDominantLanguageError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DetectDominantLanguageError {
fn description(&self) -> &str {
match *self {
DetectDominantLanguageError::InternalServer(ref cause) => cause,
DetectDominantLanguageError::InvalidRequest(ref cause) => cause,
DetectDominantLanguageError::TextSizeLimitExceeded(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DetectEntitiesError {
InternalServer(String),
InvalidRequest(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))
}
"TextSizeLimitExceededException" => {
return RusotoError::Service(DetectEntitiesError::TextSizeLimitExceeded(
err.msg,
))
}
"UnsupportedLanguageException" => {
return RusotoError::Service(DetectEntitiesError::UnsupportedLanguage(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DetectEntitiesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DetectEntitiesError {
fn description(&self) -> &str {
match *self {
DetectEntitiesError::InternalServer(ref cause) => cause,
DetectEntitiesError::InvalidRequest(ref cause) => cause,
DetectEntitiesError::TextSizeLimitExceeded(ref cause) => cause,
DetectEntitiesError::UnsupportedLanguage(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DetectKeyPhrasesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DetectKeyPhrasesError {
fn description(&self) -> &str {
match *self {
DetectKeyPhrasesError::InternalServer(ref cause) => cause,
DetectKeyPhrasesError::InvalidRequest(ref cause) => cause,
DetectKeyPhrasesError::TextSizeLimitExceeded(ref cause) => cause,
DetectKeyPhrasesError::UnsupportedLanguage(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DetectSentimentError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DetectSentimentError {
fn description(&self) -> &str {
match *self {
DetectSentimentError::InternalServer(ref cause) => cause,
DetectSentimentError::InvalidRequest(ref cause) => cause,
DetectSentimentError::TextSizeLimitExceeded(ref cause) => cause,
DetectSentimentError::UnsupportedLanguage(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DetectSyntaxError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DetectSyntaxError {
fn description(&self) -> &str {
match *self {
DetectSyntaxError::InternalServer(ref cause) => cause,
DetectSyntaxError::InvalidRequest(ref cause) => cause,
DetectSyntaxError::TextSizeLimitExceeded(ref cause) => cause,
DetectSyntaxError::UnsupportedLanguage(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListDocumentClassificationJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListDocumentClassificationJobsError {
fn description(&self) -> &str {
match *self {
ListDocumentClassificationJobsError::InternalServer(ref cause) => cause,
ListDocumentClassificationJobsError::InvalidFilter(ref cause) => cause,
ListDocumentClassificationJobsError::InvalidRequest(ref cause) => cause,
ListDocumentClassificationJobsError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListDocumentClassifiersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListDocumentClassifiersError {
fn description(&self) -> &str {
match *self {
ListDocumentClassifiersError::InternalServer(ref cause) => cause,
ListDocumentClassifiersError::InvalidFilter(ref cause) => cause,
ListDocumentClassifiersError::InvalidRequest(ref cause) => cause,
ListDocumentClassifiersError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListDominantLanguageDetectionJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListDominantLanguageDetectionJobsError {
fn description(&self) -> &str {
match *self {
ListDominantLanguageDetectionJobsError::InternalServer(ref cause) => cause,
ListDominantLanguageDetectionJobsError::InvalidFilter(ref cause) => cause,
ListDominantLanguageDetectionJobsError::InvalidRequest(ref cause) => cause,
ListDominantLanguageDetectionJobsError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListEntitiesDetectionJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListEntitiesDetectionJobsError {
fn description(&self) -> &str {
match *self {
ListEntitiesDetectionJobsError::InternalServer(ref cause) => cause,
ListEntitiesDetectionJobsError::InvalidFilter(ref cause) => cause,
ListEntitiesDetectionJobsError::InvalidRequest(ref cause) => cause,
ListEntitiesDetectionJobsError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListEntityRecognizersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListEntityRecognizersError {
fn description(&self) -> &str {
match *self {
ListEntityRecognizersError::InternalServer(ref cause) => cause,
ListEntityRecognizersError::InvalidFilter(ref cause) => cause,
ListEntityRecognizersError::InvalidRequest(ref cause) => cause,
ListEntityRecognizersError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListKeyPhrasesDetectionJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListKeyPhrasesDetectionJobsError {
fn description(&self) -> &str {
match *self {
ListKeyPhrasesDetectionJobsError::InternalServer(ref cause) => cause,
ListKeyPhrasesDetectionJobsError::InvalidFilter(ref cause) => cause,
ListKeyPhrasesDetectionJobsError::InvalidRequest(ref cause) => cause,
ListKeyPhrasesDetectionJobsError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListSentimentDetectionJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListSentimentDetectionJobsError {
fn description(&self) -> &str {
match *self {
ListSentimentDetectionJobsError::InternalServer(ref cause) => cause,
ListSentimentDetectionJobsError::InvalidFilter(ref cause) => cause,
ListSentimentDetectionJobsError::InvalidRequest(ref cause) => cause,
ListSentimentDetectionJobsError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTagsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsForResourceError {
fn description(&self) -> &str {
match *self {
ListTagsForResourceError::InternalServer(ref cause) => cause,
ListTagsForResourceError::InvalidRequest(ref cause) => cause,
ListTagsForResourceError::ResourceNotFound(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTopicsDetectionJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTopicsDetectionJobsError {
fn description(&self) -> &str {
match *self {
ListTopicsDetectionJobsError::InternalServer(ref cause) => cause,
ListTopicsDetectionJobsError::InvalidFilter(ref cause) => cause,
ListTopicsDetectionJobsError::InvalidRequest(ref cause) => cause,
ListTopicsDetectionJobsError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartDocumentClassificationJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartDocumentClassificationJobError {
fn description(&self) -> &str {
match *self {
StartDocumentClassificationJobError::InternalServer(ref cause) => cause,
StartDocumentClassificationJobError::InvalidRequest(ref cause) => cause,
StartDocumentClassificationJobError::KmsKeyValidation(ref cause) => cause,
StartDocumentClassificationJobError::ResourceNotFound(ref cause) => cause,
StartDocumentClassificationJobError::ResourceUnavailable(ref cause) => cause,
StartDocumentClassificationJobError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartDominantLanguageDetectionJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartDominantLanguageDetectionJobError {
fn description(&self) -> &str {
match *self {
StartDominantLanguageDetectionJobError::InternalServer(ref cause) => cause,
StartDominantLanguageDetectionJobError::InvalidRequest(ref cause) => cause,
StartDominantLanguageDetectionJobError::KmsKeyValidation(ref cause) => cause,
StartDominantLanguageDetectionJobError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartEntitiesDetectionJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartEntitiesDetectionJobError {
fn description(&self) -> &str {
match *self {
StartEntitiesDetectionJobError::InternalServer(ref cause) => cause,
StartEntitiesDetectionJobError::InvalidRequest(ref cause) => cause,
StartEntitiesDetectionJobError::KmsKeyValidation(ref cause) => cause,
StartEntitiesDetectionJobError::ResourceNotFound(ref cause) => cause,
StartEntitiesDetectionJobError::ResourceUnavailable(ref cause) => cause,
StartEntitiesDetectionJobError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartKeyPhrasesDetectionJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartKeyPhrasesDetectionJobError {
fn description(&self) -> &str {
match *self {
StartKeyPhrasesDetectionJobError::InternalServer(ref cause) => cause,
StartKeyPhrasesDetectionJobError::InvalidRequest(ref cause) => cause,
StartKeyPhrasesDetectionJobError::KmsKeyValidation(ref cause) => cause,
StartKeyPhrasesDetectionJobError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartSentimentDetectionJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartSentimentDetectionJobError {
fn description(&self) -> &str {
match *self {
StartSentimentDetectionJobError::InternalServer(ref cause) => cause,
StartSentimentDetectionJobError::InvalidRequest(ref cause) => cause,
StartSentimentDetectionJobError::KmsKeyValidation(ref cause) => cause,
StartSentimentDetectionJobError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartTopicsDetectionJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartTopicsDetectionJobError {
fn description(&self) -> &str {
match *self {
StartTopicsDetectionJobError::InternalServer(ref cause) => cause,
StartTopicsDetectionJobError::InvalidRequest(ref cause) => cause,
StartTopicsDetectionJobError::KmsKeyValidation(ref cause) => cause,
StartTopicsDetectionJobError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StopDominantLanguageDetectionJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopDominantLanguageDetectionJobError {
fn description(&self) -> &str {
match *self {
StopDominantLanguageDetectionJobError::InternalServer(ref cause) => cause,
StopDominantLanguageDetectionJobError::InvalidRequest(ref cause) => cause,
StopDominantLanguageDetectionJobError::JobNotFound(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StopEntitiesDetectionJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopEntitiesDetectionJobError {
fn description(&self) -> &str {
match *self {
StopEntitiesDetectionJobError::InternalServer(ref cause) => cause,
StopEntitiesDetectionJobError::InvalidRequest(ref cause) => cause,
StopEntitiesDetectionJobError::JobNotFound(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StopKeyPhrasesDetectionJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopKeyPhrasesDetectionJobError {
fn description(&self) -> &str {
match *self {
StopKeyPhrasesDetectionJobError::InternalServer(ref cause) => cause,
StopKeyPhrasesDetectionJobError::InvalidRequest(ref cause) => cause,
StopKeyPhrasesDetectionJobError::JobNotFound(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StopSentimentDetectionJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopSentimentDetectionJobError {
fn description(&self) -> &str {
match *self {
StopSentimentDetectionJobError::InternalServer(ref cause) => cause,
StopSentimentDetectionJobError::InvalidRequest(ref cause) => cause,
StopSentimentDetectionJobError::JobNotFound(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StopTrainingDocumentClassifierError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopTrainingDocumentClassifierError {
fn description(&self) -> &str {
match *self {
StopTrainingDocumentClassifierError::InternalServer(ref cause) => cause,
StopTrainingDocumentClassifierError::InvalidRequest(ref cause) => cause,
StopTrainingDocumentClassifierError::ResourceNotFound(ref cause) => cause,
StopTrainingDocumentClassifierError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StopTrainingEntityRecognizerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopTrainingEntityRecognizerError {
fn description(&self) -> &str {
match *self {
StopTrainingEntityRecognizerError::InternalServer(ref cause) => cause,
StopTrainingEntityRecognizerError::InvalidRequest(ref cause) => cause,
StopTrainingEntityRecognizerError::ResourceNotFound(ref cause) => cause,
StopTrainingEntityRecognizerError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for TagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagResourceError {
fn description(&self) -> &str {
match *self {
TagResourceError::ConcurrentModification(ref cause) => cause,
TagResourceError::InternalServer(ref cause) => cause,
TagResourceError::InvalidRequest(ref cause) => cause,
TagResourceError::ResourceNotFound(ref cause) => cause,
TagResourceError::TooManyTags(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagResourceError {
fn description(&self) -> &str {
match *self {
UntagResourceError::ConcurrentModification(ref cause) => cause,
UntagResourceError::InternalServer(ref cause) => cause,
UntagResourceError::InvalidRequest(ref cause) => cause,
UntagResourceError::ResourceNotFound(ref cause) => cause,
UntagResourceError::TooManyTagKeys(ref cause) => cause,
}
}
}
pub trait Comprehend {
fn batch_detect_dominant_language(
&self,
input: BatchDetectDominantLanguageRequest,
) -> RusotoFuture<BatchDetectDominantLanguageResponse, BatchDetectDominantLanguageError>;
fn batch_detect_entities(
&self,
input: BatchDetectEntitiesRequest,
) -> RusotoFuture<BatchDetectEntitiesResponse, BatchDetectEntitiesError>;
fn batch_detect_key_phrases(
&self,
input: BatchDetectKeyPhrasesRequest,
) -> RusotoFuture<BatchDetectKeyPhrasesResponse, BatchDetectKeyPhrasesError>;
fn batch_detect_sentiment(
&self,
input: BatchDetectSentimentRequest,
) -> RusotoFuture<BatchDetectSentimentResponse, BatchDetectSentimentError>;
fn batch_detect_syntax(
&self,
input: BatchDetectSyntaxRequest,
) -> RusotoFuture<BatchDetectSyntaxResponse, BatchDetectSyntaxError>;
fn create_document_classifier(
&self,
input: CreateDocumentClassifierRequest,
) -> RusotoFuture<CreateDocumentClassifierResponse, CreateDocumentClassifierError>;
fn create_entity_recognizer(
&self,
input: CreateEntityRecognizerRequest,
) -> RusotoFuture<CreateEntityRecognizerResponse, CreateEntityRecognizerError>;
fn delete_document_classifier(
&self,
input: DeleteDocumentClassifierRequest,
) -> RusotoFuture<DeleteDocumentClassifierResponse, DeleteDocumentClassifierError>;
fn delete_entity_recognizer(
&self,
input: DeleteEntityRecognizerRequest,
) -> RusotoFuture<DeleteEntityRecognizerResponse, DeleteEntityRecognizerError>;
fn describe_document_classification_job(
&self,
input: DescribeDocumentClassificationJobRequest,
) -> RusotoFuture<
DescribeDocumentClassificationJobResponse,
DescribeDocumentClassificationJobError,
>;
fn describe_document_classifier(
&self,
input: DescribeDocumentClassifierRequest,
) -> RusotoFuture<DescribeDocumentClassifierResponse, DescribeDocumentClassifierError>;
fn describe_dominant_language_detection_job(
&self,
input: DescribeDominantLanguageDetectionJobRequest,
) -> RusotoFuture<
DescribeDominantLanguageDetectionJobResponse,
DescribeDominantLanguageDetectionJobError,
>;
fn describe_entities_detection_job(
&self,
input: DescribeEntitiesDetectionJobRequest,
) -> RusotoFuture<DescribeEntitiesDetectionJobResponse, DescribeEntitiesDetectionJobError>;
fn describe_entity_recognizer(
&self,
input: DescribeEntityRecognizerRequest,
) -> RusotoFuture<DescribeEntityRecognizerResponse, DescribeEntityRecognizerError>;
fn describe_key_phrases_detection_job(
&self,
input: DescribeKeyPhrasesDetectionJobRequest,
) -> RusotoFuture<DescribeKeyPhrasesDetectionJobResponse, DescribeKeyPhrasesDetectionJobError>;
fn describe_sentiment_detection_job(
&self,
input: DescribeSentimentDetectionJobRequest,
) -> RusotoFuture<DescribeSentimentDetectionJobResponse, DescribeSentimentDetectionJobError>;
fn describe_topics_detection_job(
&self,
input: DescribeTopicsDetectionJobRequest,
) -> RusotoFuture<DescribeTopicsDetectionJobResponse, DescribeTopicsDetectionJobError>;
fn detect_dominant_language(
&self,
input: DetectDominantLanguageRequest,
) -> RusotoFuture<DetectDominantLanguageResponse, DetectDominantLanguageError>;
fn detect_entities(
&self,
input: DetectEntitiesRequest,
) -> RusotoFuture<DetectEntitiesResponse, DetectEntitiesError>;
fn detect_key_phrases(
&self,
input: DetectKeyPhrasesRequest,
) -> RusotoFuture<DetectKeyPhrasesResponse, DetectKeyPhrasesError>;
fn detect_sentiment(
&self,
input: DetectSentimentRequest,
) -> RusotoFuture<DetectSentimentResponse, DetectSentimentError>;
fn detect_syntax(
&self,
input: DetectSyntaxRequest,
) -> RusotoFuture<DetectSyntaxResponse, DetectSyntaxError>;
fn list_document_classification_jobs(
&self,
input: ListDocumentClassificationJobsRequest,
) -> RusotoFuture<ListDocumentClassificationJobsResponse, ListDocumentClassificationJobsError>;
fn list_document_classifiers(
&self,
input: ListDocumentClassifiersRequest,
) -> RusotoFuture<ListDocumentClassifiersResponse, ListDocumentClassifiersError>;
fn list_dominant_language_detection_jobs(
&self,
input: ListDominantLanguageDetectionJobsRequest,
) -> RusotoFuture<
ListDominantLanguageDetectionJobsResponse,
ListDominantLanguageDetectionJobsError,
>;
fn list_entities_detection_jobs(
&self,
input: ListEntitiesDetectionJobsRequest,
) -> RusotoFuture<ListEntitiesDetectionJobsResponse, ListEntitiesDetectionJobsError>;
fn list_entity_recognizers(
&self,
input: ListEntityRecognizersRequest,
) -> RusotoFuture<ListEntityRecognizersResponse, ListEntityRecognizersError>;
fn list_key_phrases_detection_jobs(
&self,
input: ListKeyPhrasesDetectionJobsRequest,
) -> RusotoFuture<ListKeyPhrasesDetectionJobsResponse, ListKeyPhrasesDetectionJobsError>;
fn list_sentiment_detection_jobs(
&self,
input: ListSentimentDetectionJobsRequest,
) -> RusotoFuture<ListSentimentDetectionJobsResponse, ListSentimentDetectionJobsError>;
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError>;
fn list_topics_detection_jobs(
&self,
input: ListTopicsDetectionJobsRequest,
) -> RusotoFuture<ListTopicsDetectionJobsResponse, ListTopicsDetectionJobsError>;
fn start_document_classification_job(
&self,
input: StartDocumentClassificationJobRequest,
) -> RusotoFuture<StartDocumentClassificationJobResponse, StartDocumentClassificationJobError>;
fn start_dominant_language_detection_job(
&self,
input: StartDominantLanguageDetectionJobRequest,
) -> RusotoFuture<
StartDominantLanguageDetectionJobResponse,
StartDominantLanguageDetectionJobError,
>;
fn start_entities_detection_job(
&self,
input: StartEntitiesDetectionJobRequest,
) -> RusotoFuture<StartEntitiesDetectionJobResponse, StartEntitiesDetectionJobError>;
fn start_key_phrases_detection_job(
&self,
input: StartKeyPhrasesDetectionJobRequest,
) -> RusotoFuture<StartKeyPhrasesDetectionJobResponse, StartKeyPhrasesDetectionJobError>;
fn start_sentiment_detection_job(
&self,
input: StartSentimentDetectionJobRequest,
) -> RusotoFuture<StartSentimentDetectionJobResponse, StartSentimentDetectionJobError>;
fn start_topics_detection_job(
&self,
input: StartTopicsDetectionJobRequest,
) -> RusotoFuture<StartTopicsDetectionJobResponse, StartTopicsDetectionJobError>;
fn stop_dominant_language_detection_job(
&self,
input: StopDominantLanguageDetectionJobRequest,
) -> RusotoFuture<StopDominantLanguageDetectionJobResponse, StopDominantLanguageDetectionJobError>;
fn stop_entities_detection_job(
&self,
input: StopEntitiesDetectionJobRequest,
) -> RusotoFuture<StopEntitiesDetectionJobResponse, StopEntitiesDetectionJobError>;
fn stop_key_phrases_detection_job(
&self,
input: StopKeyPhrasesDetectionJobRequest,
) -> RusotoFuture<StopKeyPhrasesDetectionJobResponse, StopKeyPhrasesDetectionJobError>;
fn stop_sentiment_detection_job(
&self,
input: StopSentimentDetectionJobRequest,
) -> RusotoFuture<StopSentimentDetectionJobResponse, StopSentimentDetectionJobError>;
fn stop_training_document_classifier(
&self,
input: StopTrainingDocumentClassifierRequest,
) -> RusotoFuture<StopTrainingDocumentClassifierResponse, StopTrainingDocumentClassifierError>;
fn stop_training_entity_recognizer(
&self,
input: StopTrainingEntityRecognizerRequest,
) -> RusotoFuture<StopTrainingEntityRecognizerResponse, StopTrainingEntityRecognizerError>;
fn tag_resource(
&self,
input: TagResourceRequest,
) -> RusotoFuture<TagResourceResponse, TagResourceError>;
fn untag_resource(
&self,
input: UntagResourceRequest,
) -> RusotoFuture<UntagResourceResponse, UntagResourceError>;
}
#[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,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
ComprehendClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl Comprehend for ComprehendClient {
fn batch_detect_dominant_language(
&self,
input: BatchDetectDominantLanguageRequest,
) -> RusotoFuture<BatchDetectDominantLanguageResponse, BatchDetectDominantLanguageError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.BatchDetectDominantLanguage",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<BatchDetectDominantLanguageResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(BatchDetectDominantLanguageError::from_response(response))
}))
}
})
}
fn batch_detect_entities(
&self,
input: BatchDetectEntitiesRequest,
) -> RusotoFuture<BatchDetectEntitiesResponse, BatchDetectEntitiesError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.BatchDetectEntities");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<BatchDetectEntitiesResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(BatchDetectEntitiesError::from_response(response))
}),
)
}
})
}
fn batch_detect_key_phrases(
&self,
input: BatchDetectKeyPhrasesRequest,
) -> RusotoFuture<BatchDetectKeyPhrasesResponse, BatchDetectKeyPhrasesError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.BatchDetectKeyPhrases");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<BatchDetectKeyPhrasesResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(BatchDetectKeyPhrasesError::from_response(response))
}),
)
}
})
}
fn batch_detect_sentiment(
&self,
input: BatchDetectSentimentRequest,
) -> RusotoFuture<BatchDetectSentimentResponse, BatchDetectSentimentError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.BatchDetectSentiment");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<BatchDetectSentimentResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(BatchDetectSentimentError::from_response(response))
}),
)
}
})
}
fn batch_detect_syntax(
&self,
input: BatchDetectSyntaxRequest,
) -> RusotoFuture<BatchDetectSyntaxResponse, BatchDetectSyntaxError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.BatchDetectSyntax");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<BatchDetectSyntaxResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(BatchDetectSyntaxError::from_response(response))),
)
}
})
}
fn create_document_classifier(
&self,
input: CreateDocumentClassifierRequest,
) -> RusotoFuture<CreateDocumentClassifierResponse, CreateDocumentClassifierError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.CreateDocumentClassifier",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateDocumentClassifierResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateDocumentClassifierError::from_response(response))
}))
}
})
}
fn create_entity_recognizer(
&self,
input: CreateEntityRecognizerRequest,
) -> RusotoFuture<CreateEntityRecognizerResponse, CreateEntityRecognizerError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.CreateEntityRecognizer");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateEntityRecognizerResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateEntityRecognizerError::from_response(response))
}),
)
}
})
}
fn delete_document_classifier(
&self,
input: DeleteDocumentClassifierRequest,
) -> RusotoFuture<DeleteDocumentClassifierResponse, DeleteDocumentClassifierError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.DeleteDocumentClassifier",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteDocumentClassifierResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteDocumentClassifierError::from_response(response))
}))
}
})
}
fn delete_entity_recognizer(
&self,
input: DeleteEntityRecognizerRequest,
) -> RusotoFuture<DeleteEntityRecognizerResponse, DeleteEntityRecognizerError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.DeleteEntityRecognizer");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteEntityRecognizerResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteEntityRecognizerError::from_response(response))
}),
)
}
})
}
fn describe_document_classification_job(
&self,
input: DescribeDocumentClassificationJobRequest,
) -> RusotoFuture<
DescribeDocumentClassificationJobResponse,
DescribeDocumentClassificationJobError,
> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeDocumentClassificationJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeDocumentClassificationJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeDocumentClassificationJobError::from_response(
response,
))
}))
}
})
}
fn describe_document_classifier(
&self,
input: DescribeDocumentClassifierRequest,
) -> RusotoFuture<DescribeDocumentClassifierResponse, DescribeDocumentClassifierError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeDocumentClassifier",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeDocumentClassifierResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeDocumentClassifierError::from_response(response))
}))
}
})
}
fn describe_dominant_language_detection_job(
&self,
input: DescribeDominantLanguageDetectionJobRequest,
) -> RusotoFuture<
DescribeDominantLanguageDetectionJobResponse,
DescribeDominantLanguageDetectionJobError,
> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeDominantLanguageDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeDominantLanguageDetectionJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeDominantLanguageDetectionJobError::from_response(
response,
))
}))
}
})
}
fn describe_entities_detection_job(
&self,
input: DescribeEntitiesDetectionJobRequest,
) -> RusotoFuture<DescribeEntitiesDetectionJobResponse, DescribeEntitiesDetectionJobError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeEntitiesDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeEntitiesDetectionJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeEntitiesDetectionJobError::from_response(response))
}))
}
})
}
fn describe_entity_recognizer(
&self,
input: DescribeEntityRecognizerRequest,
) -> RusotoFuture<DescribeEntityRecognizerResponse, DescribeEntityRecognizerError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeEntityRecognizer",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeEntityRecognizerResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeEntityRecognizerError::from_response(response))
}))
}
})
}
fn describe_key_phrases_detection_job(
&self,
input: DescribeKeyPhrasesDetectionJobRequest,
) -> RusotoFuture<DescribeKeyPhrasesDetectionJobResponse, DescribeKeyPhrasesDetectionJobError>
{
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeKeyPhrasesDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeKeyPhrasesDetectionJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeKeyPhrasesDetectionJobError::from_response(response))
}))
}
})
}
fn describe_sentiment_detection_job(
&self,
input: DescribeSentimentDetectionJobRequest,
) -> RusotoFuture<DescribeSentimentDetectionJobResponse, DescribeSentimentDetectionJobError>
{
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeSentimentDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeSentimentDetectionJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeSentimentDetectionJobError::from_response(response))
}))
}
})
}
fn describe_topics_detection_job(
&self,
input: DescribeTopicsDetectionJobRequest,
) -> RusotoFuture<DescribeTopicsDetectionJobResponse, DescribeTopicsDetectionJobError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.DescribeTopicsDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeTopicsDetectionJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeTopicsDetectionJobError::from_response(response))
}))
}
})
}
fn detect_dominant_language(
&self,
input: DetectDominantLanguageRequest,
) -> RusotoFuture<DetectDominantLanguageResponse, DetectDominantLanguageError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.DetectDominantLanguage");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DetectDominantLanguageResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DetectDominantLanguageError::from_response(response))
}),
)
}
})
}
fn detect_entities(
&self,
input: DetectEntitiesRequest,
) -> RusotoFuture<DetectEntitiesResponse, DetectEntitiesError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.DetectEntities");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DetectEntitiesResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DetectEntitiesError::from_response(response))),
)
}
})
}
fn detect_key_phrases(
&self,
input: DetectKeyPhrasesRequest,
) -> RusotoFuture<DetectKeyPhrasesResponse, DetectKeyPhrasesError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.DetectKeyPhrases");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DetectKeyPhrasesResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DetectKeyPhrasesError::from_response(response))),
)
}
})
}
fn detect_sentiment(
&self,
input: DetectSentimentRequest,
) -> RusotoFuture<DetectSentimentResponse, DetectSentimentError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.DetectSentiment");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DetectSentimentResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DetectSentimentError::from_response(response))),
)
}
})
}
fn detect_syntax(
&self,
input: DetectSyntaxRequest,
) -> RusotoFuture<DetectSyntaxResponse, DetectSyntaxError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.DetectSyntax");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DetectSyntaxResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DetectSyntaxError::from_response(response))),
)
}
})
}
fn list_document_classification_jobs(
&self,
input: ListDocumentClassificationJobsRequest,
) -> RusotoFuture<ListDocumentClassificationJobsResponse, ListDocumentClassificationJobsError>
{
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.ListDocumentClassificationJobs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListDocumentClassificationJobsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListDocumentClassificationJobsError::from_response(response))
}))
}
})
}
fn list_document_classifiers(
&self,
input: ListDocumentClassifiersRequest,
) -> RusotoFuture<ListDocumentClassifiersResponse, ListDocumentClassifiersError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.ListDocumentClassifiers",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListDocumentClassifiersResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListDocumentClassifiersError::from_response(response))
}))
}
})
}
fn list_dominant_language_detection_jobs(
&self,
input: ListDominantLanguageDetectionJobsRequest,
) -> RusotoFuture<
ListDominantLanguageDetectionJobsResponse,
ListDominantLanguageDetectionJobsError,
> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.ListDominantLanguageDetectionJobs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListDominantLanguageDetectionJobsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListDominantLanguageDetectionJobsError::from_response(
response,
))
}))
}
})
}
fn list_entities_detection_jobs(
&self,
input: ListEntitiesDetectionJobsRequest,
) -> RusotoFuture<ListEntitiesDetectionJobsResponse, ListEntitiesDetectionJobsError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.ListEntitiesDetectionJobs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListEntitiesDetectionJobsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListEntitiesDetectionJobsError::from_response(response))
}))
}
})
}
fn list_entity_recognizers(
&self,
input: ListEntityRecognizersRequest,
) -> RusotoFuture<ListEntityRecognizersResponse, ListEntityRecognizersError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.ListEntityRecognizers");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListEntityRecognizersResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListEntityRecognizersError::from_response(response))
}),
)
}
})
}
fn list_key_phrases_detection_jobs(
&self,
input: ListKeyPhrasesDetectionJobsRequest,
) -> RusotoFuture<ListKeyPhrasesDetectionJobsResponse, ListKeyPhrasesDetectionJobsError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.ListKeyPhrasesDetectionJobs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListKeyPhrasesDetectionJobsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListKeyPhrasesDetectionJobsError::from_response(response))
}))
}
})
}
fn list_sentiment_detection_jobs(
&self,
input: ListSentimentDetectionJobsRequest,
) -> RusotoFuture<ListSentimentDetectionJobsResponse, ListSentimentDetectionJobsError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.ListSentimentDetectionJobs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListSentimentDetectionJobsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListSentimentDetectionJobsError::from_response(response))
}))
}
})
}
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.ListTagsForResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsForResourceResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListTagsForResourceError::from_response(response))
}),
)
}
})
}
fn list_topics_detection_jobs(
&self,
input: ListTopicsDetectionJobsRequest,
) -> RusotoFuture<ListTopicsDetectionJobsResponse, ListTopicsDetectionJobsError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.ListTopicsDetectionJobs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListTopicsDetectionJobsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListTopicsDetectionJobsError::from_response(response))
}))
}
})
}
fn start_document_classification_job(
&self,
input: StartDocumentClassificationJobRequest,
) -> RusotoFuture<StartDocumentClassificationJobResponse, StartDocumentClassificationJobError>
{
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.StartDocumentClassificationJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StartDocumentClassificationJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StartDocumentClassificationJobError::from_response(response))
}))
}
})
}
fn start_dominant_language_detection_job(
&self,
input: StartDominantLanguageDetectionJobRequest,
) -> RusotoFuture<
StartDominantLanguageDetectionJobResponse,
StartDominantLanguageDetectionJobError,
> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.StartDominantLanguageDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StartDominantLanguageDetectionJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StartDominantLanguageDetectionJobError::from_response(
response,
))
}))
}
})
}
fn start_entities_detection_job(
&self,
input: StartEntitiesDetectionJobRequest,
) -> RusotoFuture<StartEntitiesDetectionJobResponse, StartEntitiesDetectionJobError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.StartEntitiesDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StartEntitiesDetectionJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StartEntitiesDetectionJobError::from_response(response))
}))
}
})
}
fn start_key_phrases_detection_job(
&self,
input: StartKeyPhrasesDetectionJobRequest,
) -> RusotoFuture<StartKeyPhrasesDetectionJobResponse, StartKeyPhrasesDetectionJobError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.StartKeyPhrasesDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StartKeyPhrasesDetectionJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StartKeyPhrasesDetectionJobError::from_response(response))
}))
}
})
}
fn start_sentiment_detection_job(
&self,
input: StartSentimentDetectionJobRequest,
) -> RusotoFuture<StartSentimentDetectionJobResponse, StartSentimentDetectionJobError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.StartSentimentDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StartSentimentDetectionJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StartSentimentDetectionJobError::from_response(response))
}))
}
})
}
fn start_topics_detection_job(
&self,
input: StartTopicsDetectionJobRequest,
) -> RusotoFuture<StartTopicsDetectionJobResponse, StartTopicsDetectionJobError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.StartTopicsDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StartTopicsDetectionJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StartTopicsDetectionJobError::from_response(response))
}))
}
})
}
fn stop_dominant_language_detection_job(
&self,
input: StopDominantLanguageDetectionJobRequest,
) -> RusotoFuture<StopDominantLanguageDetectionJobResponse, StopDominantLanguageDetectionJobError>
{
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.StopDominantLanguageDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StopDominantLanguageDetectionJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StopDominantLanguageDetectionJobError::from_response(
response,
))
}))
}
})
}
fn stop_entities_detection_job(
&self,
input: StopEntitiesDetectionJobRequest,
) -> RusotoFuture<StopEntitiesDetectionJobResponse, StopEntitiesDetectionJobError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.StopEntitiesDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StopEntitiesDetectionJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StopEntitiesDetectionJobError::from_response(response))
}))
}
})
}
fn stop_key_phrases_detection_job(
&self,
input: StopKeyPhrasesDetectionJobRequest,
) -> RusotoFuture<StopKeyPhrasesDetectionJobResponse, StopKeyPhrasesDetectionJobError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.StopKeyPhrasesDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StopKeyPhrasesDetectionJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StopKeyPhrasesDetectionJobError::from_response(response))
}))
}
})
}
fn stop_sentiment_detection_job(
&self,
input: StopSentimentDetectionJobRequest,
) -> RusotoFuture<StopSentimentDetectionJobResponse, StopSentimentDetectionJobError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.StopSentimentDetectionJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StopSentimentDetectionJobResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StopSentimentDetectionJobError::from_response(response))
}))
}
})
}
fn stop_training_document_classifier(
&self,
input: StopTrainingDocumentClassifierRequest,
) -> RusotoFuture<StopTrainingDocumentClassifierResponse, StopTrainingDocumentClassifierError>
{
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.StopTrainingDocumentClassifier",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StopTrainingDocumentClassifierResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StopTrainingDocumentClassifierError::from_response(response))
}))
}
})
}
fn stop_training_entity_recognizer(
&self,
input: StopTrainingEntityRecognizerRequest,
) -> RusotoFuture<StopTrainingEntityRecognizerResponse, StopTrainingEntityRecognizerError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Comprehend_20171127.StopTrainingEntityRecognizer",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StopTrainingEntityRecognizerResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StopTrainingEntityRecognizerError::from_response(response))
}))
}
})
}
fn tag_resource(
&self,
input: TagResourceRequest,
) -> RusotoFuture<TagResourceResponse, TagResourceError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.TagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<TagResourceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TagResourceError::from_response(response))),
)
}
})
}
fn untag_resource(
&self,
input: UntagResourceRequest,
) -> RusotoFuture<UntagResourceResponse, UntagResourceError> {
let mut request = SignedRequest::new("POST", "comprehend", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Comprehend_20171127.UntagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UntagResourceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UntagResourceError::from_response(response))),
)
}
})
}
}