use std::error::Error;
use std::fmt;
use async_trait::async_trait;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError};
use rusoto_core::proto;
use rusoto_core::request::HttpResponse;
use rusoto_core::signature::SignedRequest;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
impl FraudDetectorClient {
fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
let mut request =
SignedRequest::new(http_method, "frauddetector", &self.region, request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
request
}
async fn sign_and_dispatch<E>(
&self,
request: SignedRequest,
from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
) -> Result<HttpResponse, RusotoError<E>> {
let mut response = self.client.sign_and_dispatch(request).await?;
if !response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
return Err(from_response(response));
}
Ok(response)
}
}
use serde_json;
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct FraudDetectorBatchCreateVariableError {
#[serde(rename = "code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<i64>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct BatchCreateVariableRequest {
#[serde(rename = "variableEntries")]
pub variable_entries: Vec<VariableEntry>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BatchCreateVariableResult {
#[serde(rename = "errors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub errors: Option<Vec<FraudDetectorBatchCreateVariableError>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct FraudDetectorBatchGetVariableError {
#[serde(rename = "code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<i64>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct BatchGetVariableRequest {
#[serde(rename = "names")]
pub names: Vec<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BatchGetVariableResult {
#[serde(rename = "errors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub errors: Option<Vec<FraudDetectorBatchGetVariableError>>,
#[serde(rename = "variables")]
#[serde(skip_serializing_if = "Option::is_none")]
pub variables: Option<Vec<Variable>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateDetectorVersionRequest {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "detectorId")]
pub detector_id: String,
#[serde(rename = "externalModelEndpoints")]
#[serde(skip_serializing_if = "Option::is_none")]
pub external_model_endpoints: Option<Vec<String>>,
#[serde(rename = "modelVersions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_versions: Option<Vec<ModelVersion>>,
#[serde(rename = "ruleExecutionMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rule_execution_mode: Option<String>,
#[serde(rename = "rules")]
pub rules: Vec<Rule>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateDetectorVersionResult {
#[serde(rename = "detectorId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detector_id: Option<String>,
#[serde(rename = "detectorVersionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detector_version_id: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateModelVersionRequest {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "modelId")]
pub model_id: String,
#[serde(rename = "modelType")]
pub model_type: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateModelVersionResult {
#[serde(rename = "modelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_id: Option<String>,
#[serde(rename = "modelType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_type: Option<String>,
#[serde(rename = "modelVersionNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_version_number: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateRuleRequest {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "detectorId")]
pub detector_id: String,
#[serde(rename = "expression")]
pub expression: String,
#[serde(rename = "language")]
pub language: String,
#[serde(rename = "outcomes")]
pub outcomes: Vec<String>,
#[serde(rename = "ruleId")]
pub rule_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateRuleResult {
#[serde(rename = "rule")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rule: Option<Rule>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateVariableRequest {
#[serde(rename = "dataSource")]
pub data_source: String,
#[serde(rename = "dataType")]
pub data_type: String,
#[serde(rename = "defaultValue")]
pub default_value: String,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "variableType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub variable_type: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateVariableResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteDetectorRequest {
#[serde(rename = "detectorId")]
pub detector_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteDetectorResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteDetectorVersionRequest {
#[serde(rename = "detectorId")]
pub detector_id: String,
#[serde(rename = "detectorVersionId")]
pub detector_version_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteDetectorVersionResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteEventRequest {
#[serde(rename = "eventId")]
pub event_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteEventResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteRuleVersionRequest {
#[serde(rename = "detectorId")]
pub detector_id: String,
#[serde(rename = "ruleId")]
pub rule_id: String,
#[serde(rename = "ruleVersion")]
pub rule_version: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteRuleVersionResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeDetectorRequest {
#[serde(rename = "detectorId")]
pub detector_id: String,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeDetectorResult {
#[serde(rename = "detectorId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detector_id: Option<String>,
#[serde(rename = "detectorVersionSummaries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detector_version_summaries: Option<Vec<DetectorVersionSummary>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeModelVersionsRequest {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "modelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_id: Option<String>,
#[serde(rename = "modelType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_type: Option<String>,
#[serde(rename = "modelVersionNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_version_number: Option<String>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeModelVersionsResult {
#[serde(rename = "modelVersionDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_version_details: Option<Vec<ModelVersionDetail>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Detector {
#[serde(rename = "createdTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "detectorId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detector_id: Option<String>,
#[serde(rename = "lastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DetectorVersionSummary {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "detectorVersionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detector_version_id: Option<String>,
#[serde(rename = "lastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ExternalModel {
#[serde(rename = "createdTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<String>,
#[serde(rename = "inputConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_configuration: Option<ModelInputConfiguration>,
#[serde(rename = "lastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<String>,
#[serde(rename = "modelEndpoint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_endpoint: Option<String>,
#[serde(rename = "modelEndpointStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_endpoint_status: Option<String>,
#[serde(rename = "modelSource")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_source: Option<String>,
#[serde(rename = "outputConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_configuration: Option<ModelOutputConfiguration>,
#[serde(rename = "role")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role: Option<Role>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetDetectorVersionRequest {
#[serde(rename = "detectorId")]
pub detector_id: String,
#[serde(rename = "detectorVersionId")]
pub detector_version_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetDetectorVersionResult {
#[serde(rename = "createdTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "detectorId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detector_id: Option<String>,
#[serde(rename = "detectorVersionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detector_version_id: Option<String>,
#[serde(rename = "externalModelEndpoints")]
#[serde(skip_serializing_if = "Option::is_none")]
pub external_model_endpoints: Option<Vec<String>>,
#[serde(rename = "lastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<String>,
#[serde(rename = "modelVersions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_versions: Option<Vec<ModelVersion>>,
#[serde(rename = "ruleExecutionMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rule_execution_mode: Option<String>,
#[serde(rename = "rules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rules: Option<Vec<Rule>>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetDetectorsRequest {
#[serde(rename = "detectorId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detector_id: Option<String>,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetDetectorsResult {
#[serde(rename = "detectors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detectors: Option<Vec<Detector>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetExternalModelsRequest {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "modelEndpoint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_endpoint: Option<String>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetExternalModelsResult {
#[serde(rename = "externalModels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub external_models: Option<Vec<ExternalModel>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetModelVersionRequest {
#[serde(rename = "modelId")]
pub model_id: String,
#[serde(rename = "modelType")]
pub model_type: String,
#[serde(rename = "modelVersionNumber")]
pub model_version_number: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetModelVersionResult {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "modelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_id: Option<String>,
#[serde(rename = "modelType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_type: Option<String>,
#[serde(rename = "modelVersionNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_version_number: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetModelsRequest {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "modelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_id: Option<String>,
#[serde(rename = "modelType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_type: Option<String>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetModelsResult {
#[serde(rename = "models")]
#[serde(skip_serializing_if = "Option::is_none")]
pub models: Option<Vec<Model>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetOutcomesRequest {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetOutcomesResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "outcomes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub outcomes: Option<Vec<Outcome>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetPredictionRequest {
#[serde(rename = "detectorId")]
pub detector_id: String,
#[serde(rename = "detectorVersionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detector_version_id: Option<String>,
#[serde(rename = "eventAttributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_attributes: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "eventId")]
pub event_id: String,
#[serde(rename = "externalModelEndpointDataBlobs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub external_model_endpoint_data_blobs:
Option<::std::collections::HashMap<String, ModelEndpointDataBlob>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetPredictionResult {
#[serde(rename = "modelScores")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_scores: Option<Vec<ModelScores>>,
#[serde(rename = "outcomes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub outcomes: Option<Vec<String>>,
#[serde(rename = "ruleResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rule_results: Option<Vec<RuleResult>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetRulesRequest {
#[serde(rename = "detectorId")]
pub detector_id: String,
#[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>,
#[serde(rename = "ruleId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rule_id: Option<String>,
#[serde(rename = "ruleVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rule_version: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetRulesResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ruleDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rule_details: Option<Vec<RuleDetail>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetVariablesRequest {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetVariablesResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "variables")]
#[serde(skip_serializing_if = "Option::is_none")]
pub variables: Option<Vec<Variable>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct LabelSchema {
#[serde(rename = "labelKey")]
pub label_key: String,
#[serde(rename = "labelMapper")]
pub label_mapper: ::std::collections::HashMap<String, Vec<String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Model {
#[serde(rename = "createdTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "labelSchema")]
#[serde(skip_serializing_if = "Option::is_none")]
pub label_schema: Option<LabelSchema>,
#[serde(rename = "lastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<String>,
#[serde(rename = "modelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_id: Option<String>,
#[serde(rename = "modelType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_type: Option<String>,
#[serde(rename = "modelVariables")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_variables: Option<Vec<ModelVariable>>,
#[serde(rename = "trainingDataSource")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_data_source: Option<TrainingDataSource>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ModelEndpointDataBlob {
#[serde(rename = "byteBuffer")]
#[serde(
deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
default
)]
#[serde(skip_serializing_if = "Option::is_none")]
pub byte_buffer: Option<bytes::Bytes>,
#[serde(rename = "contentType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct ModelInputConfiguration {
#[serde(rename = "csvInputTemplate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub csv_input_template: Option<String>,
#[serde(rename = "format")]
#[serde(skip_serializing_if = "Option::is_none")]
pub format: Option<String>,
#[serde(rename = "isOpaque")]
pub is_opaque: bool,
#[serde(rename = "jsonInputTemplate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub json_input_template: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct ModelOutputConfiguration {
#[serde(rename = "csvIndexToVariableMap")]
#[serde(skip_serializing_if = "Option::is_none")]
pub csv_index_to_variable_map: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "format")]
pub format: String,
#[serde(rename = "jsonKeyToVariableMap")]
#[serde(skip_serializing_if = "Option::is_none")]
pub json_key_to_variable_map: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ModelScores {
#[serde(rename = "modelVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_version: Option<ModelVersion>,
#[serde(rename = "scores")]
#[serde(skip_serializing_if = "Option::is_none")]
pub scores: Option<::std::collections::HashMap<String, f32>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct ModelVariable {
#[serde(rename = "index")]
#[serde(skip_serializing_if = "Option::is_none")]
pub index: Option<i64>,
#[serde(rename = "name")]
pub name: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct ModelVersion {
#[serde(rename = "modelId")]
pub model_id: String,
#[serde(rename = "modelType")]
pub model_type: String,
#[serde(rename = "modelVersionNumber")]
pub model_version_number: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ModelVersionDetail {
#[serde(rename = "createdTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "labelSchema")]
#[serde(skip_serializing_if = "Option::is_none")]
pub label_schema: Option<LabelSchema>,
#[serde(rename = "lastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<String>,
#[serde(rename = "modelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_id: Option<String>,
#[serde(rename = "modelType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_type: Option<String>,
#[serde(rename = "modelVariables")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_variables: Option<Vec<ModelVariable>>,
#[serde(rename = "modelVersionNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_version_number: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "trainingDataSource")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_data_source: Option<TrainingDataSource>,
#[serde(rename = "trainingMetrics")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_metrics: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "validationMetrics")]
#[serde(skip_serializing_if = "Option::is_none")]
pub validation_metrics: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Outcome {
#[serde(rename = "createdTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "lastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct PutDetectorRequest {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "detectorId")]
pub detector_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct PutDetectorResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct PutExternalModelRequest {
#[serde(rename = "inputConfiguration")]
pub input_configuration: ModelInputConfiguration,
#[serde(rename = "modelEndpoint")]
pub model_endpoint: String,
#[serde(rename = "modelEndpointStatus")]
pub model_endpoint_status: String,
#[serde(rename = "modelSource")]
pub model_source: String,
#[serde(rename = "outputConfiguration")]
pub output_configuration: ModelOutputConfiguration,
#[serde(rename = "role")]
pub role: Role,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct PutExternalModelResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct PutModelRequest {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "labelSchema")]
pub label_schema: LabelSchema,
#[serde(rename = "modelId")]
pub model_id: String,
#[serde(rename = "modelType")]
pub model_type: String,
#[serde(rename = "modelVariables")]
pub model_variables: Vec<ModelVariable>,
#[serde(rename = "trainingDataSource")]
pub training_data_source: TrainingDataSource,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct PutModelResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct PutOutcomeRequest {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "name")]
pub name: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct PutOutcomeResult {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct Role {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "name")]
pub name: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct Rule {
#[serde(rename = "detectorId")]
pub detector_id: String,
#[serde(rename = "ruleId")]
pub rule_id: String,
#[serde(rename = "ruleVersion")]
pub rule_version: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RuleDetail {
#[serde(rename = "createdTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "detectorId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detector_id: Option<String>,
#[serde(rename = "expression")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expression: Option<String>,
#[serde(rename = "language")]
#[serde(skip_serializing_if = "Option::is_none")]
pub language: Option<String>,
#[serde(rename = "lastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<String>,
#[serde(rename = "outcomes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub outcomes: Option<Vec<String>>,
#[serde(rename = "ruleId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rule_id: Option<String>,
#[serde(rename = "ruleVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rule_version: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RuleResult {
#[serde(rename = "outcomes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub outcomes: Option<Vec<String>>,
#[serde(rename = "ruleId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rule_id: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct TrainingDataSource {
#[serde(rename = "dataAccessRoleArn")]
pub data_access_role_arn: String,
#[serde(rename = "dataLocation")]
pub data_location: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateDetectorVersionMetadataRequest {
#[serde(rename = "description")]
pub description: String,
#[serde(rename = "detectorId")]
pub detector_id: String,
#[serde(rename = "detectorVersionId")]
pub detector_version_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateDetectorVersionMetadataResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateDetectorVersionRequest {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "detectorId")]
pub detector_id: String,
#[serde(rename = "detectorVersionId")]
pub detector_version_id: String,
#[serde(rename = "externalModelEndpoints")]
pub external_model_endpoints: Vec<String>,
#[serde(rename = "modelVersions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_versions: Option<Vec<ModelVersion>>,
#[serde(rename = "ruleExecutionMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rule_execution_mode: Option<String>,
#[serde(rename = "rules")]
pub rules: Vec<Rule>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateDetectorVersionResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateDetectorVersionStatusRequest {
#[serde(rename = "detectorId")]
pub detector_id: String,
#[serde(rename = "detectorVersionId")]
pub detector_version_id: String,
#[serde(rename = "status")]
pub status: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateDetectorVersionStatusResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateModelVersionRequest {
#[serde(rename = "description")]
pub description: String,
#[serde(rename = "modelId")]
pub model_id: String,
#[serde(rename = "modelType")]
pub model_type: String,
#[serde(rename = "modelVersionNumber")]
pub model_version_number: String,
#[serde(rename = "status")]
pub status: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateModelVersionResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateRuleMetadataRequest {
#[serde(rename = "description")]
pub description: String,
#[serde(rename = "rule")]
pub rule: Rule,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateRuleMetadataResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateRuleVersionRequest {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "expression")]
pub expression: String,
#[serde(rename = "language")]
pub language: String,
#[serde(rename = "outcomes")]
pub outcomes: Vec<String>,
#[serde(rename = "rule")]
pub rule: Rule,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateRuleVersionResult {
#[serde(rename = "rule")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rule: Option<Rule>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateVariableRequest {
#[serde(rename = "defaultValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_value: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "variableType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub variable_type: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateVariableResult {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Variable {
#[serde(rename = "createdTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<String>,
#[serde(rename = "dataSource")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_source: Option<String>,
#[serde(rename = "dataType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_type: Option<String>,
#[serde(rename = "defaultValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_value: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "lastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "variableType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub variable_type: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct VariableEntry {
#[serde(rename = "dataSource")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_source: Option<String>,
#[serde(rename = "dataType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_type: Option<String>,
#[serde(rename = "defaultValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_value: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "variableType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub variable_type: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum BatchCreateVariableError {
InternalServer(String),
Throttling(String),
}
impl BatchCreateVariableError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchCreateVariableError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(BatchCreateVariableError::InternalServer(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(BatchCreateVariableError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for BatchCreateVariableError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
BatchCreateVariableError::InternalServer(ref cause) => write!(f, "{}", cause),
BatchCreateVariableError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for BatchCreateVariableError {}
#[derive(Debug, PartialEq)]
pub enum BatchGetVariableError {
InternalServer(String),
Throttling(String),
}
impl BatchGetVariableError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchGetVariableError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(BatchGetVariableError::InternalServer(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(BatchGetVariableError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for BatchGetVariableError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
BatchGetVariableError::InternalServer(ref cause) => write!(f, "{}", cause),
BatchGetVariableError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for BatchGetVariableError {}
#[derive(Debug, PartialEq)]
pub enum CreateDetectorVersionError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl CreateDetectorVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateDetectorVersionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(CreateDetectorVersionError::InternalServer(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CreateDetectorVersionError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(CreateDetectorVersionError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateDetectorVersionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateDetectorVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
CreateDetectorVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
CreateDetectorVersionError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateDetectorVersionError {}
#[derive(Debug, PartialEq)]
pub enum CreateModelVersionError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl CreateModelVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateModelVersionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(CreateModelVersionError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CreateModelVersionError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(CreateModelVersionError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateModelVersionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateModelVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
CreateModelVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
CreateModelVersionError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateModelVersionError {}
#[derive(Debug, PartialEq)]
pub enum CreateRuleError {
InternalServer(String),
Throttling(String),
}
impl CreateRuleError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateRuleError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(CreateRuleError::InternalServer(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(CreateRuleError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateRuleError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateRuleError::InternalServer(ref cause) => write!(f, "{}", cause),
CreateRuleError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateRuleError {}
#[derive(Debug, PartialEq)]
pub enum CreateVariableError {
InternalServer(String),
Throttling(String),
}
impl CreateVariableError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateVariableError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(CreateVariableError::InternalServer(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(CreateVariableError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateVariableError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateVariableError::InternalServer(ref cause) => write!(f, "{}", cause),
CreateVariableError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateVariableError {}
#[derive(Debug, PartialEq)]
pub enum DeleteDetectorError {
Conflict(String),
InternalServer(String),
Throttling(String),
}
impl DeleteDetectorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDetectorError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConflictException" => {
return RusotoError::Service(DeleteDetectorError::Conflict(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(DeleteDetectorError::InternalServer(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(DeleteDetectorError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteDetectorError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteDetectorError::Conflict(ref cause) => write!(f, "{}", cause),
DeleteDetectorError::InternalServer(ref cause) => write!(f, "{}", cause),
DeleteDetectorError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteDetectorError {}
#[derive(Debug, PartialEq)]
pub enum DeleteDetectorVersionError {
Conflict(String),
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl DeleteDetectorVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDetectorVersionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConflictException" => {
return RusotoError::Service(DeleteDetectorVersionError::Conflict(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(DeleteDetectorVersionError::InternalServer(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteDetectorVersionError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(DeleteDetectorVersionError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteDetectorVersionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteDetectorVersionError::Conflict(ref cause) => write!(f, "{}", cause),
DeleteDetectorVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
DeleteDetectorVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DeleteDetectorVersionError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteDetectorVersionError {}
#[derive(Debug, PartialEq)]
pub enum DeleteEventError {
InternalServer(String),
Throttling(String),
}
impl DeleteEventError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteEventError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DeleteEventError::InternalServer(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(DeleteEventError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteEventError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteEventError::InternalServer(ref cause) => write!(f, "{}", cause),
DeleteEventError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteEventError {}
#[derive(Debug, PartialEq)]
pub enum DeleteRuleVersionError {
Conflict(String),
InternalServer(String),
Throttling(String),
}
impl DeleteRuleVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteRuleVersionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConflictException" => {
return RusotoError::Service(DeleteRuleVersionError::Conflict(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(DeleteRuleVersionError::InternalServer(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(DeleteRuleVersionError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteRuleVersionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteRuleVersionError::Conflict(ref cause) => write!(f, "{}", cause),
DeleteRuleVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
DeleteRuleVersionError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteRuleVersionError {}
#[derive(Debug, PartialEq)]
pub enum DescribeDetectorError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl DescribeDetectorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeDetectorError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DescribeDetectorError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeDetectorError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(DescribeDetectorError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeDetectorError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeDetectorError::InternalServer(ref cause) => write!(f, "{}", cause),
DescribeDetectorError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DescribeDetectorError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeDetectorError {}
#[derive(Debug, PartialEq)]
pub enum DescribeModelVersionsError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl DescribeModelVersionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeModelVersionsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DescribeModelVersionsError::InternalServer(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeModelVersionsError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(DescribeModelVersionsError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeModelVersionsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeModelVersionsError::InternalServer(ref cause) => write!(f, "{}", cause),
DescribeModelVersionsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DescribeModelVersionsError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeModelVersionsError {}
#[derive(Debug, PartialEq)]
pub enum GetDetectorVersionError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetDetectorVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDetectorVersionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetDetectorVersionError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetDetectorVersionError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(GetDetectorVersionError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetDetectorVersionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetDetectorVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
GetDetectorVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetDetectorVersionError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetDetectorVersionError {}
#[derive(Debug, PartialEq)]
pub enum GetDetectorsError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetDetectorsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDetectorsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetDetectorsError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetDetectorsError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(GetDetectorsError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetDetectorsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetDetectorsError::InternalServer(ref cause) => write!(f, "{}", cause),
GetDetectorsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetDetectorsError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetDetectorsError {}
#[derive(Debug, PartialEq)]
pub enum GetExternalModelsError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetExternalModelsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetExternalModelsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetExternalModelsError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetExternalModelsError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(GetExternalModelsError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetExternalModelsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetExternalModelsError::InternalServer(ref cause) => write!(f, "{}", cause),
GetExternalModelsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetExternalModelsError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetExternalModelsError {}
#[derive(Debug, PartialEq)]
pub enum GetModelVersionError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetModelVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetModelVersionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetModelVersionError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetModelVersionError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(GetModelVersionError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetModelVersionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetModelVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
GetModelVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetModelVersionError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetModelVersionError {}
#[derive(Debug, PartialEq)]
pub enum GetModelsError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetModelsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetModelsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetModelsError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetModelsError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(GetModelsError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetModelsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetModelsError::InternalServer(ref cause) => write!(f, "{}", cause),
GetModelsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetModelsError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetModelsError {}
#[derive(Debug, PartialEq)]
pub enum GetOutcomesError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetOutcomesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetOutcomesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetOutcomesError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetOutcomesError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(GetOutcomesError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetOutcomesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetOutcomesError::InternalServer(ref cause) => write!(f, "{}", cause),
GetOutcomesError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetOutcomesError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetOutcomesError {}
#[derive(Debug, PartialEq)]
pub enum GetPredictionError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetPredictionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetPredictionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetPredictionError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetPredictionError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(GetPredictionError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetPredictionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetPredictionError::InternalServer(ref cause) => write!(f, "{}", cause),
GetPredictionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetPredictionError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetPredictionError {}
#[derive(Debug, PartialEq)]
pub enum GetRulesError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetRulesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetRulesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetRulesError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetRulesError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(GetRulesError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetRulesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetRulesError::InternalServer(ref cause) => write!(f, "{}", cause),
GetRulesError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetRulesError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetRulesError {}
#[derive(Debug, PartialEq)]
pub enum GetVariablesError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetVariablesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetVariablesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetVariablesError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetVariablesError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(GetVariablesError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetVariablesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetVariablesError::InternalServer(ref cause) => write!(f, "{}", cause),
GetVariablesError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetVariablesError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetVariablesError {}
#[derive(Debug, PartialEq)]
pub enum PutDetectorError {
InternalServer(String),
Throttling(String),
}
impl PutDetectorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutDetectorError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(PutDetectorError::InternalServer(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(PutDetectorError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for PutDetectorError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
PutDetectorError::InternalServer(ref cause) => write!(f, "{}", cause),
PutDetectorError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for PutDetectorError {}
#[derive(Debug, PartialEq)]
pub enum PutExternalModelError {
InternalServer(String),
Throttling(String),
}
impl PutExternalModelError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutExternalModelError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(PutExternalModelError::InternalServer(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(PutExternalModelError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for PutExternalModelError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
PutExternalModelError::InternalServer(ref cause) => write!(f, "{}", cause),
PutExternalModelError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for PutExternalModelError {}
#[derive(Debug, PartialEq)]
pub enum PutModelError {
InternalServer(String),
Throttling(String),
}
impl PutModelError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutModelError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(PutModelError::InternalServer(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(PutModelError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for PutModelError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
PutModelError::InternalServer(ref cause) => write!(f, "{}", cause),
PutModelError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for PutModelError {}
#[derive(Debug, PartialEq)]
pub enum PutOutcomeError {
InternalServer(String),
Throttling(String),
}
impl PutOutcomeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutOutcomeError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(PutOutcomeError::InternalServer(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(PutOutcomeError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for PutOutcomeError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
PutOutcomeError::InternalServer(ref cause) => write!(f, "{}", cause),
PutOutcomeError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for PutOutcomeError {}
#[derive(Debug, PartialEq)]
pub enum UpdateDetectorVersionError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl UpdateDetectorVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateDetectorVersionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(UpdateDetectorVersionError::InternalServer(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateDetectorVersionError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(UpdateDetectorVersionError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateDetectorVersionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateDetectorVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
UpdateDetectorVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UpdateDetectorVersionError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateDetectorVersionError {}
#[derive(Debug, PartialEq)]
pub enum UpdateDetectorVersionMetadataError {
InternalServer(String),
Throttling(String),
}
impl UpdateDetectorVersionMetadataError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateDetectorVersionMetadataError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(
UpdateDetectorVersionMetadataError::InternalServer(err.msg),
)
}
"ThrottlingException" => {
return RusotoError::Service(UpdateDetectorVersionMetadataError::Throttling(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateDetectorVersionMetadataError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateDetectorVersionMetadataError::InternalServer(ref cause) => write!(f, "{}", cause),
UpdateDetectorVersionMetadataError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateDetectorVersionMetadataError {}
#[derive(Debug, PartialEq)]
pub enum UpdateDetectorVersionStatusError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl UpdateDetectorVersionStatusError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateDetectorVersionStatusError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(UpdateDetectorVersionStatusError::InternalServer(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(
UpdateDetectorVersionStatusError::ResourceNotFound(err.msg),
)
}
"ThrottlingException" => {
return RusotoError::Service(UpdateDetectorVersionStatusError::Throttling(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateDetectorVersionStatusError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateDetectorVersionStatusError::InternalServer(ref cause) => write!(f, "{}", cause),
UpdateDetectorVersionStatusError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UpdateDetectorVersionStatusError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateDetectorVersionStatusError {}
#[derive(Debug, PartialEq)]
pub enum UpdateModelVersionError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl UpdateModelVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateModelVersionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(UpdateModelVersionError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateModelVersionError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(UpdateModelVersionError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateModelVersionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateModelVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
UpdateModelVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UpdateModelVersionError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateModelVersionError {}
#[derive(Debug, PartialEq)]
pub enum UpdateRuleMetadataError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl UpdateRuleMetadataError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateRuleMetadataError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(UpdateRuleMetadataError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateRuleMetadataError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(UpdateRuleMetadataError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateRuleMetadataError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateRuleMetadataError::InternalServer(ref cause) => write!(f, "{}", cause),
UpdateRuleMetadataError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UpdateRuleMetadataError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateRuleMetadataError {}
#[derive(Debug, PartialEq)]
pub enum UpdateRuleVersionError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl UpdateRuleVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateRuleVersionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(UpdateRuleVersionError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateRuleVersionError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(UpdateRuleVersionError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateRuleVersionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateRuleVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
UpdateRuleVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UpdateRuleVersionError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateRuleVersionError {}
#[derive(Debug, PartialEq)]
pub enum UpdateVariableError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl UpdateVariableError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateVariableError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(UpdateVariableError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateVariableError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(UpdateVariableError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateVariableError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateVariableError::InternalServer(ref cause) => write!(f, "{}", cause),
UpdateVariableError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UpdateVariableError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateVariableError {}
#[async_trait]
pub trait FraudDetector {
async fn batch_create_variable(
&self,
input: BatchCreateVariableRequest,
) -> Result<BatchCreateVariableResult, RusotoError<BatchCreateVariableError>>;
async fn batch_get_variable(
&self,
input: BatchGetVariableRequest,
) -> Result<BatchGetVariableResult, RusotoError<BatchGetVariableError>>;
async fn create_detector_version(
&self,
input: CreateDetectorVersionRequest,
) -> Result<CreateDetectorVersionResult, RusotoError<CreateDetectorVersionError>>;
async fn create_model_version(
&self,
input: CreateModelVersionRequest,
) -> Result<CreateModelVersionResult, RusotoError<CreateModelVersionError>>;
async fn create_rule(
&self,
input: CreateRuleRequest,
) -> Result<CreateRuleResult, RusotoError<CreateRuleError>>;
async fn create_variable(
&self,
input: CreateVariableRequest,
) -> Result<CreateVariableResult, RusotoError<CreateVariableError>>;
async fn delete_detector(
&self,
input: DeleteDetectorRequest,
) -> Result<DeleteDetectorResult, RusotoError<DeleteDetectorError>>;
async fn delete_detector_version(
&self,
input: DeleteDetectorVersionRequest,
) -> Result<DeleteDetectorVersionResult, RusotoError<DeleteDetectorVersionError>>;
async fn delete_event(
&self,
input: DeleteEventRequest,
) -> Result<DeleteEventResult, RusotoError<DeleteEventError>>;
async fn delete_rule_version(
&self,
input: DeleteRuleVersionRequest,
) -> Result<DeleteRuleVersionResult, RusotoError<DeleteRuleVersionError>>;
async fn describe_detector(
&self,
input: DescribeDetectorRequest,
) -> Result<DescribeDetectorResult, RusotoError<DescribeDetectorError>>;
async fn describe_model_versions(
&self,
input: DescribeModelVersionsRequest,
) -> Result<DescribeModelVersionsResult, RusotoError<DescribeModelVersionsError>>;
async fn get_detector_version(
&self,
input: GetDetectorVersionRequest,
) -> Result<GetDetectorVersionResult, RusotoError<GetDetectorVersionError>>;
async fn get_detectors(
&self,
input: GetDetectorsRequest,
) -> Result<GetDetectorsResult, RusotoError<GetDetectorsError>>;
async fn get_external_models(
&self,
input: GetExternalModelsRequest,
) -> Result<GetExternalModelsResult, RusotoError<GetExternalModelsError>>;
async fn get_model_version(
&self,
input: GetModelVersionRequest,
) -> Result<GetModelVersionResult, RusotoError<GetModelVersionError>>;
async fn get_models(
&self,
input: GetModelsRequest,
) -> Result<GetModelsResult, RusotoError<GetModelsError>>;
async fn get_outcomes(
&self,
input: GetOutcomesRequest,
) -> Result<GetOutcomesResult, RusotoError<GetOutcomesError>>;
async fn get_prediction(
&self,
input: GetPredictionRequest,
) -> Result<GetPredictionResult, RusotoError<GetPredictionError>>;
async fn get_rules(
&self,
input: GetRulesRequest,
) -> Result<GetRulesResult, RusotoError<GetRulesError>>;
async fn get_variables(
&self,
input: GetVariablesRequest,
) -> Result<GetVariablesResult, RusotoError<GetVariablesError>>;
async fn put_detector(
&self,
input: PutDetectorRequest,
) -> Result<PutDetectorResult, RusotoError<PutDetectorError>>;
async fn put_external_model(
&self,
input: PutExternalModelRequest,
) -> Result<PutExternalModelResult, RusotoError<PutExternalModelError>>;
async fn put_model(
&self,
input: PutModelRequest,
) -> Result<PutModelResult, RusotoError<PutModelError>>;
async fn put_outcome(
&self,
input: PutOutcomeRequest,
) -> Result<PutOutcomeResult, RusotoError<PutOutcomeError>>;
async fn update_detector_version(
&self,
input: UpdateDetectorVersionRequest,
) -> Result<UpdateDetectorVersionResult, RusotoError<UpdateDetectorVersionError>>;
async fn update_detector_version_metadata(
&self,
input: UpdateDetectorVersionMetadataRequest,
) -> Result<UpdateDetectorVersionMetadataResult, RusotoError<UpdateDetectorVersionMetadataError>>;
async fn update_detector_version_status(
&self,
input: UpdateDetectorVersionStatusRequest,
) -> Result<UpdateDetectorVersionStatusResult, RusotoError<UpdateDetectorVersionStatusError>>;
async fn update_model_version(
&self,
input: UpdateModelVersionRequest,
) -> Result<UpdateModelVersionResult, RusotoError<UpdateModelVersionError>>;
async fn update_rule_metadata(
&self,
input: UpdateRuleMetadataRequest,
) -> Result<UpdateRuleMetadataResult, RusotoError<UpdateRuleMetadataError>>;
async fn update_rule_version(
&self,
input: UpdateRuleVersionRequest,
) -> Result<UpdateRuleVersionResult, RusotoError<UpdateRuleVersionError>>;
async fn update_variable(
&self,
input: UpdateVariableRequest,
) -> Result<UpdateVariableResult, RusotoError<UpdateVariableError>>;
}
#[derive(Clone)]
pub struct FraudDetectorClient {
client: Client,
region: region::Region,
}
impl FraudDetectorClient {
pub fn new(region: region::Region) -> FraudDetectorClient {
FraudDetectorClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> FraudDetectorClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
D: DispatchSignedRequest + Send + Sync + 'static,
{
FraudDetectorClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
pub fn new_with_client(client: Client, region: region::Region) -> FraudDetectorClient {
FraudDetectorClient { client, region }
}
}
#[async_trait]
impl FraudDetector for FraudDetectorClient {
async fn batch_create_variable(
&self,
input: BatchCreateVariableRequest,
) -> Result<BatchCreateVariableResult, RusotoError<BatchCreateVariableError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSHawksNestServiceFacade.BatchCreateVariable",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, BatchCreateVariableError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<BatchCreateVariableResult, _>()
}
async fn batch_get_variable(
&self,
input: BatchGetVariableRequest,
) -> Result<BatchGetVariableResult, RusotoError<BatchGetVariableError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.BatchGetVariable");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, BatchGetVariableError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<BatchGetVariableResult, _>()
}
async fn create_detector_version(
&self,
input: CreateDetectorVersionRequest,
) -> Result<CreateDetectorVersionResult, RusotoError<CreateDetectorVersionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSHawksNestServiceFacade.CreateDetectorVersion",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateDetectorVersionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<CreateDetectorVersionResult, _>()
}
async fn create_model_version(
&self,
input: CreateModelVersionRequest,
) -> Result<CreateModelVersionResult, RusotoError<CreateModelVersionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSHawksNestServiceFacade.CreateModelVersion",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateModelVersionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<CreateModelVersionResult, _>()
}
async fn create_rule(
&self,
input: CreateRuleRequest,
) -> Result<CreateRuleResult, RusotoError<CreateRuleError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.CreateRule");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateRuleError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<CreateRuleResult, _>()
}
async fn create_variable(
&self,
input: CreateVariableRequest,
) -> Result<CreateVariableResult, RusotoError<CreateVariableError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.CreateVariable");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateVariableError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<CreateVariableResult, _>()
}
async fn delete_detector(
&self,
input: DeleteDetectorRequest,
) -> Result<DeleteDetectorResult, RusotoError<DeleteDetectorError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.DeleteDetector");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteDetectorError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DeleteDetectorResult, _>()
}
async fn delete_detector_version(
&self,
input: DeleteDetectorVersionRequest,
) -> Result<DeleteDetectorVersionResult, RusotoError<DeleteDetectorVersionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSHawksNestServiceFacade.DeleteDetectorVersion",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteDetectorVersionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DeleteDetectorVersionResult, _>()
}
async fn delete_event(
&self,
input: DeleteEventRequest,
) -> Result<DeleteEventResult, RusotoError<DeleteEventError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.DeleteEvent");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteEventError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DeleteEventResult, _>()
}
async fn delete_rule_version(
&self,
input: DeleteRuleVersionRequest,
) -> Result<DeleteRuleVersionResult, RusotoError<DeleteRuleVersionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSHawksNestServiceFacade.DeleteRuleVersion",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteRuleVersionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DeleteRuleVersionResult, _>()
}
async fn describe_detector(
&self,
input: DescribeDetectorRequest,
) -> Result<DescribeDetectorResult, RusotoError<DescribeDetectorError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.DescribeDetector");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeDetectorError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DescribeDetectorResult, _>()
}
async fn describe_model_versions(
&self,
input: DescribeModelVersionsRequest,
) -> Result<DescribeModelVersionsResult, RusotoError<DescribeModelVersionsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSHawksNestServiceFacade.DescribeModelVersions",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeModelVersionsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DescribeModelVersionsResult, _>()
}
async fn get_detector_version(
&self,
input: GetDetectorVersionRequest,
) -> Result<GetDetectorVersionResult, RusotoError<GetDetectorVersionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSHawksNestServiceFacade.GetDetectorVersion",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetDetectorVersionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetDetectorVersionResult, _>()
}
async fn get_detectors(
&self,
input: GetDetectorsRequest,
) -> Result<GetDetectorsResult, RusotoError<GetDetectorsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.GetDetectors");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetDetectorsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetDetectorsResult, _>()
}
async fn get_external_models(
&self,
input: GetExternalModelsRequest,
) -> Result<GetExternalModelsResult, RusotoError<GetExternalModelsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSHawksNestServiceFacade.GetExternalModels",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetExternalModelsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetExternalModelsResult, _>()
}
async fn get_model_version(
&self,
input: GetModelVersionRequest,
) -> Result<GetModelVersionResult, RusotoError<GetModelVersionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.GetModelVersion");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetModelVersionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetModelVersionResult, _>()
}
async fn get_models(
&self,
input: GetModelsRequest,
) -> Result<GetModelsResult, RusotoError<GetModelsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.GetModels");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetModelsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetModelsResult, _>()
}
async fn get_outcomes(
&self,
input: GetOutcomesRequest,
) -> Result<GetOutcomesResult, RusotoError<GetOutcomesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.GetOutcomes");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetOutcomesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetOutcomesResult, _>()
}
async fn get_prediction(
&self,
input: GetPredictionRequest,
) -> Result<GetPredictionResult, RusotoError<GetPredictionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.GetPrediction");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetPredictionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetPredictionResult, _>()
}
async fn get_rules(
&self,
input: GetRulesRequest,
) -> Result<GetRulesResult, RusotoError<GetRulesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.GetRules");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetRulesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetRulesResult, _>()
}
async fn get_variables(
&self,
input: GetVariablesRequest,
) -> Result<GetVariablesResult, RusotoError<GetVariablesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.GetVariables");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetVariablesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetVariablesResult, _>()
}
async fn put_detector(
&self,
input: PutDetectorRequest,
) -> Result<PutDetectorResult, RusotoError<PutDetectorError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.PutDetector");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, PutDetectorError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<PutDetectorResult, _>()
}
async fn put_external_model(
&self,
input: PutExternalModelRequest,
) -> Result<PutExternalModelResult, RusotoError<PutExternalModelError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.PutExternalModel");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, PutExternalModelError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<PutExternalModelResult, _>()
}
async fn put_model(
&self,
input: PutModelRequest,
) -> Result<PutModelResult, RusotoError<PutModelError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.PutModel");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, PutModelError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<PutModelResult, _>()
}
async fn put_outcome(
&self,
input: PutOutcomeRequest,
) -> Result<PutOutcomeResult, RusotoError<PutOutcomeError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.PutOutcome");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, PutOutcomeError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<PutOutcomeResult, _>()
}
async fn update_detector_version(
&self,
input: UpdateDetectorVersionRequest,
) -> Result<UpdateDetectorVersionResult, RusotoError<UpdateDetectorVersionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSHawksNestServiceFacade.UpdateDetectorVersion",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateDetectorVersionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UpdateDetectorVersionResult, _>()
}
async fn update_detector_version_metadata(
&self,
input: UpdateDetectorVersionMetadataRequest,
) -> Result<UpdateDetectorVersionMetadataResult, RusotoError<UpdateDetectorVersionMetadataError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSHawksNestServiceFacade.UpdateDetectorVersionMetadata",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateDetectorVersionMetadataError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateDetectorVersionMetadataResult, _>()
}
async fn update_detector_version_status(
&self,
input: UpdateDetectorVersionStatusRequest,
) -> Result<UpdateDetectorVersionStatusResult, RusotoError<UpdateDetectorVersionStatusError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSHawksNestServiceFacade.UpdateDetectorVersionStatus",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateDetectorVersionStatusError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateDetectorVersionStatusResult, _>()
}
async fn update_model_version(
&self,
input: UpdateModelVersionRequest,
) -> Result<UpdateModelVersionResult, RusotoError<UpdateModelVersionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSHawksNestServiceFacade.UpdateModelVersion",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateModelVersionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UpdateModelVersionResult, _>()
}
async fn update_rule_metadata(
&self,
input: UpdateRuleMetadataRequest,
) -> Result<UpdateRuleMetadataResult, RusotoError<UpdateRuleMetadataError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSHawksNestServiceFacade.UpdateRuleMetadata",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateRuleMetadataError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UpdateRuleMetadataResult, _>()
}
async fn update_rule_version(
&self,
input: UpdateRuleVersionRequest,
) -> Result<UpdateRuleVersionResult, RusotoError<UpdateRuleVersionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSHawksNestServiceFacade.UpdateRuleVersion",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateRuleVersionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UpdateRuleVersionResult, _>()
}
async fn update_variable(
&self,
input: UpdateVariableRequest,
) -> Result<UpdateVariableResult, RusotoError<UpdateVariableError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSHawksNestServiceFacade.UpdateVariable");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateVariableError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UpdateVariableResult, _>()
}
}