rusoto_frauddetector/
generated.rs

1// =================================================================
2//
3//                           * WARNING *
4//
5//                    This file is generated!
6//
7//  Changes made to this file will be overwritten. If changes are
8//  required to the generated code, the service_crategen project
9//  must be updated to generate the changes.
10//
11// =================================================================
12
13use std::error::Error;
14use std::fmt;
15
16use async_trait::async_trait;
17use rusoto_core::credential::ProvideAwsCredentials;
18use rusoto_core::region;
19use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
20use rusoto_core::{Client, RusotoError};
21
22use rusoto_core::proto;
23use rusoto_core::request::HttpResponse;
24use rusoto_core::signature::SignedRequest;
25#[allow(unused_imports)]
26use serde::{Deserialize, Serialize};
27
28impl FraudDetectorClient {
29    fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
30        let mut request =
31            SignedRequest::new(http_method, "frauddetector", &self.region, request_uri);
32
33        request.set_content_type("application/x-amz-json-1.1".to_owned());
34
35        request
36    }
37
38    async fn sign_and_dispatch<E>(
39        &self,
40        request: SignedRequest,
41        from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
42    ) -> Result<HttpResponse, RusotoError<E>> {
43        let mut response = self.client.sign_and_dispatch(request).await?;
44        if !response.status.is_success() {
45            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
46            return Err(from_response(response));
47        }
48
49        Ok(response)
50    }
51}
52
53use serde_json;
54/// <p>Provides the error of the batch create variable API.</p>
55#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
56#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
57pub struct FraudDetectorBatchCreateVariableError {
58    /// <p>The error code. </p>
59    #[serde(rename = "code")]
60    #[serde(skip_serializing_if = "Option::is_none")]
61    pub code: Option<i64>,
62    /// <p>The error message.</p>
63    #[serde(rename = "message")]
64    #[serde(skip_serializing_if = "Option::is_none")]
65    pub message: Option<String>,
66    /// <p>The name.</p>
67    #[serde(rename = "name")]
68    #[serde(skip_serializing_if = "Option::is_none")]
69    pub name: Option<String>,
70}
71
72#[derive(Clone, Debug, Default, PartialEq, Serialize)]
73#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
74pub struct BatchCreateVariableRequest {
75    /// <p>The list of variables for the batch create variable request.</p>
76    #[serde(rename = "variableEntries")]
77    pub variable_entries: Vec<VariableEntry>,
78}
79
80#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
81#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
82pub struct BatchCreateVariableResult {
83    /// <p>Provides the errors for the <code>BatchCreateVariable</code> request.</p>
84    #[serde(rename = "errors")]
85    #[serde(skip_serializing_if = "Option::is_none")]
86    pub errors: Option<Vec<FraudDetectorBatchCreateVariableError>>,
87}
88
89/// <p>Provides the error of the batch get variable API.</p>
90#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
91#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
92pub struct FraudDetectorBatchGetVariableError {
93    /// <p>The error code. </p>
94    #[serde(rename = "code")]
95    #[serde(skip_serializing_if = "Option::is_none")]
96    pub code: Option<i64>,
97    /// <p>The error message.</p>
98    #[serde(rename = "message")]
99    #[serde(skip_serializing_if = "Option::is_none")]
100    pub message: Option<String>,
101    /// <p>The error name. </p>
102    #[serde(rename = "name")]
103    #[serde(skip_serializing_if = "Option::is_none")]
104    pub name: Option<String>,
105}
106
107#[derive(Clone, Debug, Default, PartialEq, Serialize)]
108#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
109pub struct BatchGetVariableRequest {
110    /// <p>The list of variable names to get.</p>
111    #[serde(rename = "names")]
112    pub names: Vec<String>,
113}
114
115#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
116#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
117pub struct BatchGetVariableResult {
118    /// <p>The errors from the request.</p>
119    #[serde(rename = "errors")]
120    #[serde(skip_serializing_if = "Option::is_none")]
121    pub errors: Option<Vec<FraudDetectorBatchGetVariableError>>,
122    /// <p>The returned variables.</p>
123    #[serde(rename = "variables")]
124    #[serde(skip_serializing_if = "Option::is_none")]
125    pub variables: Option<Vec<Variable>>,
126}
127
128#[derive(Clone, Debug, Default, PartialEq, Serialize)]
129#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
130pub struct CreateDetectorVersionRequest {
131    /// <p>The description of the detector version.</p>
132    #[serde(rename = "description")]
133    #[serde(skip_serializing_if = "Option::is_none")]
134    pub description: Option<String>,
135    /// <p>The ID of the detector under which you want to create a new version.</p>
136    #[serde(rename = "detectorId")]
137    pub detector_id: String,
138    /// <p>The Amazon Sagemaker model endpoints to include in the detector version.</p>
139    #[serde(rename = "externalModelEndpoints")]
140    #[serde(skip_serializing_if = "Option::is_none")]
141    pub external_model_endpoints: Option<Vec<String>>,
142    /// <p>The model versions to include in the detector version.</p>
143    #[serde(rename = "modelVersions")]
144    #[serde(skip_serializing_if = "Option::is_none")]
145    pub model_versions: Option<Vec<ModelVersion>>,
146    /// <p>The rule execution mode for the rules included in the detector version.</p> <p>You can define and edit the rule mode at the detector version level, when it is in draft status.</p> <p>If you specify <code>FIRST_MATCHED</code>, Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.</p> <p>If you specifiy <code>ALL_MATCHED</code>, Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules. </p> <p>The default behavior is <code>FIRST_MATCHED</code>.</p>
147    #[serde(rename = "ruleExecutionMode")]
148    #[serde(skip_serializing_if = "Option::is_none")]
149    pub rule_execution_mode: Option<String>,
150    /// <p>The rules to include in the detector version.</p>
151    #[serde(rename = "rules")]
152    pub rules: Vec<Rule>,
153}
154
155#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
156#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
157pub struct CreateDetectorVersionResult {
158    /// <p>The ID for the created version's parent detector.</p>
159    #[serde(rename = "detectorId")]
160    #[serde(skip_serializing_if = "Option::is_none")]
161    pub detector_id: Option<String>,
162    /// <p>The ID for the created detector. </p>
163    #[serde(rename = "detectorVersionId")]
164    #[serde(skip_serializing_if = "Option::is_none")]
165    pub detector_version_id: Option<String>,
166    /// <p>The status of the detector version.</p>
167    #[serde(rename = "status")]
168    #[serde(skip_serializing_if = "Option::is_none")]
169    pub status: Option<String>,
170}
171
172#[derive(Clone, Debug, Default, PartialEq, Serialize)]
173#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
174pub struct CreateModelVersionRequest {
175    /// <p>The model version description.</p>
176    #[serde(rename = "description")]
177    #[serde(skip_serializing_if = "Option::is_none")]
178    pub description: Option<String>,
179    /// <p>The model ID. </p>
180    #[serde(rename = "modelId")]
181    pub model_id: String,
182    /// <p>The model type.</p>
183    #[serde(rename = "modelType")]
184    pub model_type: String,
185}
186
187#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
188#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
189pub struct CreateModelVersionResult {
190    /// <p>The model ID. </p>
191    #[serde(rename = "modelId")]
192    #[serde(skip_serializing_if = "Option::is_none")]
193    pub model_id: Option<String>,
194    /// <p>The model type.</p>
195    #[serde(rename = "modelType")]
196    #[serde(skip_serializing_if = "Option::is_none")]
197    pub model_type: Option<String>,
198    /// <p>The version of the model. </p>
199    #[serde(rename = "modelVersionNumber")]
200    #[serde(skip_serializing_if = "Option::is_none")]
201    pub model_version_number: Option<String>,
202    /// <p>The model version status. </p>
203    #[serde(rename = "status")]
204    #[serde(skip_serializing_if = "Option::is_none")]
205    pub status: Option<String>,
206}
207
208#[derive(Clone, Debug, Default, PartialEq, Serialize)]
209#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
210pub struct CreateRuleRequest {
211    /// <p>The rule description.</p>
212    #[serde(rename = "description")]
213    #[serde(skip_serializing_if = "Option::is_none")]
214    pub description: Option<String>,
215    /// <p>The detector ID for the rule's parent detector.</p>
216    #[serde(rename = "detectorId")]
217    pub detector_id: String,
218    /// <p>The rule expression.</p>
219    #[serde(rename = "expression")]
220    pub expression: String,
221    /// <p>The language of the rule.</p>
222    #[serde(rename = "language")]
223    pub language: String,
224    /// <p>The outcome or outcomes returned when the rule expression matches.</p>
225    #[serde(rename = "outcomes")]
226    pub outcomes: Vec<String>,
227    /// <p>The rule ID.</p>
228    #[serde(rename = "ruleId")]
229    pub rule_id: String,
230}
231
232#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
233#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
234pub struct CreateRuleResult {
235    /// <p>The created rule.</p>
236    #[serde(rename = "rule")]
237    #[serde(skip_serializing_if = "Option::is_none")]
238    pub rule: Option<Rule>,
239}
240
241#[derive(Clone, Debug, Default, PartialEq, Serialize)]
242#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
243pub struct CreateVariableRequest {
244    /// <p>The source of the data.</p>
245    #[serde(rename = "dataSource")]
246    pub data_source: String,
247    /// <p>The data type.</p>
248    #[serde(rename = "dataType")]
249    pub data_type: String,
250    /// <p>The default value for the variable when no value is received.</p>
251    #[serde(rename = "defaultValue")]
252    pub default_value: String,
253    /// <p>The description.</p>
254    #[serde(rename = "description")]
255    #[serde(skip_serializing_if = "Option::is_none")]
256    pub description: Option<String>,
257    /// <p>The name of the variable.</p>
258    #[serde(rename = "name")]
259    pub name: String,
260    /// <p>The variable type.</p>
261    #[serde(rename = "variableType")]
262    #[serde(skip_serializing_if = "Option::is_none")]
263    pub variable_type: Option<String>,
264}
265
266#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
267#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
268pub struct CreateVariableResult {}
269
270#[derive(Clone, Debug, Default, PartialEq, Serialize)]
271#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
272pub struct DeleteDetectorRequest {
273    /// <p>The ID of the detector to delete.</p>
274    #[serde(rename = "detectorId")]
275    pub detector_id: String,
276}
277
278#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
279#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
280pub struct DeleteDetectorResult {}
281
282#[derive(Clone, Debug, Default, PartialEq, Serialize)]
283#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
284pub struct DeleteDetectorVersionRequest {
285    /// <p>The ID of the parent detector for the detector version to delete.</p>
286    #[serde(rename = "detectorId")]
287    pub detector_id: String,
288    /// <p>The ID of the detector version to delete.</p>
289    #[serde(rename = "detectorVersionId")]
290    pub detector_version_id: String,
291}
292
293#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
294#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
295pub struct DeleteDetectorVersionResult {}
296
297#[derive(Clone, Debug, Default, PartialEq, Serialize)]
298#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
299pub struct DeleteEventRequest {
300    /// <p>The ID of the event to delete.</p>
301    #[serde(rename = "eventId")]
302    pub event_id: String,
303}
304
305#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
306#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
307pub struct DeleteEventResult {}
308
309#[derive(Clone, Debug, Default, PartialEq, Serialize)]
310#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
311pub struct DeleteRuleVersionRequest {
312    /// <p>The ID of the detector that includes the rule version to delete.</p>
313    #[serde(rename = "detectorId")]
314    pub detector_id: String,
315    /// <p>The rule ID of the rule version to delete.</p>
316    #[serde(rename = "ruleId")]
317    pub rule_id: String,
318    /// <p>The rule version to delete.</p>
319    #[serde(rename = "ruleVersion")]
320    pub rule_version: String,
321}
322
323#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
324#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
325pub struct DeleteRuleVersionResult {}
326
327#[derive(Clone, Debug, Default, PartialEq, Serialize)]
328#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
329pub struct DescribeDetectorRequest {
330    /// <p>The detector ID.</p>
331    #[serde(rename = "detectorId")]
332    pub detector_id: String,
333    /// <p>The maximum number of results to return for the request.</p>
334    #[serde(rename = "maxResults")]
335    #[serde(skip_serializing_if = "Option::is_none")]
336    pub max_results: Option<i64>,
337    /// <p>The next token from the previous response.</p>
338    #[serde(rename = "nextToken")]
339    #[serde(skip_serializing_if = "Option::is_none")]
340    pub next_token: Option<String>,
341}
342
343#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
344#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
345pub struct DescribeDetectorResult {
346    /// <p>The detector ID.</p>
347    #[serde(rename = "detectorId")]
348    #[serde(skip_serializing_if = "Option::is_none")]
349    pub detector_id: Option<String>,
350    /// <p>The status and description for each detector version.</p>
351    #[serde(rename = "detectorVersionSummaries")]
352    #[serde(skip_serializing_if = "Option::is_none")]
353    pub detector_version_summaries: Option<Vec<DetectorVersionSummary>>,
354    /// <p>The next token to be used for subsequent requests.</p>
355    #[serde(rename = "nextToken")]
356    #[serde(skip_serializing_if = "Option::is_none")]
357    pub next_token: Option<String>,
358}
359
360#[derive(Clone, Debug, Default, PartialEq, Serialize)]
361#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
362pub struct DescribeModelVersionsRequest {
363    /// <p>The maximum number of results to return.</p>
364    #[serde(rename = "maxResults")]
365    #[serde(skip_serializing_if = "Option::is_none")]
366    pub max_results: Option<i64>,
367    /// <p>The model ID.</p>
368    #[serde(rename = "modelId")]
369    #[serde(skip_serializing_if = "Option::is_none")]
370    pub model_id: Option<String>,
371    /// <p>The model type.</p>
372    #[serde(rename = "modelType")]
373    #[serde(skip_serializing_if = "Option::is_none")]
374    pub model_type: Option<String>,
375    /// <p>The model version. </p>
376    #[serde(rename = "modelVersionNumber")]
377    #[serde(skip_serializing_if = "Option::is_none")]
378    pub model_version_number: Option<String>,
379    /// <p>The next token from the previous results.</p>
380    #[serde(rename = "nextToken")]
381    #[serde(skip_serializing_if = "Option::is_none")]
382    pub next_token: Option<String>,
383}
384
385#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
386#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
387pub struct DescribeModelVersionsResult {
388    /// <p>The model version details.</p>
389    #[serde(rename = "modelVersionDetails")]
390    #[serde(skip_serializing_if = "Option::is_none")]
391    pub model_version_details: Option<Vec<ModelVersionDetail>>,
392    /// <p>The next token.</p>
393    #[serde(rename = "nextToken")]
394    #[serde(skip_serializing_if = "Option::is_none")]
395    pub next_token: Option<String>,
396}
397
398/// <p>The detector.</p>
399#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
400#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
401pub struct Detector {
402    /// <p>Timestamp of when the detector was created.</p>
403    #[serde(rename = "createdTime")]
404    #[serde(skip_serializing_if = "Option::is_none")]
405    pub created_time: Option<String>,
406    /// <p>The detector description.</p>
407    #[serde(rename = "description")]
408    #[serde(skip_serializing_if = "Option::is_none")]
409    pub description: Option<String>,
410    /// <p>The detector ID.</p>
411    #[serde(rename = "detectorId")]
412    #[serde(skip_serializing_if = "Option::is_none")]
413    pub detector_id: Option<String>,
414    /// <p>Timestamp of when the detector was last updated.</p>
415    #[serde(rename = "lastUpdatedTime")]
416    #[serde(skip_serializing_if = "Option::is_none")]
417    pub last_updated_time: Option<String>,
418}
419
420/// <p>The summary of the detector version.</p>
421#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
422#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
423pub struct DetectorVersionSummary {
424    /// <p>The detector version description. </p>
425    #[serde(rename = "description")]
426    #[serde(skip_serializing_if = "Option::is_none")]
427    pub description: Option<String>,
428    /// <p>The detector version ID. </p>
429    #[serde(rename = "detectorVersionId")]
430    #[serde(skip_serializing_if = "Option::is_none")]
431    pub detector_version_id: Option<String>,
432    /// <p>Timestamp of when the detector version was last updated.</p>
433    #[serde(rename = "lastUpdatedTime")]
434    #[serde(skip_serializing_if = "Option::is_none")]
435    pub last_updated_time: Option<String>,
436    /// <p>The detector version status. </p>
437    #[serde(rename = "status")]
438    #[serde(skip_serializing_if = "Option::is_none")]
439    pub status: Option<String>,
440}
441
442/// <p>The Amazon SageMaker model.</p>
443#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
444#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
445pub struct ExternalModel {
446    /// <p>Timestamp of when the model was last created.</p>
447    #[serde(rename = "createdTime")]
448    #[serde(skip_serializing_if = "Option::is_none")]
449    pub created_time: Option<String>,
450    /// <p>The input configuration.</p>
451    #[serde(rename = "inputConfiguration")]
452    #[serde(skip_serializing_if = "Option::is_none")]
453    pub input_configuration: Option<ModelInputConfiguration>,
454    /// <p>Timestamp of when the model was last updated.</p>
455    #[serde(rename = "lastUpdatedTime")]
456    #[serde(skip_serializing_if = "Option::is_none")]
457    pub last_updated_time: Option<String>,
458    /// <p>The Amazon SageMaker model endpoints.</p>
459    #[serde(rename = "modelEndpoint")]
460    #[serde(skip_serializing_if = "Option::is_none")]
461    pub model_endpoint: Option<String>,
462    /// <p>The Amazon Fraud Detector status for the external model endpoint</p>
463    #[serde(rename = "modelEndpointStatus")]
464    #[serde(skip_serializing_if = "Option::is_none")]
465    pub model_endpoint_status: Option<String>,
466    /// <p>The source of the model.</p>
467    #[serde(rename = "modelSource")]
468    #[serde(skip_serializing_if = "Option::is_none")]
469    pub model_source: Option<String>,
470    /// <p>The output configuration.</p>
471    #[serde(rename = "outputConfiguration")]
472    #[serde(skip_serializing_if = "Option::is_none")]
473    pub output_configuration: Option<ModelOutputConfiguration>,
474    /// <p>The role used to invoke the model. </p>
475    #[serde(rename = "role")]
476    #[serde(skip_serializing_if = "Option::is_none")]
477    pub role: Option<Role>,
478}
479
480#[derive(Clone, Debug, Default, PartialEq, Serialize)]
481#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
482pub struct GetDetectorVersionRequest {
483    /// <p>The detector ID.</p>
484    #[serde(rename = "detectorId")]
485    pub detector_id: String,
486    /// <p>The detector version ID.</p>
487    #[serde(rename = "detectorVersionId")]
488    pub detector_version_id: String,
489}
490
491#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
492#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
493pub struct GetDetectorVersionResult {
494    /// <p>The timestamp when the detector version was created. </p>
495    #[serde(rename = "createdTime")]
496    #[serde(skip_serializing_if = "Option::is_none")]
497    pub created_time: Option<String>,
498    /// <p>The detector version description.</p>
499    #[serde(rename = "description")]
500    #[serde(skip_serializing_if = "Option::is_none")]
501    pub description: Option<String>,
502    /// <p>The detector ID.</p>
503    #[serde(rename = "detectorId")]
504    #[serde(skip_serializing_if = "Option::is_none")]
505    pub detector_id: Option<String>,
506    /// <p>The detector version ID.</p>
507    #[serde(rename = "detectorVersionId")]
508    #[serde(skip_serializing_if = "Option::is_none")]
509    pub detector_version_id: Option<String>,
510    /// <p>The Amazon SageMaker model endpoints included in the detector version.</p>
511    #[serde(rename = "externalModelEndpoints")]
512    #[serde(skip_serializing_if = "Option::is_none")]
513    pub external_model_endpoints: Option<Vec<String>>,
514    /// <p>The timestamp when the detector version was last updated. </p>
515    #[serde(rename = "lastUpdatedTime")]
516    #[serde(skip_serializing_if = "Option::is_none")]
517    pub last_updated_time: Option<String>,
518    /// <p>The model versions included in the detector version. </p>
519    #[serde(rename = "modelVersions")]
520    #[serde(skip_serializing_if = "Option::is_none")]
521    pub model_versions: Option<Vec<ModelVersion>>,
522    /// <p>The execution mode of the rule in the dectector</p> <p> <code>FIRST_MATCHED</code> indicates that Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.</p> <p> <code>ALL_MATCHED</code> indicates that Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules. You can define and edit the rule mode at the detector version level, when it is in draft status.</p>
523    #[serde(rename = "ruleExecutionMode")]
524    #[serde(skip_serializing_if = "Option::is_none")]
525    pub rule_execution_mode: Option<String>,
526    /// <p>The rules included in the detector version.</p>
527    #[serde(rename = "rules")]
528    #[serde(skip_serializing_if = "Option::is_none")]
529    pub rules: Option<Vec<Rule>>,
530    /// <p>The status of the detector version.</p>
531    #[serde(rename = "status")]
532    #[serde(skip_serializing_if = "Option::is_none")]
533    pub status: Option<String>,
534}
535
536#[derive(Clone, Debug, Default, PartialEq, Serialize)]
537#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
538pub struct GetDetectorsRequest {
539    /// <p>The detector ID.</p>
540    #[serde(rename = "detectorId")]
541    #[serde(skip_serializing_if = "Option::is_none")]
542    pub detector_id: Option<String>,
543    /// <p>The maximum number of objects to return for the request.</p>
544    #[serde(rename = "maxResults")]
545    #[serde(skip_serializing_if = "Option::is_none")]
546    pub max_results: Option<i64>,
547    /// <p>The next token for the subsequent request.</p>
548    #[serde(rename = "nextToken")]
549    #[serde(skip_serializing_if = "Option::is_none")]
550    pub next_token: Option<String>,
551}
552
553#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
554#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
555pub struct GetDetectorsResult {
556    /// <p>The detectors.</p>
557    #[serde(rename = "detectors")]
558    #[serde(skip_serializing_if = "Option::is_none")]
559    pub detectors: Option<Vec<Detector>>,
560    /// <p>The next page token.</p>
561    #[serde(rename = "nextToken")]
562    #[serde(skip_serializing_if = "Option::is_none")]
563    pub next_token: Option<String>,
564}
565
566#[derive(Clone, Debug, Default, PartialEq, Serialize)]
567#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
568pub struct GetExternalModelsRequest {
569    /// <p>The maximum number of objects to return for the request.</p>
570    #[serde(rename = "maxResults")]
571    #[serde(skip_serializing_if = "Option::is_none")]
572    pub max_results: Option<i64>,
573    /// <p>The Amazon SageMaker model endpoint.</p>
574    #[serde(rename = "modelEndpoint")]
575    #[serde(skip_serializing_if = "Option::is_none")]
576    pub model_endpoint: Option<String>,
577    /// <p>The next page token for the request.</p>
578    #[serde(rename = "nextToken")]
579    #[serde(skip_serializing_if = "Option::is_none")]
580    pub next_token: Option<String>,
581}
582
583#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
584#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
585pub struct GetExternalModelsResult {
586    /// <p>Gets the Amazon SageMaker models.</p>
587    #[serde(rename = "externalModels")]
588    #[serde(skip_serializing_if = "Option::is_none")]
589    pub external_models: Option<Vec<ExternalModel>>,
590    /// <p>The next page token to be used in subsequent requests.</p>
591    #[serde(rename = "nextToken")]
592    #[serde(skip_serializing_if = "Option::is_none")]
593    pub next_token: Option<String>,
594}
595
596#[derive(Clone, Debug, Default, PartialEq, Serialize)]
597#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
598pub struct GetModelVersionRequest {
599    /// <p>The model ID. </p>
600    #[serde(rename = "modelId")]
601    pub model_id: String,
602    /// <p>The model type. </p>
603    #[serde(rename = "modelType")]
604    pub model_type: String,
605    /// <p>The model version. </p>
606    #[serde(rename = "modelVersionNumber")]
607    pub model_version_number: String,
608}
609
610#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
611#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
612pub struct GetModelVersionResult {
613    /// <p>The model version description.</p>
614    #[serde(rename = "description")]
615    #[serde(skip_serializing_if = "Option::is_none")]
616    pub description: Option<String>,
617    /// <p>The model ID. </p>
618    #[serde(rename = "modelId")]
619    #[serde(skip_serializing_if = "Option::is_none")]
620    pub model_id: Option<String>,
621    /// <p>The model type. </p>
622    #[serde(rename = "modelType")]
623    #[serde(skip_serializing_if = "Option::is_none")]
624    pub model_type: Option<String>,
625    /// <p>The model version. </p>
626    #[serde(rename = "modelVersionNumber")]
627    #[serde(skip_serializing_if = "Option::is_none")]
628    pub model_version_number: Option<String>,
629    /// <p>The model version status. </p>
630    #[serde(rename = "status")]
631    #[serde(skip_serializing_if = "Option::is_none")]
632    pub status: Option<String>,
633}
634
635#[derive(Clone, Debug, Default, PartialEq, Serialize)]
636#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
637pub struct GetModelsRequest {
638    /// <p>The maximum results to return for the request.</p>
639    #[serde(rename = "maxResults")]
640    #[serde(skip_serializing_if = "Option::is_none")]
641    pub max_results: Option<i64>,
642    /// <p>The model ID.</p>
643    #[serde(rename = "modelId")]
644    #[serde(skip_serializing_if = "Option::is_none")]
645    pub model_id: Option<String>,
646    /// <p>The model type.</p>
647    #[serde(rename = "modelType")]
648    #[serde(skip_serializing_if = "Option::is_none")]
649    pub model_type: Option<String>,
650    /// <p>The next token for the request.</p>
651    #[serde(rename = "nextToken")]
652    #[serde(skip_serializing_if = "Option::is_none")]
653    pub next_token: Option<String>,
654}
655
656#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
657#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
658pub struct GetModelsResult {
659    /// <p>The returned models. </p>
660    #[serde(rename = "models")]
661    #[serde(skip_serializing_if = "Option::is_none")]
662    pub models: Option<Vec<Model>>,
663    /// <p>The next token for subsequent requests. </p>
664    #[serde(rename = "nextToken")]
665    #[serde(skip_serializing_if = "Option::is_none")]
666    pub next_token: Option<String>,
667}
668
669#[derive(Clone, Debug, Default, PartialEq, Serialize)]
670#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
671pub struct GetOutcomesRequest {
672    /// <p>The maximum number of objects to return for the request. </p>
673    #[serde(rename = "maxResults")]
674    #[serde(skip_serializing_if = "Option::is_none")]
675    pub max_results: Option<i64>,
676    /// <p>The name of the outcome or outcomes to get.</p>
677    #[serde(rename = "name")]
678    #[serde(skip_serializing_if = "Option::is_none")]
679    pub name: Option<String>,
680    /// <p>The next page token for the request. </p>
681    #[serde(rename = "nextToken")]
682    #[serde(skip_serializing_if = "Option::is_none")]
683    pub next_token: Option<String>,
684}
685
686#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
687#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
688pub struct GetOutcomesResult {
689    /// <p>The next page token for subsequent requests.</p>
690    #[serde(rename = "nextToken")]
691    #[serde(skip_serializing_if = "Option::is_none")]
692    pub next_token: Option<String>,
693    /// <p>The outcomes. </p>
694    #[serde(rename = "outcomes")]
695    #[serde(skip_serializing_if = "Option::is_none")]
696    pub outcomes: Option<Vec<Outcome>>,
697}
698
699#[derive(Clone, Debug, Default, PartialEq, Serialize)]
700#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
701pub struct GetPredictionRequest {
702    /// <p>The detector ID. </p>
703    #[serde(rename = "detectorId")]
704    pub detector_id: String,
705    /// <p>The detector version ID.</p>
706    #[serde(rename = "detectorVersionId")]
707    #[serde(skip_serializing_if = "Option::is_none")]
708    pub detector_version_id: Option<String>,
709    /// <p>Names of variables you defined in Amazon Fraud Detector to represent event data elements and their corresponding values for the event you are sending for evaluation.</p>
710    #[serde(rename = "eventAttributes")]
711    #[serde(skip_serializing_if = "Option::is_none")]
712    pub event_attributes: Option<::std::collections::HashMap<String, String>>,
713    /// <p>The unique ID used to identify the event.</p>
714    #[serde(rename = "eventId")]
715    pub event_id: String,
716    /// <p>The Amazon SageMaker model endpoint input data blobs.</p>
717    #[serde(rename = "externalModelEndpointDataBlobs")]
718    #[serde(skip_serializing_if = "Option::is_none")]
719    pub external_model_endpoint_data_blobs:
720        Option<::std::collections::HashMap<String, ModelEndpointDataBlob>>,
721}
722
723#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
724#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
725pub struct GetPredictionResult {
726    /// <p>The model scores for models used in the detector version.</p>
727    #[serde(rename = "modelScores")]
728    #[serde(skip_serializing_if = "Option::is_none")]
729    pub model_scores: Option<Vec<ModelScores>>,
730    /// <p>The prediction outcomes.</p>
731    #[serde(rename = "outcomes")]
732    #[serde(skip_serializing_if = "Option::is_none")]
733    pub outcomes: Option<Vec<String>>,
734    /// <p>The rule results in the prediction.</p>
735    #[serde(rename = "ruleResults")]
736    #[serde(skip_serializing_if = "Option::is_none")]
737    pub rule_results: Option<Vec<RuleResult>>,
738}
739
740#[derive(Clone, Debug, Default, PartialEq, Serialize)]
741#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
742pub struct GetRulesRequest {
743    /// <p>The detector ID.</p>
744    #[serde(rename = "detectorId")]
745    pub detector_id: String,
746    /// <p>The maximum number of rules to return for the request.</p>
747    #[serde(rename = "maxResults")]
748    #[serde(skip_serializing_if = "Option::is_none")]
749    pub max_results: Option<i64>,
750    /// <p>The next page token.</p>
751    #[serde(rename = "nextToken")]
752    #[serde(skip_serializing_if = "Option::is_none")]
753    pub next_token: Option<String>,
754    /// <p>The rule ID.</p>
755    #[serde(rename = "ruleId")]
756    #[serde(skip_serializing_if = "Option::is_none")]
757    pub rule_id: Option<String>,
758    /// <p>The rule version.</p>
759    #[serde(rename = "ruleVersion")]
760    #[serde(skip_serializing_if = "Option::is_none")]
761    pub rule_version: Option<String>,
762}
763
764#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
765#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
766pub struct GetRulesResult {
767    /// <p>The next page token to be used in subsequent requests.</p>
768    #[serde(rename = "nextToken")]
769    #[serde(skip_serializing_if = "Option::is_none")]
770    pub next_token: Option<String>,
771    /// <p>The details of the requested rule.</p>
772    #[serde(rename = "ruleDetails")]
773    #[serde(skip_serializing_if = "Option::is_none")]
774    pub rule_details: Option<Vec<RuleDetail>>,
775}
776
777#[derive(Clone, Debug, Default, PartialEq, Serialize)]
778#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
779pub struct GetVariablesRequest {
780    /// <p>The max size per page determined for the get variable request. </p>
781    #[serde(rename = "maxResults")]
782    #[serde(skip_serializing_if = "Option::is_none")]
783    pub max_results: Option<i64>,
784    /// <p>The name of the variable. </p>
785    #[serde(rename = "name")]
786    #[serde(skip_serializing_if = "Option::is_none")]
787    pub name: Option<String>,
788    /// <p>The next page token of the get variable request. </p>
789    #[serde(rename = "nextToken")]
790    #[serde(skip_serializing_if = "Option::is_none")]
791    pub next_token: Option<String>,
792}
793
794#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
795#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
796pub struct GetVariablesResult {
797    /// <p>The next page token to be used in subsequent requests. </p>
798    #[serde(rename = "nextToken")]
799    #[serde(skip_serializing_if = "Option::is_none")]
800    pub next_token: Option<String>,
801    /// <p>The names of the variables returned. </p>
802    #[serde(rename = "variables")]
803    #[serde(skip_serializing_if = "Option::is_none")]
804    pub variables: Option<Vec<Variable>>,
805}
806
807/// <p>The label schema.</p>
808#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
809pub struct LabelSchema {
810    /// <p>The label key.</p>
811    #[serde(rename = "labelKey")]
812    pub label_key: String,
813    /// <p>The label mapper maps the Amazon Fraud Detector supported label to the appropriate source labels. For example, if <code>"FRAUD"</code> and <code>"LEGIT"</code> are Amazon Fraud Detector supported labels, this mapper could be: <code>{"FRAUD" =&gt; ["0"]</code>, "LEGIT" =&gt; ["1"]} or <code>{"FRAUD" =&gt; ["false"], "LEGIT" =&gt; ["true"]}</code> or <code>{"FRAUD" =&gt; ["fraud", "abuse"], "LEGIT" =&gt; ["legit", "safe"]}</code>. The value part of the mapper is a list, because you may have multiple variants for a single Amazon Fraud Detector label. </p>
814    #[serde(rename = "labelMapper")]
815    pub label_mapper: ::std::collections::HashMap<String, Vec<String>>,
816}
817
818/// <p>The model.</p>
819#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
820#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
821pub struct Model {
822    /// <p>Timestamp of when the model was created.</p>
823    #[serde(rename = "createdTime")]
824    #[serde(skip_serializing_if = "Option::is_none")]
825    pub created_time: Option<String>,
826    /// <p>The model description.</p>
827    #[serde(rename = "description")]
828    #[serde(skip_serializing_if = "Option::is_none")]
829    pub description: Option<String>,
830    /// <p>The model label schema.</p>
831    #[serde(rename = "labelSchema")]
832    #[serde(skip_serializing_if = "Option::is_none")]
833    pub label_schema: Option<LabelSchema>,
834    /// <p>Timestamp of last time the model was updated.</p>
835    #[serde(rename = "lastUpdatedTime")]
836    #[serde(skip_serializing_if = "Option::is_none")]
837    pub last_updated_time: Option<String>,
838    /// <p>The model ID.</p>
839    #[serde(rename = "modelId")]
840    #[serde(skip_serializing_if = "Option::is_none")]
841    pub model_id: Option<String>,
842    /// <p>The model type.</p>
843    #[serde(rename = "modelType")]
844    #[serde(skip_serializing_if = "Option::is_none")]
845    pub model_type: Option<String>,
846    /// <p>The model input variables.</p>
847    #[serde(rename = "modelVariables")]
848    #[serde(skip_serializing_if = "Option::is_none")]
849    pub model_variables: Option<Vec<ModelVariable>>,
850    /// <p>The model training data source in Amazon S3.</p>
851    #[serde(rename = "trainingDataSource")]
852    #[serde(skip_serializing_if = "Option::is_none")]
853    pub training_data_source: Option<TrainingDataSource>,
854}
855
856/// <p>A pre-formed Amazon SageMaker model input you can include if your detector version includes an imported Amazon SageMaker model endpoint with pass-through input configuration.</p>
857#[derive(Clone, Debug, Default, PartialEq, Serialize)]
858#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
859pub struct ModelEndpointDataBlob {
860    /// <p>The byte buffer of the Amazon SageMaker model endpoint input data blob.</p>
861    #[serde(rename = "byteBuffer")]
862    #[serde(
863        deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
864        serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
865        default
866    )]
867    #[serde(skip_serializing_if = "Option::is_none")]
868    pub byte_buffer: Option<bytes::Bytes>,
869    /// <p>The content type of the Amazon SageMaker model endpoint input data blob. </p>
870    #[serde(rename = "contentType")]
871    #[serde(skip_serializing_if = "Option::is_none")]
872    pub content_type: Option<String>,
873}
874
875/// <p>The model input configuration.</p>
876#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
877pub struct ModelInputConfiguration {
878    /// <p> Template for constructing the CSV input-data sent to SageMaker. At event-evaluation, the placeholders for variable-names in the template will be replaced with the variable values before being sent to SageMaker. </p>
879    #[serde(rename = "csvInputTemplate")]
880    #[serde(skip_serializing_if = "Option::is_none")]
881    pub csv_input_template: Option<String>,
882    /// <p> The format of the model input configuration. The format differs depending on if it is passed through to SageMaker or constructed by Amazon Fraud Detector.</p>
883    #[serde(rename = "format")]
884    #[serde(skip_serializing_if = "Option::is_none")]
885    pub format: Option<String>,
886    /// <p> For an opaque-model, the input to the model will be a ByteBuffer blob provided in the getPrediction request, and will be passed to SageMaker as-is. For non-opaque models, the input will be constructed by Amazon Fraud Detector based on the model-configuration. </p>
887    #[serde(rename = "isOpaque")]
888    pub is_opaque: bool,
889    /// <p> Template for constructing the JSON input-data sent to SageMaker. At event-evaluation, the placeholders for variable names in the template will be replaced with the variable values before being sent to SageMaker. </p>
890    #[serde(rename = "jsonInputTemplate")]
891    #[serde(skip_serializing_if = "Option::is_none")]
892    pub json_input_template: Option<String>,
893}
894
895/// <p>Provides the model output configuration.</p>
896#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
897pub struct ModelOutputConfiguration {
898    /// <p>A map of CSV index values in the SageMaker response to the Amazon Fraud Detector variables. </p>
899    #[serde(rename = "csvIndexToVariableMap")]
900    #[serde(skip_serializing_if = "Option::is_none")]
901    pub csv_index_to_variable_map: Option<::std::collections::HashMap<String, String>>,
902    /// <p>The format of the model output configuration.</p>
903    #[serde(rename = "format")]
904    pub format: String,
905    /// <p>A map of JSON keys in response from SageMaker to the Amazon Fraud Detector variables. </p>
906    #[serde(rename = "jsonKeyToVariableMap")]
907    #[serde(skip_serializing_if = "Option::is_none")]
908    pub json_key_to_variable_map: Option<::std::collections::HashMap<String, String>>,
909}
910
911/// <p>The fraud prediction scores.</p>
912#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
913#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
914pub struct ModelScores {
915    /// <p>The model version.</p>
916    #[serde(rename = "modelVersion")]
917    #[serde(skip_serializing_if = "Option::is_none")]
918    pub model_version: Option<ModelVersion>,
919    /// <p>The model's fraud prediction scores.</p>
920    #[serde(rename = "scores")]
921    #[serde(skip_serializing_if = "Option::is_none")]
922    pub scores: Option<::std::collections::HashMap<String, f32>>,
923}
924
925/// <p>The model variable.&gt;</p>
926#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
927pub struct ModelVariable {
928    /// <p>The model variable's index.&gt;</p>
929    #[serde(rename = "index")]
930    #[serde(skip_serializing_if = "Option::is_none")]
931    pub index: Option<i64>,
932    /// <p>The model variable's name.&gt;</p>
933    #[serde(rename = "name")]
934    pub name: String,
935}
936
937/// <p>The model version.</p>
938#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
939pub struct ModelVersion {
940    /// <p>The parent model ID.</p>
941    #[serde(rename = "modelId")]
942    pub model_id: String,
943    /// <p>The model type.</p>
944    #[serde(rename = "modelType")]
945    pub model_type: String,
946    /// <p>The model version.</p>
947    #[serde(rename = "modelVersionNumber")]
948    pub model_version_number: String,
949}
950
951/// <p>Provides the model version details. </p>
952#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
953#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
954pub struct ModelVersionDetail {
955    /// <p>The timestamp when the model was created.</p>
956    #[serde(rename = "createdTime")]
957    #[serde(skip_serializing_if = "Option::is_none")]
958    pub created_time: Option<String>,
959    /// <p>The model description.</p>
960    #[serde(rename = "description")]
961    #[serde(skip_serializing_if = "Option::is_none")]
962    pub description: Option<String>,
963    /// <p>The model label schema.</p>
964    #[serde(rename = "labelSchema")]
965    #[serde(skip_serializing_if = "Option::is_none")]
966    pub label_schema: Option<LabelSchema>,
967    /// <p>The timestamp when the model was last updated.</p>
968    #[serde(rename = "lastUpdatedTime")]
969    #[serde(skip_serializing_if = "Option::is_none")]
970    pub last_updated_time: Option<String>,
971    /// <p>The model ID.</p>
972    #[serde(rename = "modelId")]
973    #[serde(skip_serializing_if = "Option::is_none")]
974    pub model_id: Option<String>,
975    /// <p>The model type.</p>
976    #[serde(rename = "modelType")]
977    #[serde(skip_serializing_if = "Option::is_none")]
978    pub model_type: Option<String>,
979    /// <p>The model variables.</p>
980    #[serde(rename = "modelVariables")]
981    #[serde(skip_serializing_if = "Option::is_none")]
982    pub model_variables: Option<Vec<ModelVariable>>,
983    /// <p>The model version.</p>
984    #[serde(rename = "modelVersionNumber")]
985    #[serde(skip_serializing_if = "Option::is_none")]
986    pub model_version_number: Option<String>,
987    /// <p>The model status.</p>
988    #[serde(rename = "status")]
989    #[serde(skip_serializing_if = "Option::is_none")]
990    pub status: Option<String>,
991    /// <p>The model training data source.</p>
992    #[serde(rename = "trainingDataSource")]
993    #[serde(skip_serializing_if = "Option::is_none")]
994    pub training_data_source: Option<TrainingDataSource>,
995    /// <p>The model training metrics.</p>
996    #[serde(rename = "trainingMetrics")]
997    #[serde(skip_serializing_if = "Option::is_none")]
998    pub training_metrics: Option<::std::collections::HashMap<String, String>>,
999    /// <p>The model validation metrics.</p>
1000    #[serde(rename = "validationMetrics")]
1001    #[serde(skip_serializing_if = "Option::is_none")]
1002    pub validation_metrics: Option<::std::collections::HashMap<String, String>>,
1003}
1004
1005/// <p>The outcome.</p>
1006#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1007#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1008pub struct Outcome {
1009    /// <p>The timestamp when the outcome was created.</p>
1010    #[serde(rename = "createdTime")]
1011    #[serde(skip_serializing_if = "Option::is_none")]
1012    pub created_time: Option<String>,
1013    /// <p>The outcome description.</p>
1014    #[serde(rename = "description")]
1015    #[serde(skip_serializing_if = "Option::is_none")]
1016    pub description: Option<String>,
1017    /// <p>The timestamp when the outcome was last updated.</p>
1018    #[serde(rename = "lastUpdatedTime")]
1019    #[serde(skip_serializing_if = "Option::is_none")]
1020    pub last_updated_time: Option<String>,
1021    /// <p>The outcome name.</p>
1022    #[serde(rename = "name")]
1023    #[serde(skip_serializing_if = "Option::is_none")]
1024    pub name: Option<String>,
1025}
1026
1027#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1028#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1029pub struct PutDetectorRequest {
1030    /// <p>The description of the detector.</p>
1031    #[serde(rename = "description")]
1032    #[serde(skip_serializing_if = "Option::is_none")]
1033    pub description: Option<String>,
1034    /// <p>The detector ID. </p>
1035    #[serde(rename = "detectorId")]
1036    pub detector_id: String,
1037}
1038
1039#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1040#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1041pub struct PutDetectorResult {}
1042
1043#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1044#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1045pub struct PutExternalModelRequest {
1046    /// <p>The model endpoint input configuration.</p>
1047    #[serde(rename = "inputConfiguration")]
1048    pub input_configuration: ModelInputConfiguration,
1049    /// <p>The model endpoints name.</p>
1050    #[serde(rename = "modelEndpoint")]
1051    pub model_endpoint: String,
1052    /// <p>The model endpoint’s status in Amazon Fraud Detector.</p>
1053    #[serde(rename = "modelEndpointStatus")]
1054    pub model_endpoint_status: String,
1055    /// <p>The source of the model.</p>
1056    #[serde(rename = "modelSource")]
1057    pub model_source: String,
1058    /// <p>The model endpoint output configuration.</p>
1059    #[serde(rename = "outputConfiguration")]
1060    pub output_configuration: ModelOutputConfiguration,
1061    /// <p>The IAM role used to invoke the model endpoint.</p>
1062    #[serde(rename = "role")]
1063    pub role: Role,
1064}
1065
1066#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1067#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1068pub struct PutExternalModelResult {}
1069
1070#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1071#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1072pub struct PutModelRequest {
1073    /// <p>The model description. </p>
1074    #[serde(rename = "description")]
1075    #[serde(skip_serializing_if = "Option::is_none")]
1076    pub description: Option<String>,
1077    /// <p>The label schema.</p>
1078    #[serde(rename = "labelSchema")]
1079    pub label_schema: LabelSchema,
1080    /// <p>The model ID.</p>
1081    #[serde(rename = "modelId")]
1082    pub model_id: String,
1083    /// <p>The model type. </p>
1084    #[serde(rename = "modelType")]
1085    pub model_type: String,
1086    /// <p>The model input variables.</p>
1087    #[serde(rename = "modelVariables")]
1088    pub model_variables: Vec<ModelVariable>,
1089    /// <p>The training data source location in Amazon S3. </p>
1090    #[serde(rename = "trainingDataSource")]
1091    pub training_data_source: TrainingDataSource,
1092}
1093
1094#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1095#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1096pub struct PutModelResult {}
1097
1098#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1099#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1100pub struct PutOutcomeRequest {
1101    /// <p>The outcome description.</p>
1102    #[serde(rename = "description")]
1103    #[serde(skip_serializing_if = "Option::is_none")]
1104    pub description: Option<String>,
1105    /// <p>The name of the outcome.</p>
1106    #[serde(rename = "name")]
1107    pub name: String,
1108}
1109
1110#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1111#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1112pub struct PutOutcomeResult {}
1113
1114/// <p>The role used to invoke external model endpoints.</p>
1115#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
1116pub struct Role {
1117    /// <p>The role ARN.</p>
1118    #[serde(rename = "arn")]
1119    pub arn: String,
1120    /// <p>The role name.</p>
1121    #[serde(rename = "name")]
1122    pub name: String,
1123}
1124
1125/// <p>A rule.</p>
1126#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
1127pub struct Rule {
1128    /// <p>The detector for which the rule is associated.</p>
1129    #[serde(rename = "detectorId")]
1130    pub detector_id: String,
1131    /// <p>The rule ID.</p>
1132    #[serde(rename = "ruleId")]
1133    pub rule_id: String,
1134    /// <p>The rule version.</p>
1135    #[serde(rename = "ruleVersion")]
1136    pub rule_version: String,
1137}
1138
1139/// <p>The details of the rule.</p>
1140#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1141#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1142pub struct RuleDetail {
1143    /// <p>The timestamp of when the rule was created.</p>
1144    #[serde(rename = "createdTime")]
1145    #[serde(skip_serializing_if = "Option::is_none")]
1146    pub created_time: Option<String>,
1147    /// <p>The rule description.</p>
1148    #[serde(rename = "description")]
1149    #[serde(skip_serializing_if = "Option::is_none")]
1150    pub description: Option<String>,
1151    /// <p>The detector for which the rule is associated.</p>
1152    #[serde(rename = "detectorId")]
1153    #[serde(skip_serializing_if = "Option::is_none")]
1154    pub detector_id: Option<String>,
1155    /// <p>The rule expression.</p>
1156    #[serde(rename = "expression")]
1157    #[serde(skip_serializing_if = "Option::is_none")]
1158    pub expression: Option<String>,
1159    /// <p>The rule language.</p>
1160    #[serde(rename = "language")]
1161    #[serde(skip_serializing_if = "Option::is_none")]
1162    pub language: Option<String>,
1163    /// <p>Timestamp of the last time the rule was updated.</p>
1164    #[serde(rename = "lastUpdatedTime")]
1165    #[serde(skip_serializing_if = "Option::is_none")]
1166    pub last_updated_time: Option<String>,
1167    /// <p>The rule outcomes.</p>
1168    #[serde(rename = "outcomes")]
1169    #[serde(skip_serializing_if = "Option::is_none")]
1170    pub outcomes: Option<Vec<String>>,
1171    /// <p>The rule ID.</p>
1172    #[serde(rename = "ruleId")]
1173    #[serde(skip_serializing_if = "Option::is_none")]
1174    pub rule_id: Option<String>,
1175    /// <p>The rule version.</p>
1176    #[serde(rename = "ruleVersion")]
1177    #[serde(skip_serializing_if = "Option::is_none")]
1178    pub rule_version: Option<String>,
1179}
1180
1181/// <p>The rule results.</p>
1182#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1183#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1184pub struct RuleResult {
1185    /// <p>The outcomes of the matched rule, based on the rule execution mode.</p>
1186    #[serde(rename = "outcomes")]
1187    #[serde(skip_serializing_if = "Option::is_none")]
1188    pub outcomes: Option<Vec<String>>,
1189    /// <p>The rule ID that was matched, based on the rule execution mode.</p>
1190    #[serde(rename = "ruleId")]
1191    #[serde(skip_serializing_if = "Option::is_none")]
1192    pub rule_id: Option<String>,
1193}
1194
1195/// <p>The training data source.</p>
1196#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
1197pub struct TrainingDataSource {
1198    /// <p>The data access role ARN for the training data source.</p>
1199    #[serde(rename = "dataAccessRoleArn")]
1200    pub data_access_role_arn: String,
1201    /// <p>The data location of the training data source.</p>
1202    #[serde(rename = "dataLocation")]
1203    pub data_location: String,
1204}
1205
1206#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1207#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1208pub struct UpdateDetectorVersionMetadataRequest {
1209    /// <p>The description.</p>
1210    #[serde(rename = "description")]
1211    pub description: String,
1212    /// <p>The detector ID.</p>
1213    #[serde(rename = "detectorId")]
1214    pub detector_id: String,
1215    /// <p>The detector version ID. </p>
1216    #[serde(rename = "detectorVersionId")]
1217    pub detector_version_id: String,
1218}
1219
1220#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1221#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1222pub struct UpdateDetectorVersionMetadataResult {}
1223
1224#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1225#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1226pub struct UpdateDetectorVersionRequest {
1227    /// <p>The detector version description. </p>
1228    #[serde(rename = "description")]
1229    #[serde(skip_serializing_if = "Option::is_none")]
1230    pub description: Option<String>,
1231    /// <p>The parent detector ID for the detector version you want to update.</p>
1232    #[serde(rename = "detectorId")]
1233    pub detector_id: String,
1234    /// <p>The detector version ID. </p>
1235    #[serde(rename = "detectorVersionId")]
1236    pub detector_version_id: String,
1237    /// <p>The Amazon SageMaker model endpoints to include in the detector version.</p>
1238    #[serde(rename = "externalModelEndpoints")]
1239    pub external_model_endpoints: Vec<String>,
1240    /// <p>The model versions to include in the detector version.</p>
1241    #[serde(rename = "modelVersions")]
1242    #[serde(skip_serializing_if = "Option::is_none")]
1243    pub model_versions: Option<Vec<ModelVersion>>,
1244    /// <p>The rule execution mode to add to the detector.</p> <p>If you specify <code>FIRST_MATCHED</code>, Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.</p> <p>If you specifiy <code>ALL_MATCHED</code>, Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules. You can define and edit the rule mode at the detector version level, when it is in draft status.</p> <p>The default behavior is <code>FIRST_MATCHED</code>.</p>
1245    #[serde(rename = "ruleExecutionMode")]
1246    #[serde(skip_serializing_if = "Option::is_none")]
1247    pub rule_execution_mode: Option<String>,
1248    /// <p>The rules to include in the detector version.</p>
1249    #[serde(rename = "rules")]
1250    pub rules: Vec<Rule>,
1251}
1252
1253#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1254#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1255pub struct UpdateDetectorVersionResult {}
1256
1257#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1258#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1259pub struct UpdateDetectorVersionStatusRequest {
1260    /// <p>The detector ID. </p>
1261    #[serde(rename = "detectorId")]
1262    pub detector_id: String,
1263    /// <p>The detector version ID. </p>
1264    #[serde(rename = "detectorVersionId")]
1265    pub detector_version_id: String,
1266    /// <p>The new status.</p>
1267    #[serde(rename = "status")]
1268    pub status: String,
1269}
1270
1271#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1272#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1273pub struct UpdateDetectorVersionStatusResult {}
1274
1275#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1276#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1277pub struct UpdateModelVersionRequest {
1278    /// <p>The model description.</p>
1279    #[serde(rename = "description")]
1280    pub description: String,
1281    /// <p>The model ID.</p>
1282    #[serde(rename = "modelId")]
1283    pub model_id: String,
1284    /// <p>The model type.</p>
1285    #[serde(rename = "modelType")]
1286    pub model_type: String,
1287    /// <p>The model version.</p>
1288    #[serde(rename = "modelVersionNumber")]
1289    pub model_version_number: String,
1290    /// <p>The new model status.</p>
1291    #[serde(rename = "status")]
1292    pub status: String,
1293}
1294
1295#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1296#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1297pub struct UpdateModelVersionResult {}
1298
1299#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1300#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1301pub struct UpdateRuleMetadataRequest {
1302    /// <p>The rule description.</p>
1303    #[serde(rename = "description")]
1304    pub description: String,
1305    /// <p>The rule to update.</p>
1306    #[serde(rename = "rule")]
1307    pub rule: Rule,
1308}
1309
1310#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1311#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1312pub struct UpdateRuleMetadataResult {}
1313
1314#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1315#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1316pub struct UpdateRuleVersionRequest {
1317    /// <p>The description.</p>
1318    #[serde(rename = "description")]
1319    #[serde(skip_serializing_if = "Option::is_none")]
1320    pub description: Option<String>,
1321    /// <p>The rule expression.</p>
1322    #[serde(rename = "expression")]
1323    pub expression: String,
1324    /// <p>The language.</p>
1325    #[serde(rename = "language")]
1326    pub language: String,
1327    /// <p>The outcomes.</p>
1328    #[serde(rename = "outcomes")]
1329    pub outcomes: Vec<String>,
1330    /// <p>The rule to update.</p>
1331    #[serde(rename = "rule")]
1332    pub rule: Rule,
1333}
1334
1335#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1336#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1337pub struct UpdateRuleVersionResult {
1338    /// <p>The new rule version that was created.</p>
1339    #[serde(rename = "rule")]
1340    #[serde(skip_serializing_if = "Option::is_none")]
1341    pub rule: Option<Rule>,
1342}
1343
1344#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1345#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1346pub struct UpdateVariableRequest {
1347    /// <p>The new default value of the variable.</p>
1348    #[serde(rename = "defaultValue")]
1349    #[serde(skip_serializing_if = "Option::is_none")]
1350    pub default_value: Option<String>,
1351    /// <p>The new description.</p>
1352    #[serde(rename = "description")]
1353    #[serde(skip_serializing_if = "Option::is_none")]
1354    pub description: Option<String>,
1355    /// <p>The name of the variable.</p>
1356    #[serde(rename = "name")]
1357    pub name: String,
1358    /// <p>The variable type.</p>
1359    #[serde(rename = "variableType")]
1360    #[serde(skip_serializing_if = "Option::is_none")]
1361    pub variable_type: Option<String>,
1362}
1363
1364#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1365#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1366pub struct UpdateVariableResult {}
1367
1368/// <p>The variable.</p>
1369#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1370#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1371pub struct Variable {
1372    /// <p>The time when the variable was created.</p>
1373    #[serde(rename = "createdTime")]
1374    #[serde(skip_serializing_if = "Option::is_none")]
1375    pub created_time: Option<String>,
1376    /// <p>The data source of the variable.</p>
1377    #[serde(rename = "dataSource")]
1378    #[serde(skip_serializing_if = "Option::is_none")]
1379    pub data_source: Option<String>,
1380    /// <p>The data type of the variable.</p>
1381    #[serde(rename = "dataType")]
1382    #[serde(skip_serializing_if = "Option::is_none")]
1383    pub data_type: Option<String>,
1384    /// <p>The default value of the variable.</p>
1385    #[serde(rename = "defaultValue")]
1386    #[serde(skip_serializing_if = "Option::is_none")]
1387    pub default_value: Option<String>,
1388    /// <p>The description of the variable. </p>
1389    #[serde(rename = "description")]
1390    #[serde(skip_serializing_if = "Option::is_none")]
1391    pub description: Option<String>,
1392    /// <p>The time when variable was last updated.</p>
1393    #[serde(rename = "lastUpdatedTime")]
1394    #[serde(skip_serializing_if = "Option::is_none")]
1395    pub last_updated_time: Option<String>,
1396    /// <p>The name of the variable.</p>
1397    #[serde(rename = "name")]
1398    #[serde(skip_serializing_if = "Option::is_none")]
1399    pub name: Option<String>,
1400    /// <p>The variable type of the variable.</p>
1401    #[serde(rename = "variableType")]
1402    #[serde(skip_serializing_if = "Option::is_none")]
1403    pub variable_type: Option<String>,
1404}
1405
1406/// <p>The variable entry in a list.</p>
1407#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1408#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1409pub struct VariableEntry {
1410    /// <p>The data source of the variable entry.</p>
1411    #[serde(rename = "dataSource")]
1412    #[serde(skip_serializing_if = "Option::is_none")]
1413    pub data_source: Option<String>,
1414    /// <p>The data type of the variable entry.</p>
1415    #[serde(rename = "dataType")]
1416    #[serde(skip_serializing_if = "Option::is_none")]
1417    pub data_type: Option<String>,
1418    /// <p>The default value of the variable entry.</p>
1419    #[serde(rename = "defaultValue")]
1420    #[serde(skip_serializing_if = "Option::is_none")]
1421    pub default_value: Option<String>,
1422    /// <p>The description of the variable entry.</p>
1423    #[serde(rename = "description")]
1424    #[serde(skip_serializing_if = "Option::is_none")]
1425    pub description: Option<String>,
1426    /// <p>The name of the variable entry.</p>
1427    #[serde(rename = "name")]
1428    #[serde(skip_serializing_if = "Option::is_none")]
1429    pub name: Option<String>,
1430    /// <p>The type of the variable entry.</p>
1431    #[serde(rename = "variableType")]
1432    #[serde(skip_serializing_if = "Option::is_none")]
1433    pub variable_type: Option<String>,
1434}
1435
1436/// Errors returned by BatchCreateVariable
1437#[derive(Debug, PartialEq)]
1438pub enum BatchCreateVariableError {
1439    /// <p>An exception indicating an internal server error.</p>
1440    InternalServer(String),
1441    /// <p>An exception indicating a throttling error.</p>
1442    Throttling(String),
1443}
1444
1445impl BatchCreateVariableError {
1446    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchCreateVariableError> {
1447        if let Some(err) = proto::json::Error::parse(&res) {
1448            match err.typ.as_str() {
1449                "InternalServerException" => {
1450                    return RusotoError::Service(BatchCreateVariableError::InternalServer(err.msg))
1451                }
1452                "ThrottlingException" => {
1453                    return RusotoError::Service(BatchCreateVariableError::Throttling(err.msg))
1454                }
1455                "ValidationException" => return RusotoError::Validation(err.msg),
1456                _ => {}
1457            }
1458        }
1459        RusotoError::Unknown(res)
1460    }
1461}
1462impl fmt::Display for BatchCreateVariableError {
1463    #[allow(unused_variables)]
1464    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1465        match *self {
1466            BatchCreateVariableError::InternalServer(ref cause) => write!(f, "{}", cause),
1467            BatchCreateVariableError::Throttling(ref cause) => write!(f, "{}", cause),
1468        }
1469    }
1470}
1471impl Error for BatchCreateVariableError {}
1472/// Errors returned by BatchGetVariable
1473#[derive(Debug, PartialEq)]
1474pub enum BatchGetVariableError {
1475    /// <p>An exception indicating an internal server error.</p>
1476    InternalServer(String),
1477    /// <p>An exception indicating a throttling error.</p>
1478    Throttling(String),
1479}
1480
1481impl BatchGetVariableError {
1482    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchGetVariableError> {
1483        if let Some(err) = proto::json::Error::parse(&res) {
1484            match err.typ.as_str() {
1485                "InternalServerException" => {
1486                    return RusotoError::Service(BatchGetVariableError::InternalServer(err.msg))
1487                }
1488                "ThrottlingException" => {
1489                    return RusotoError::Service(BatchGetVariableError::Throttling(err.msg))
1490                }
1491                "ValidationException" => return RusotoError::Validation(err.msg),
1492                _ => {}
1493            }
1494        }
1495        RusotoError::Unknown(res)
1496    }
1497}
1498impl fmt::Display for BatchGetVariableError {
1499    #[allow(unused_variables)]
1500    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1501        match *self {
1502            BatchGetVariableError::InternalServer(ref cause) => write!(f, "{}", cause),
1503            BatchGetVariableError::Throttling(ref cause) => write!(f, "{}", cause),
1504        }
1505    }
1506}
1507impl Error for BatchGetVariableError {}
1508/// Errors returned by CreateDetectorVersion
1509#[derive(Debug, PartialEq)]
1510pub enum CreateDetectorVersionError {
1511    /// <p>An exception indicating an internal server error.</p>
1512    InternalServer(String),
1513    /// <p>An exception indicating the specified resource was not found.</p>
1514    ResourceNotFound(String),
1515    /// <p>An exception indicating a throttling error.</p>
1516    Throttling(String),
1517}
1518
1519impl CreateDetectorVersionError {
1520    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateDetectorVersionError> {
1521        if let Some(err) = proto::json::Error::parse(&res) {
1522            match err.typ.as_str() {
1523                "InternalServerException" => {
1524                    return RusotoError::Service(CreateDetectorVersionError::InternalServer(
1525                        err.msg,
1526                    ))
1527                }
1528                "ResourceNotFoundException" => {
1529                    return RusotoError::Service(CreateDetectorVersionError::ResourceNotFound(
1530                        err.msg,
1531                    ))
1532                }
1533                "ThrottlingException" => {
1534                    return RusotoError::Service(CreateDetectorVersionError::Throttling(err.msg))
1535                }
1536                "ValidationException" => return RusotoError::Validation(err.msg),
1537                _ => {}
1538            }
1539        }
1540        RusotoError::Unknown(res)
1541    }
1542}
1543impl fmt::Display for CreateDetectorVersionError {
1544    #[allow(unused_variables)]
1545    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1546        match *self {
1547            CreateDetectorVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
1548            CreateDetectorVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1549            CreateDetectorVersionError::Throttling(ref cause) => write!(f, "{}", cause),
1550        }
1551    }
1552}
1553impl Error for CreateDetectorVersionError {}
1554/// Errors returned by CreateModelVersion
1555#[derive(Debug, PartialEq)]
1556pub enum CreateModelVersionError {
1557    /// <p>An exception indicating an internal server error.</p>
1558    InternalServer(String),
1559    /// <p>An exception indicating the specified resource was not found.</p>
1560    ResourceNotFound(String),
1561    /// <p>An exception indicating a throttling error.</p>
1562    Throttling(String),
1563}
1564
1565impl CreateModelVersionError {
1566    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateModelVersionError> {
1567        if let Some(err) = proto::json::Error::parse(&res) {
1568            match err.typ.as_str() {
1569                "InternalServerException" => {
1570                    return RusotoError::Service(CreateModelVersionError::InternalServer(err.msg))
1571                }
1572                "ResourceNotFoundException" => {
1573                    return RusotoError::Service(CreateModelVersionError::ResourceNotFound(err.msg))
1574                }
1575                "ThrottlingException" => {
1576                    return RusotoError::Service(CreateModelVersionError::Throttling(err.msg))
1577                }
1578                "ValidationException" => return RusotoError::Validation(err.msg),
1579                _ => {}
1580            }
1581        }
1582        RusotoError::Unknown(res)
1583    }
1584}
1585impl fmt::Display for CreateModelVersionError {
1586    #[allow(unused_variables)]
1587    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1588        match *self {
1589            CreateModelVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
1590            CreateModelVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1591            CreateModelVersionError::Throttling(ref cause) => write!(f, "{}", cause),
1592        }
1593    }
1594}
1595impl Error for CreateModelVersionError {}
1596/// Errors returned by CreateRule
1597#[derive(Debug, PartialEq)]
1598pub enum CreateRuleError {
1599    /// <p>An exception indicating an internal server error.</p>
1600    InternalServer(String),
1601    /// <p>An exception indicating a throttling error.</p>
1602    Throttling(String),
1603}
1604
1605impl CreateRuleError {
1606    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateRuleError> {
1607        if let Some(err) = proto::json::Error::parse(&res) {
1608            match err.typ.as_str() {
1609                "InternalServerException" => {
1610                    return RusotoError::Service(CreateRuleError::InternalServer(err.msg))
1611                }
1612                "ThrottlingException" => {
1613                    return RusotoError::Service(CreateRuleError::Throttling(err.msg))
1614                }
1615                "ValidationException" => return RusotoError::Validation(err.msg),
1616                _ => {}
1617            }
1618        }
1619        RusotoError::Unknown(res)
1620    }
1621}
1622impl fmt::Display for CreateRuleError {
1623    #[allow(unused_variables)]
1624    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1625        match *self {
1626            CreateRuleError::InternalServer(ref cause) => write!(f, "{}", cause),
1627            CreateRuleError::Throttling(ref cause) => write!(f, "{}", cause),
1628        }
1629    }
1630}
1631impl Error for CreateRuleError {}
1632/// Errors returned by CreateVariable
1633#[derive(Debug, PartialEq)]
1634pub enum CreateVariableError {
1635    /// <p>An exception indicating an internal server error.</p>
1636    InternalServer(String),
1637    /// <p>An exception indicating a throttling error.</p>
1638    Throttling(String),
1639}
1640
1641impl CreateVariableError {
1642    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateVariableError> {
1643        if let Some(err) = proto::json::Error::parse(&res) {
1644            match err.typ.as_str() {
1645                "InternalServerException" => {
1646                    return RusotoError::Service(CreateVariableError::InternalServer(err.msg))
1647                }
1648                "ThrottlingException" => {
1649                    return RusotoError::Service(CreateVariableError::Throttling(err.msg))
1650                }
1651                "ValidationException" => return RusotoError::Validation(err.msg),
1652                _ => {}
1653            }
1654        }
1655        RusotoError::Unknown(res)
1656    }
1657}
1658impl fmt::Display for CreateVariableError {
1659    #[allow(unused_variables)]
1660    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1661        match *self {
1662            CreateVariableError::InternalServer(ref cause) => write!(f, "{}", cause),
1663            CreateVariableError::Throttling(ref cause) => write!(f, "{}", cause),
1664        }
1665    }
1666}
1667impl Error for CreateVariableError {}
1668/// Errors returned by DeleteDetector
1669#[derive(Debug, PartialEq)]
1670pub enum DeleteDetectorError {
1671    /// <p><p>An exception indicating there was a conflict during a delete operation. The following delete operations can cause a conflict exception:</p> <ul> <li> <p>DeleteDetector: A conflict exception will occur if the detector has associated <code>Rules</code> or <code>DetectorVersions</code>. You can only delete a detector if it has no <code>Rules</code> or <code>DetectorVersions</code>.</p> </li> <li> <p>DeleteDetectorVersion: A conflict exception will occur if the <code>DetectorVersion</code> status is <code>ACTIVE</code>.</p> </li> <li> <p>DeleteRuleVersion: A conflict exception will occur if the <code>RuleVersion</code> is in use by an associated <code>ACTIVE</code> or <code>INACTIVE DetectorVersion</code>.</p> </li> </ul></p>
1672    Conflict(String),
1673    /// <p>An exception indicating an internal server error.</p>
1674    InternalServer(String),
1675    /// <p>An exception indicating a throttling error.</p>
1676    Throttling(String),
1677}
1678
1679impl DeleteDetectorError {
1680    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDetectorError> {
1681        if let Some(err) = proto::json::Error::parse(&res) {
1682            match err.typ.as_str() {
1683                "ConflictException" => {
1684                    return RusotoError::Service(DeleteDetectorError::Conflict(err.msg))
1685                }
1686                "InternalServerException" => {
1687                    return RusotoError::Service(DeleteDetectorError::InternalServer(err.msg))
1688                }
1689                "ThrottlingException" => {
1690                    return RusotoError::Service(DeleteDetectorError::Throttling(err.msg))
1691                }
1692                "ValidationException" => return RusotoError::Validation(err.msg),
1693                _ => {}
1694            }
1695        }
1696        RusotoError::Unknown(res)
1697    }
1698}
1699impl fmt::Display for DeleteDetectorError {
1700    #[allow(unused_variables)]
1701    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1702        match *self {
1703            DeleteDetectorError::Conflict(ref cause) => write!(f, "{}", cause),
1704            DeleteDetectorError::InternalServer(ref cause) => write!(f, "{}", cause),
1705            DeleteDetectorError::Throttling(ref cause) => write!(f, "{}", cause),
1706        }
1707    }
1708}
1709impl Error for DeleteDetectorError {}
1710/// Errors returned by DeleteDetectorVersion
1711#[derive(Debug, PartialEq)]
1712pub enum DeleteDetectorVersionError {
1713    /// <p><p>An exception indicating there was a conflict during a delete operation. The following delete operations can cause a conflict exception:</p> <ul> <li> <p>DeleteDetector: A conflict exception will occur if the detector has associated <code>Rules</code> or <code>DetectorVersions</code>. You can only delete a detector if it has no <code>Rules</code> or <code>DetectorVersions</code>.</p> </li> <li> <p>DeleteDetectorVersion: A conflict exception will occur if the <code>DetectorVersion</code> status is <code>ACTIVE</code>.</p> </li> <li> <p>DeleteRuleVersion: A conflict exception will occur if the <code>RuleVersion</code> is in use by an associated <code>ACTIVE</code> or <code>INACTIVE DetectorVersion</code>.</p> </li> </ul></p>
1714    Conflict(String),
1715    /// <p>An exception indicating an internal server error.</p>
1716    InternalServer(String),
1717    /// <p>An exception indicating the specified resource was not found.</p>
1718    ResourceNotFound(String),
1719    /// <p>An exception indicating a throttling error.</p>
1720    Throttling(String),
1721}
1722
1723impl DeleteDetectorVersionError {
1724    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDetectorVersionError> {
1725        if let Some(err) = proto::json::Error::parse(&res) {
1726            match err.typ.as_str() {
1727                "ConflictException" => {
1728                    return RusotoError::Service(DeleteDetectorVersionError::Conflict(err.msg))
1729                }
1730                "InternalServerException" => {
1731                    return RusotoError::Service(DeleteDetectorVersionError::InternalServer(
1732                        err.msg,
1733                    ))
1734                }
1735                "ResourceNotFoundException" => {
1736                    return RusotoError::Service(DeleteDetectorVersionError::ResourceNotFound(
1737                        err.msg,
1738                    ))
1739                }
1740                "ThrottlingException" => {
1741                    return RusotoError::Service(DeleteDetectorVersionError::Throttling(err.msg))
1742                }
1743                "ValidationException" => return RusotoError::Validation(err.msg),
1744                _ => {}
1745            }
1746        }
1747        RusotoError::Unknown(res)
1748    }
1749}
1750impl fmt::Display for DeleteDetectorVersionError {
1751    #[allow(unused_variables)]
1752    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1753        match *self {
1754            DeleteDetectorVersionError::Conflict(ref cause) => write!(f, "{}", cause),
1755            DeleteDetectorVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
1756            DeleteDetectorVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1757            DeleteDetectorVersionError::Throttling(ref cause) => write!(f, "{}", cause),
1758        }
1759    }
1760}
1761impl Error for DeleteDetectorVersionError {}
1762/// Errors returned by DeleteEvent
1763#[derive(Debug, PartialEq)]
1764pub enum DeleteEventError {
1765    /// <p>An exception indicating an internal server error.</p>
1766    InternalServer(String),
1767    /// <p>An exception indicating a throttling error.</p>
1768    Throttling(String),
1769}
1770
1771impl DeleteEventError {
1772    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteEventError> {
1773        if let Some(err) = proto::json::Error::parse(&res) {
1774            match err.typ.as_str() {
1775                "InternalServerException" => {
1776                    return RusotoError::Service(DeleteEventError::InternalServer(err.msg))
1777                }
1778                "ThrottlingException" => {
1779                    return RusotoError::Service(DeleteEventError::Throttling(err.msg))
1780                }
1781                "ValidationException" => return RusotoError::Validation(err.msg),
1782                _ => {}
1783            }
1784        }
1785        RusotoError::Unknown(res)
1786    }
1787}
1788impl fmt::Display for DeleteEventError {
1789    #[allow(unused_variables)]
1790    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1791        match *self {
1792            DeleteEventError::InternalServer(ref cause) => write!(f, "{}", cause),
1793            DeleteEventError::Throttling(ref cause) => write!(f, "{}", cause),
1794        }
1795    }
1796}
1797impl Error for DeleteEventError {}
1798/// Errors returned by DeleteRuleVersion
1799#[derive(Debug, PartialEq)]
1800pub enum DeleteRuleVersionError {
1801    /// <p><p>An exception indicating there was a conflict during a delete operation. The following delete operations can cause a conflict exception:</p> <ul> <li> <p>DeleteDetector: A conflict exception will occur if the detector has associated <code>Rules</code> or <code>DetectorVersions</code>. You can only delete a detector if it has no <code>Rules</code> or <code>DetectorVersions</code>.</p> </li> <li> <p>DeleteDetectorVersion: A conflict exception will occur if the <code>DetectorVersion</code> status is <code>ACTIVE</code>.</p> </li> <li> <p>DeleteRuleVersion: A conflict exception will occur if the <code>RuleVersion</code> is in use by an associated <code>ACTIVE</code> or <code>INACTIVE DetectorVersion</code>.</p> </li> </ul></p>
1802    Conflict(String),
1803    /// <p>An exception indicating an internal server error.</p>
1804    InternalServer(String),
1805    /// <p>An exception indicating a throttling error.</p>
1806    Throttling(String),
1807}
1808
1809impl DeleteRuleVersionError {
1810    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteRuleVersionError> {
1811        if let Some(err) = proto::json::Error::parse(&res) {
1812            match err.typ.as_str() {
1813                "ConflictException" => {
1814                    return RusotoError::Service(DeleteRuleVersionError::Conflict(err.msg))
1815                }
1816                "InternalServerException" => {
1817                    return RusotoError::Service(DeleteRuleVersionError::InternalServer(err.msg))
1818                }
1819                "ThrottlingException" => {
1820                    return RusotoError::Service(DeleteRuleVersionError::Throttling(err.msg))
1821                }
1822                "ValidationException" => return RusotoError::Validation(err.msg),
1823                _ => {}
1824            }
1825        }
1826        RusotoError::Unknown(res)
1827    }
1828}
1829impl fmt::Display for DeleteRuleVersionError {
1830    #[allow(unused_variables)]
1831    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1832        match *self {
1833            DeleteRuleVersionError::Conflict(ref cause) => write!(f, "{}", cause),
1834            DeleteRuleVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
1835            DeleteRuleVersionError::Throttling(ref cause) => write!(f, "{}", cause),
1836        }
1837    }
1838}
1839impl Error for DeleteRuleVersionError {}
1840/// Errors returned by DescribeDetector
1841#[derive(Debug, PartialEq)]
1842pub enum DescribeDetectorError {
1843    /// <p>An exception indicating an internal server error.</p>
1844    InternalServer(String),
1845    /// <p>An exception indicating the specified resource was not found.</p>
1846    ResourceNotFound(String),
1847    /// <p>An exception indicating a throttling error.</p>
1848    Throttling(String),
1849}
1850
1851impl DescribeDetectorError {
1852    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeDetectorError> {
1853        if let Some(err) = proto::json::Error::parse(&res) {
1854            match err.typ.as_str() {
1855                "InternalServerException" => {
1856                    return RusotoError::Service(DescribeDetectorError::InternalServer(err.msg))
1857                }
1858                "ResourceNotFoundException" => {
1859                    return RusotoError::Service(DescribeDetectorError::ResourceNotFound(err.msg))
1860                }
1861                "ThrottlingException" => {
1862                    return RusotoError::Service(DescribeDetectorError::Throttling(err.msg))
1863                }
1864                "ValidationException" => return RusotoError::Validation(err.msg),
1865                _ => {}
1866            }
1867        }
1868        RusotoError::Unknown(res)
1869    }
1870}
1871impl fmt::Display for DescribeDetectorError {
1872    #[allow(unused_variables)]
1873    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1874        match *self {
1875            DescribeDetectorError::InternalServer(ref cause) => write!(f, "{}", cause),
1876            DescribeDetectorError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1877            DescribeDetectorError::Throttling(ref cause) => write!(f, "{}", cause),
1878        }
1879    }
1880}
1881impl Error for DescribeDetectorError {}
1882/// Errors returned by DescribeModelVersions
1883#[derive(Debug, PartialEq)]
1884pub enum DescribeModelVersionsError {
1885    /// <p>An exception indicating an internal server error.</p>
1886    InternalServer(String),
1887    /// <p>An exception indicating the specified resource was not found.</p>
1888    ResourceNotFound(String),
1889    /// <p>An exception indicating a throttling error.</p>
1890    Throttling(String),
1891}
1892
1893impl DescribeModelVersionsError {
1894    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeModelVersionsError> {
1895        if let Some(err) = proto::json::Error::parse(&res) {
1896            match err.typ.as_str() {
1897                "InternalServerException" => {
1898                    return RusotoError::Service(DescribeModelVersionsError::InternalServer(
1899                        err.msg,
1900                    ))
1901                }
1902                "ResourceNotFoundException" => {
1903                    return RusotoError::Service(DescribeModelVersionsError::ResourceNotFound(
1904                        err.msg,
1905                    ))
1906                }
1907                "ThrottlingException" => {
1908                    return RusotoError::Service(DescribeModelVersionsError::Throttling(err.msg))
1909                }
1910                "ValidationException" => return RusotoError::Validation(err.msg),
1911                _ => {}
1912            }
1913        }
1914        RusotoError::Unknown(res)
1915    }
1916}
1917impl fmt::Display for DescribeModelVersionsError {
1918    #[allow(unused_variables)]
1919    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1920        match *self {
1921            DescribeModelVersionsError::InternalServer(ref cause) => write!(f, "{}", cause),
1922            DescribeModelVersionsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1923            DescribeModelVersionsError::Throttling(ref cause) => write!(f, "{}", cause),
1924        }
1925    }
1926}
1927impl Error for DescribeModelVersionsError {}
1928/// Errors returned by GetDetectorVersion
1929#[derive(Debug, PartialEq)]
1930pub enum GetDetectorVersionError {
1931    /// <p>An exception indicating an internal server error.</p>
1932    InternalServer(String),
1933    /// <p>An exception indicating the specified resource was not found.</p>
1934    ResourceNotFound(String),
1935    /// <p>An exception indicating a throttling error.</p>
1936    Throttling(String),
1937}
1938
1939impl GetDetectorVersionError {
1940    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDetectorVersionError> {
1941        if let Some(err) = proto::json::Error::parse(&res) {
1942            match err.typ.as_str() {
1943                "InternalServerException" => {
1944                    return RusotoError::Service(GetDetectorVersionError::InternalServer(err.msg))
1945                }
1946                "ResourceNotFoundException" => {
1947                    return RusotoError::Service(GetDetectorVersionError::ResourceNotFound(err.msg))
1948                }
1949                "ThrottlingException" => {
1950                    return RusotoError::Service(GetDetectorVersionError::Throttling(err.msg))
1951                }
1952                "ValidationException" => return RusotoError::Validation(err.msg),
1953                _ => {}
1954            }
1955        }
1956        RusotoError::Unknown(res)
1957    }
1958}
1959impl fmt::Display for GetDetectorVersionError {
1960    #[allow(unused_variables)]
1961    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1962        match *self {
1963            GetDetectorVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
1964            GetDetectorVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1965            GetDetectorVersionError::Throttling(ref cause) => write!(f, "{}", cause),
1966        }
1967    }
1968}
1969impl Error for GetDetectorVersionError {}
1970/// Errors returned by GetDetectors
1971#[derive(Debug, PartialEq)]
1972pub enum GetDetectorsError {
1973    /// <p>An exception indicating an internal server error.</p>
1974    InternalServer(String),
1975    /// <p>An exception indicating the specified resource was not found.</p>
1976    ResourceNotFound(String),
1977    /// <p>An exception indicating a throttling error.</p>
1978    Throttling(String),
1979}
1980
1981impl GetDetectorsError {
1982    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDetectorsError> {
1983        if let Some(err) = proto::json::Error::parse(&res) {
1984            match err.typ.as_str() {
1985                "InternalServerException" => {
1986                    return RusotoError::Service(GetDetectorsError::InternalServer(err.msg))
1987                }
1988                "ResourceNotFoundException" => {
1989                    return RusotoError::Service(GetDetectorsError::ResourceNotFound(err.msg))
1990                }
1991                "ThrottlingException" => {
1992                    return RusotoError::Service(GetDetectorsError::Throttling(err.msg))
1993                }
1994                "ValidationException" => return RusotoError::Validation(err.msg),
1995                _ => {}
1996            }
1997        }
1998        RusotoError::Unknown(res)
1999    }
2000}
2001impl fmt::Display for GetDetectorsError {
2002    #[allow(unused_variables)]
2003    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2004        match *self {
2005            GetDetectorsError::InternalServer(ref cause) => write!(f, "{}", cause),
2006            GetDetectorsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2007            GetDetectorsError::Throttling(ref cause) => write!(f, "{}", cause),
2008        }
2009    }
2010}
2011impl Error for GetDetectorsError {}
2012/// Errors returned by GetExternalModels
2013#[derive(Debug, PartialEq)]
2014pub enum GetExternalModelsError {
2015    /// <p>An exception indicating an internal server error.</p>
2016    InternalServer(String),
2017    /// <p>An exception indicating the specified resource was not found.</p>
2018    ResourceNotFound(String),
2019    /// <p>An exception indicating a throttling error.</p>
2020    Throttling(String),
2021}
2022
2023impl GetExternalModelsError {
2024    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetExternalModelsError> {
2025        if let Some(err) = proto::json::Error::parse(&res) {
2026            match err.typ.as_str() {
2027                "InternalServerException" => {
2028                    return RusotoError::Service(GetExternalModelsError::InternalServer(err.msg))
2029                }
2030                "ResourceNotFoundException" => {
2031                    return RusotoError::Service(GetExternalModelsError::ResourceNotFound(err.msg))
2032                }
2033                "ThrottlingException" => {
2034                    return RusotoError::Service(GetExternalModelsError::Throttling(err.msg))
2035                }
2036                "ValidationException" => return RusotoError::Validation(err.msg),
2037                _ => {}
2038            }
2039        }
2040        RusotoError::Unknown(res)
2041    }
2042}
2043impl fmt::Display for GetExternalModelsError {
2044    #[allow(unused_variables)]
2045    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2046        match *self {
2047            GetExternalModelsError::InternalServer(ref cause) => write!(f, "{}", cause),
2048            GetExternalModelsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2049            GetExternalModelsError::Throttling(ref cause) => write!(f, "{}", cause),
2050        }
2051    }
2052}
2053impl Error for GetExternalModelsError {}
2054/// Errors returned by GetModelVersion
2055#[derive(Debug, PartialEq)]
2056pub enum GetModelVersionError {
2057    /// <p>An exception indicating an internal server error.</p>
2058    InternalServer(String),
2059    /// <p>An exception indicating the specified resource was not found.</p>
2060    ResourceNotFound(String),
2061    /// <p>An exception indicating a throttling error.</p>
2062    Throttling(String),
2063}
2064
2065impl GetModelVersionError {
2066    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetModelVersionError> {
2067        if let Some(err) = proto::json::Error::parse(&res) {
2068            match err.typ.as_str() {
2069                "InternalServerException" => {
2070                    return RusotoError::Service(GetModelVersionError::InternalServer(err.msg))
2071                }
2072                "ResourceNotFoundException" => {
2073                    return RusotoError::Service(GetModelVersionError::ResourceNotFound(err.msg))
2074                }
2075                "ThrottlingException" => {
2076                    return RusotoError::Service(GetModelVersionError::Throttling(err.msg))
2077                }
2078                "ValidationException" => return RusotoError::Validation(err.msg),
2079                _ => {}
2080            }
2081        }
2082        RusotoError::Unknown(res)
2083    }
2084}
2085impl fmt::Display for GetModelVersionError {
2086    #[allow(unused_variables)]
2087    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2088        match *self {
2089            GetModelVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
2090            GetModelVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2091            GetModelVersionError::Throttling(ref cause) => write!(f, "{}", cause),
2092        }
2093    }
2094}
2095impl Error for GetModelVersionError {}
2096/// Errors returned by GetModels
2097#[derive(Debug, PartialEq)]
2098pub enum GetModelsError {
2099    /// <p>An exception indicating an internal server error.</p>
2100    InternalServer(String),
2101    /// <p>An exception indicating the specified resource was not found.</p>
2102    ResourceNotFound(String),
2103    /// <p>An exception indicating a throttling error.</p>
2104    Throttling(String),
2105}
2106
2107impl GetModelsError {
2108    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetModelsError> {
2109        if let Some(err) = proto::json::Error::parse(&res) {
2110            match err.typ.as_str() {
2111                "InternalServerException" => {
2112                    return RusotoError::Service(GetModelsError::InternalServer(err.msg))
2113                }
2114                "ResourceNotFoundException" => {
2115                    return RusotoError::Service(GetModelsError::ResourceNotFound(err.msg))
2116                }
2117                "ThrottlingException" => {
2118                    return RusotoError::Service(GetModelsError::Throttling(err.msg))
2119                }
2120                "ValidationException" => return RusotoError::Validation(err.msg),
2121                _ => {}
2122            }
2123        }
2124        RusotoError::Unknown(res)
2125    }
2126}
2127impl fmt::Display for GetModelsError {
2128    #[allow(unused_variables)]
2129    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2130        match *self {
2131            GetModelsError::InternalServer(ref cause) => write!(f, "{}", cause),
2132            GetModelsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2133            GetModelsError::Throttling(ref cause) => write!(f, "{}", cause),
2134        }
2135    }
2136}
2137impl Error for GetModelsError {}
2138/// Errors returned by GetOutcomes
2139#[derive(Debug, PartialEq)]
2140pub enum GetOutcomesError {
2141    /// <p>An exception indicating an internal server error.</p>
2142    InternalServer(String),
2143    /// <p>An exception indicating the specified resource was not found.</p>
2144    ResourceNotFound(String),
2145    /// <p>An exception indicating a throttling error.</p>
2146    Throttling(String),
2147}
2148
2149impl GetOutcomesError {
2150    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetOutcomesError> {
2151        if let Some(err) = proto::json::Error::parse(&res) {
2152            match err.typ.as_str() {
2153                "InternalServerException" => {
2154                    return RusotoError::Service(GetOutcomesError::InternalServer(err.msg))
2155                }
2156                "ResourceNotFoundException" => {
2157                    return RusotoError::Service(GetOutcomesError::ResourceNotFound(err.msg))
2158                }
2159                "ThrottlingException" => {
2160                    return RusotoError::Service(GetOutcomesError::Throttling(err.msg))
2161                }
2162                "ValidationException" => return RusotoError::Validation(err.msg),
2163                _ => {}
2164            }
2165        }
2166        RusotoError::Unknown(res)
2167    }
2168}
2169impl fmt::Display for GetOutcomesError {
2170    #[allow(unused_variables)]
2171    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2172        match *self {
2173            GetOutcomesError::InternalServer(ref cause) => write!(f, "{}", cause),
2174            GetOutcomesError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2175            GetOutcomesError::Throttling(ref cause) => write!(f, "{}", cause),
2176        }
2177    }
2178}
2179impl Error for GetOutcomesError {}
2180/// Errors returned by GetPrediction
2181#[derive(Debug, PartialEq)]
2182pub enum GetPredictionError {
2183    /// <p>An exception indicating an internal server error.</p>
2184    InternalServer(String),
2185    /// <p>An exception indicating the specified resource was not found.</p>
2186    ResourceNotFound(String),
2187    /// <p>An exception indicating a throttling error.</p>
2188    Throttling(String),
2189}
2190
2191impl GetPredictionError {
2192    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetPredictionError> {
2193        if let Some(err) = proto::json::Error::parse(&res) {
2194            match err.typ.as_str() {
2195                "InternalServerException" => {
2196                    return RusotoError::Service(GetPredictionError::InternalServer(err.msg))
2197                }
2198                "ResourceNotFoundException" => {
2199                    return RusotoError::Service(GetPredictionError::ResourceNotFound(err.msg))
2200                }
2201                "ThrottlingException" => {
2202                    return RusotoError::Service(GetPredictionError::Throttling(err.msg))
2203                }
2204                "ValidationException" => return RusotoError::Validation(err.msg),
2205                _ => {}
2206            }
2207        }
2208        RusotoError::Unknown(res)
2209    }
2210}
2211impl fmt::Display for GetPredictionError {
2212    #[allow(unused_variables)]
2213    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2214        match *self {
2215            GetPredictionError::InternalServer(ref cause) => write!(f, "{}", cause),
2216            GetPredictionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2217            GetPredictionError::Throttling(ref cause) => write!(f, "{}", cause),
2218        }
2219    }
2220}
2221impl Error for GetPredictionError {}
2222/// Errors returned by GetRules
2223#[derive(Debug, PartialEq)]
2224pub enum GetRulesError {
2225    /// <p>An exception indicating an internal server error.</p>
2226    InternalServer(String),
2227    /// <p>An exception indicating the specified resource was not found.</p>
2228    ResourceNotFound(String),
2229    /// <p>An exception indicating a throttling error.</p>
2230    Throttling(String),
2231}
2232
2233impl GetRulesError {
2234    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetRulesError> {
2235        if let Some(err) = proto::json::Error::parse(&res) {
2236            match err.typ.as_str() {
2237                "InternalServerException" => {
2238                    return RusotoError::Service(GetRulesError::InternalServer(err.msg))
2239                }
2240                "ResourceNotFoundException" => {
2241                    return RusotoError::Service(GetRulesError::ResourceNotFound(err.msg))
2242                }
2243                "ThrottlingException" => {
2244                    return RusotoError::Service(GetRulesError::Throttling(err.msg))
2245                }
2246                "ValidationException" => return RusotoError::Validation(err.msg),
2247                _ => {}
2248            }
2249        }
2250        RusotoError::Unknown(res)
2251    }
2252}
2253impl fmt::Display for GetRulesError {
2254    #[allow(unused_variables)]
2255    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2256        match *self {
2257            GetRulesError::InternalServer(ref cause) => write!(f, "{}", cause),
2258            GetRulesError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2259            GetRulesError::Throttling(ref cause) => write!(f, "{}", cause),
2260        }
2261    }
2262}
2263impl Error for GetRulesError {}
2264/// Errors returned by GetVariables
2265#[derive(Debug, PartialEq)]
2266pub enum GetVariablesError {
2267    /// <p>An exception indicating an internal server error.</p>
2268    InternalServer(String),
2269    /// <p>An exception indicating the specified resource was not found.</p>
2270    ResourceNotFound(String),
2271    /// <p>An exception indicating a throttling error.</p>
2272    Throttling(String),
2273}
2274
2275impl GetVariablesError {
2276    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetVariablesError> {
2277        if let Some(err) = proto::json::Error::parse(&res) {
2278            match err.typ.as_str() {
2279                "InternalServerException" => {
2280                    return RusotoError::Service(GetVariablesError::InternalServer(err.msg))
2281                }
2282                "ResourceNotFoundException" => {
2283                    return RusotoError::Service(GetVariablesError::ResourceNotFound(err.msg))
2284                }
2285                "ThrottlingException" => {
2286                    return RusotoError::Service(GetVariablesError::Throttling(err.msg))
2287                }
2288                "ValidationException" => return RusotoError::Validation(err.msg),
2289                _ => {}
2290            }
2291        }
2292        RusotoError::Unknown(res)
2293    }
2294}
2295impl fmt::Display for GetVariablesError {
2296    #[allow(unused_variables)]
2297    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2298        match *self {
2299            GetVariablesError::InternalServer(ref cause) => write!(f, "{}", cause),
2300            GetVariablesError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2301            GetVariablesError::Throttling(ref cause) => write!(f, "{}", cause),
2302        }
2303    }
2304}
2305impl Error for GetVariablesError {}
2306/// Errors returned by PutDetector
2307#[derive(Debug, PartialEq)]
2308pub enum PutDetectorError {
2309    /// <p>An exception indicating an internal server error.</p>
2310    InternalServer(String),
2311    /// <p>An exception indicating a throttling error.</p>
2312    Throttling(String),
2313}
2314
2315impl PutDetectorError {
2316    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutDetectorError> {
2317        if let Some(err) = proto::json::Error::parse(&res) {
2318            match err.typ.as_str() {
2319                "InternalServerException" => {
2320                    return RusotoError::Service(PutDetectorError::InternalServer(err.msg))
2321                }
2322                "ThrottlingException" => {
2323                    return RusotoError::Service(PutDetectorError::Throttling(err.msg))
2324                }
2325                "ValidationException" => return RusotoError::Validation(err.msg),
2326                _ => {}
2327            }
2328        }
2329        RusotoError::Unknown(res)
2330    }
2331}
2332impl fmt::Display for PutDetectorError {
2333    #[allow(unused_variables)]
2334    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2335        match *self {
2336            PutDetectorError::InternalServer(ref cause) => write!(f, "{}", cause),
2337            PutDetectorError::Throttling(ref cause) => write!(f, "{}", cause),
2338        }
2339    }
2340}
2341impl Error for PutDetectorError {}
2342/// Errors returned by PutExternalModel
2343#[derive(Debug, PartialEq)]
2344pub enum PutExternalModelError {
2345    /// <p>An exception indicating an internal server error.</p>
2346    InternalServer(String),
2347    /// <p>An exception indicating a throttling error.</p>
2348    Throttling(String),
2349}
2350
2351impl PutExternalModelError {
2352    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutExternalModelError> {
2353        if let Some(err) = proto::json::Error::parse(&res) {
2354            match err.typ.as_str() {
2355                "InternalServerException" => {
2356                    return RusotoError::Service(PutExternalModelError::InternalServer(err.msg))
2357                }
2358                "ThrottlingException" => {
2359                    return RusotoError::Service(PutExternalModelError::Throttling(err.msg))
2360                }
2361                "ValidationException" => return RusotoError::Validation(err.msg),
2362                _ => {}
2363            }
2364        }
2365        RusotoError::Unknown(res)
2366    }
2367}
2368impl fmt::Display for PutExternalModelError {
2369    #[allow(unused_variables)]
2370    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2371        match *self {
2372            PutExternalModelError::InternalServer(ref cause) => write!(f, "{}", cause),
2373            PutExternalModelError::Throttling(ref cause) => write!(f, "{}", cause),
2374        }
2375    }
2376}
2377impl Error for PutExternalModelError {}
2378/// Errors returned by PutModel
2379#[derive(Debug, PartialEq)]
2380pub enum PutModelError {
2381    /// <p>An exception indicating an internal server error.</p>
2382    InternalServer(String),
2383    /// <p>An exception indicating a throttling error.</p>
2384    Throttling(String),
2385}
2386
2387impl PutModelError {
2388    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutModelError> {
2389        if let Some(err) = proto::json::Error::parse(&res) {
2390            match err.typ.as_str() {
2391                "InternalServerException" => {
2392                    return RusotoError::Service(PutModelError::InternalServer(err.msg))
2393                }
2394                "ThrottlingException" => {
2395                    return RusotoError::Service(PutModelError::Throttling(err.msg))
2396                }
2397                "ValidationException" => return RusotoError::Validation(err.msg),
2398                _ => {}
2399            }
2400        }
2401        RusotoError::Unknown(res)
2402    }
2403}
2404impl fmt::Display for PutModelError {
2405    #[allow(unused_variables)]
2406    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2407        match *self {
2408            PutModelError::InternalServer(ref cause) => write!(f, "{}", cause),
2409            PutModelError::Throttling(ref cause) => write!(f, "{}", cause),
2410        }
2411    }
2412}
2413impl Error for PutModelError {}
2414/// Errors returned by PutOutcome
2415#[derive(Debug, PartialEq)]
2416pub enum PutOutcomeError {
2417    /// <p>An exception indicating an internal server error.</p>
2418    InternalServer(String),
2419    /// <p>An exception indicating a throttling error.</p>
2420    Throttling(String),
2421}
2422
2423impl PutOutcomeError {
2424    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutOutcomeError> {
2425        if let Some(err) = proto::json::Error::parse(&res) {
2426            match err.typ.as_str() {
2427                "InternalServerException" => {
2428                    return RusotoError::Service(PutOutcomeError::InternalServer(err.msg))
2429                }
2430                "ThrottlingException" => {
2431                    return RusotoError::Service(PutOutcomeError::Throttling(err.msg))
2432                }
2433                "ValidationException" => return RusotoError::Validation(err.msg),
2434                _ => {}
2435            }
2436        }
2437        RusotoError::Unknown(res)
2438    }
2439}
2440impl fmt::Display for PutOutcomeError {
2441    #[allow(unused_variables)]
2442    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2443        match *self {
2444            PutOutcomeError::InternalServer(ref cause) => write!(f, "{}", cause),
2445            PutOutcomeError::Throttling(ref cause) => write!(f, "{}", cause),
2446        }
2447    }
2448}
2449impl Error for PutOutcomeError {}
2450/// Errors returned by UpdateDetectorVersion
2451#[derive(Debug, PartialEq)]
2452pub enum UpdateDetectorVersionError {
2453    /// <p>An exception indicating an internal server error.</p>
2454    InternalServer(String),
2455    /// <p>An exception indicating the specified resource was not found.</p>
2456    ResourceNotFound(String),
2457    /// <p>An exception indicating a throttling error.</p>
2458    Throttling(String),
2459}
2460
2461impl UpdateDetectorVersionError {
2462    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateDetectorVersionError> {
2463        if let Some(err) = proto::json::Error::parse(&res) {
2464            match err.typ.as_str() {
2465                "InternalServerException" => {
2466                    return RusotoError::Service(UpdateDetectorVersionError::InternalServer(
2467                        err.msg,
2468                    ))
2469                }
2470                "ResourceNotFoundException" => {
2471                    return RusotoError::Service(UpdateDetectorVersionError::ResourceNotFound(
2472                        err.msg,
2473                    ))
2474                }
2475                "ThrottlingException" => {
2476                    return RusotoError::Service(UpdateDetectorVersionError::Throttling(err.msg))
2477                }
2478                "ValidationException" => return RusotoError::Validation(err.msg),
2479                _ => {}
2480            }
2481        }
2482        RusotoError::Unknown(res)
2483    }
2484}
2485impl fmt::Display for UpdateDetectorVersionError {
2486    #[allow(unused_variables)]
2487    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2488        match *self {
2489            UpdateDetectorVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
2490            UpdateDetectorVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2491            UpdateDetectorVersionError::Throttling(ref cause) => write!(f, "{}", cause),
2492        }
2493    }
2494}
2495impl Error for UpdateDetectorVersionError {}
2496/// Errors returned by UpdateDetectorVersionMetadata
2497#[derive(Debug, PartialEq)]
2498pub enum UpdateDetectorVersionMetadataError {
2499    /// <p>An exception indicating an internal server error.</p>
2500    InternalServer(String),
2501    /// <p>An exception indicating a throttling error.</p>
2502    Throttling(String),
2503}
2504
2505impl UpdateDetectorVersionMetadataError {
2506    pub fn from_response(
2507        res: BufferedHttpResponse,
2508    ) -> RusotoError<UpdateDetectorVersionMetadataError> {
2509        if let Some(err) = proto::json::Error::parse(&res) {
2510            match err.typ.as_str() {
2511                "InternalServerException" => {
2512                    return RusotoError::Service(
2513                        UpdateDetectorVersionMetadataError::InternalServer(err.msg),
2514                    )
2515                }
2516                "ThrottlingException" => {
2517                    return RusotoError::Service(UpdateDetectorVersionMetadataError::Throttling(
2518                        err.msg,
2519                    ))
2520                }
2521                "ValidationException" => return RusotoError::Validation(err.msg),
2522                _ => {}
2523            }
2524        }
2525        RusotoError::Unknown(res)
2526    }
2527}
2528impl fmt::Display for UpdateDetectorVersionMetadataError {
2529    #[allow(unused_variables)]
2530    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2531        match *self {
2532            UpdateDetectorVersionMetadataError::InternalServer(ref cause) => write!(f, "{}", cause),
2533            UpdateDetectorVersionMetadataError::Throttling(ref cause) => write!(f, "{}", cause),
2534        }
2535    }
2536}
2537impl Error for UpdateDetectorVersionMetadataError {}
2538/// Errors returned by UpdateDetectorVersionStatus
2539#[derive(Debug, PartialEq)]
2540pub enum UpdateDetectorVersionStatusError {
2541    /// <p>An exception indicating an internal server error.</p>
2542    InternalServer(String),
2543    /// <p>An exception indicating the specified resource was not found.</p>
2544    ResourceNotFound(String),
2545    /// <p>An exception indicating a throttling error.</p>
2546    Throttling(String),
2547}
2548
2549impl UpdateDetectorVersionStatusError {
2550    pub fn from_response(
2551        res: BufferedHttpResponse,
2552    ) -> RusotoError<UpdateDetectorVersionStatusError> {
2553        if let Some(err) = proto::json::Error::parse(&res) {
2554            match err.typ.as_str() {
2555                "InternalServerException" => {
2556                    return RusotoError::Service(UpdateDetectorVersionStatusError::InternalServer(
2557                        err.msg,
2558                    ))
2559                }
2560                "ResourceNotFoundException" => {
2561                    return RusotoError::Service(
2562                        UpdateDetectorVersionStatusError::ResourceNotFound(err.msg),
2563                    )
2564                }
2565                "ThrottlingException" => {
2566                    return RusotoError::Service(UpdateDetectorVersionStatusError::Throttling(
2567                        err.msg,
2568                    ))
2569                }
2570                "ValidationException" => return RusotoError::Validation(err.msg),
2571                _ => {}
2572            }
2573        }
2574        RusotoError::Unknown(res)
2575    }
2576}
2577impl fmt::Display for UpdateDetectorVersionStatusError {
2578    #[allow(unused_variables)]
2579    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2580        match *self {
2581            UpdateDetectorVersionStatusError::InternalServer(ref cause) => write!(f, "{}", cause),
2582            UpdateDetectorVersionStatusError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2583            UpdateDetectorVersionStatusError::Throttling(ref cause) => write!(f, "{}", cause),
2584        }
2585    }
2586}
2587impl Error for UpdateDetectorVersionStatusError {}
2588/// Errors returned by UpdateModelVersion
2589#[derive(Debug, PartialEq)]
2590pub enum UpdateModelVersionError {
2591    /// <p>An exception indicating an internal server error.</p>
2592    InternalServer(String),
2593    /// <p>An exception indicating the specified resource was not found.</p>
2594    ResourceNotFound(String),
2595    /// <p>An exception indicating a throttling error.</p>
2596    Throttling(String),
2597}
2598
2599impl UpdateModelVersionError {
2600    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateModelVersionError> {
2601        if let Some(err) = proto::json::Error::parse(&res) {
2602            match err.typ.as_str() {
2603                "InternalServerException" => {
2604                    return RusotoError::Service(UpdateModelVersionError::InternalServer(err.msg))
2605                }
2606                "ResourceNotFoundException" => {
2607                    return RusotoError::Service(UpdateModelVersionError::ResourceNotFound(err.msg))
2608                }
2609                "ThrottlingException" => {
2610                    return RusotoError::Service(UpdateModelVersionError::Throttling(err.msg))
2611                }
2612                "ValidationException" => return RusotoError::Validation(err.msg),
2613                _ => {}
2614            }
2615        }
2616        RusotoError::Unknown(res)
2617    }
2618}
2619impl fmt::Display for UpdateModelVersionError {
2620    #[allow(unused_variables)]
2621    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2622        match *self {
2623            UpdateModelVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
2624            UpdateModelVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2625            UpdateModelVersionError::Throttling(ref cause) => write!(f, "{}", cause),
2626        }
2627    }
2628}
2629impl Error for UpdateModelVersionError {}
2630/// Errors returned by UpdateRuleMetadata
2631#[derive(Debug, PartialEq)]
2632pub enum UpdateRuleMetadataError {
2633    /// <p>An exception indicating an internal server error.</p>
2634    InternalServer(String),
2635    /// <p>An exception indicating the specified resource was not found.</p>
2636    ResourceNotFound(String),
2637    /// <p>An exception indicating a throttling error.</p>
2638    Throttling(String),
2639}
2640
2641impl UpdateRuleMetadataError {
2642    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateRuleMetadataError> {
2643        if let Some(err) = proto::json::Error::parse(&res) {
2644            match err.typ.as_str() {
2645                "InternalServerException" => {
2646                    return RusotoError::Service(UpdateRuleMetadataError::InternalServer(err.msg))
2647                }
2648                "ResourceNotFoundException" => {
2649                    return RusotoError::Service(UpdateRuleMetadataError::ResourceNotFound(err.msg))
2650                }
2651                "ThrottlingException" => {
2652                    return RusotoError::Service(UpdateRuleMetadataError::Throttling(err.msg))
2653                }
2654                "ValidationException" => return RusotoError::Validation(err.msg),
2655                _ => {}
2656            }
2657        }
2658        RusotoError::Unknown(res)
2659    }
2660}
2661impl fmt::Display for UpdateRuleMetadataError {
2662    #[allow(unused_variables)]
2663    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2664        match *self {
2665            UpdateRuleMetadataError::InternalServer(ref cause) => write!(f, "{}", cause),
2666            UpdateRuleMetadataError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2667            UpdateRuleMetadataError::Throttling(ref cause) => write!(f, "{}", cause),
2668        }
2669    }
2670}
2671impl Error for UpdateRuleMetadataError {}
2672/// Errors returned by UpdateRuleVersion
2673#[derive(Debug, PartialEq)]
2674pub enum UpdateRuleVersionError {
2675    /// <p>An exception indicating an internal server error.</p>
2676    InternalServer(String),
2677    /// <p>An exception indicating the specified resource was not found.</p>
2678    ResourceNotFound(String),
2679    /// <p>An exception indicating a throttling error.</p>
2680    Throttling(String),
2681}
2682
2683impl UpdateRuleVersionError {
2684    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateRuleVersionError> {
2685        if let Some(err) = proto::json::Error::parse(&res) {
2686            match err.typ.as_str() {
2687                "InternalServerException" => {
2688                    return RusotoError::Service(UpdateRuleVersionError::InternalServer(err.msg))
2689                }
2690                "ResourceNotFoundException" => {
2691                    return RusotoError::Service(UpdateRuleVersionError::ResourceNotFound(err.msg))
2692                }
2693                "ThrottlingException" => {
2694                    return RusotoError::Service(UpdateRuleVersionError::Throttling(err.msg))
2695                }
2696                "ValidationException" => return RusotoError::Validation(err.msg),
2697                _ => {}
2698            }
2699        }
2700        RusotoError::Unknown(res)
2701    }
2702}
2703impl fmt::Display for UpdateRuleVersionError {
2704    #[allow(unused_variables)]
2705    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2706        match *self {
2707            UpdateRuleVersionError::InternalServer(ref cause) => write!(f, "{}", cause),
2708            UpdateRuleVersionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2709            UpdateRuleVersionError::Throttling(ref cause) => write!(f, "{}", cause),
2710        }
2711    }
2712}
2713impl Error for UpdateRuleVersionError {}
2714/// Errors returned by UpdateVariable
2715#[derive(Debug, PartialEq)]
2716pub enum UpdateVariableError {
2717    /// <p>An exception indicating an internal server error.</p>
2718    InternalServer(String),
2719    /// <p>An exception indicating the specified resource was not found.</p>
2720    ResourceNotFound(String),
2721    /// <p>An exception indicating a throttling error.</p>
2722    Throttling(String),
2723}
2724
2725impl UpdateVariableError {
2726    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateVariableError> {
2727        if let Some(err) = proto::json::Error::parse(&res) {
2728            match err.typ.as_str() {
2729                "InternalServerException" => {
2730                    return RusotoError::Service(UpdateVariableError::InternalServer(err.msg))
2731                }
2732                "ResourceNotFoundException" => {
2733                    return RusotoError::Service(UpdateVariableError::ResourceNotFound(err.msg))
2734                }
2735                "ThrottlingException" => {
2736                    return RusotoError::Service(UpdateVariableError::Throttling(err.msg))
2737                }
2738                "ValidationException" => return RusotoError::Validation(err.msg),
2739                _ => {}
2740            }
2741        }
2742        RusotoError::Unknown(res)
2743    }
2744}
2745impl fmt::Display for UpdateVariableError {
2746    #[allow(unused_variables)]
2747    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2748        match *self {
2749            UpdateVariableError::InternalServer(ref cause) => write!(f, "{}", cause),
2750            UpdateVariableError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2751            UpdateVariableError::Throttling(ref cause) => write!(f, "{}", cause),
2752        }
2753    }
2754}
2755impl Error for UpdateVariableError {}
2756/// Trait representing the capabilities of the Amazon Fraud Detector API. Amazon Fraud Detector clients implement this trait.
2757#[async_trait]
2758pub trait FraudDetector {
2759    /// <p>Creates a batch of variables.</p>
2760    async fn batch_create_variable(
2761        &self,
2762        input: BatchCreateVariableRequest,
2763    ) -> Result<BatchCreateVariableResult, RusotoError<BatchCreateVariableError>>;
2764
2765    /// <p>Gets a batch of variables.</p>
2766    async fn batch_get_variable(
2767        &self,
2768        input: BatchGetVariableRequest,
2769    ) -> Result<BatchGetVariableResult, RusotoError<BatchGetVariableError>>;
2770
2771    /// <p>Creates a detector version. The detector version starts in a <code>DRAFT</code> status.</p>
2772    async fn create_detector_version(
2773        &self,
2774        input: CreateDetectorVersionRequest,
2775    ) -> Result<CreateDetectorVersionResult, RusotoError<CreateDetectorVersionError>>;
2776
2777    /// <p>Creates a version of the model using the specified model type. </p>
2778    async fn create_model_version(
2779        &self,
2780        input: CreateModelVersionRequest,
2781    ) -> Result<CreateModelVersionResult, RusotoError<CreateModelVersionError>>;
2782
2783    /// <p>Creates a rule for use with the specified detector. </p>
2784    async fn create_rule(
2785        &self,
2786        input: CreateRuleRequest,
2787    ) -> Result<CreateRuleResult, RusotoError<CreateRuleError>>;
2788
2789    /// <p>Creates a variable.</p>
2790    async fn create_variable(
2791        &self,
2792        input: CreateVariableRequest,
2793    ) -> Result<CreateVariableResult, RusotoError<CreateVariableError>>;
2794
2795    /// <p>Deletes the detector. Before deleting a detector, you must first delete all detector versions and rule versions associated with the detector.</p>
2796    async fn delete_detector(
2797        &self,
2798        input: DeleteDetectorRequest,
2799    ) -> Result<DeleteDetectorResult, RusotoError<DeleteDetectorError>>;
2800
2801    /// <p>Deletes the detector version. You cannot delete detector versions that are in <code>ACTIVE</code> status.</p>
2802    async fn delete_detector_version(
2803        &self,
2804        input: DeleteDetectorVersionRequest,
2805    ) -> Result<DeleteDetectorVersionResult, RusotoError<DeleteDetectorVersionError>>;
2806
2807    /// <p>Deletes the specified event.</p>
2808    async fn delete_event(
2809        &self,
2810        input: DeleteEventRequest,
2811    ) -> Result<DeleteEventResult, RusotoError<DeleteEventError>>;
2812
2813    /// <p>Deletes the rule version. You cannot delete a rule version if it is used by an <code>ACTIVE</code> or <code>INACTIVE</code> detector version.</p>
2814    async fn delete_rule_version(
2815        &self,
2816        input: DeleteRuleVersionRequest,
2817    ) -> Result<DeleteRuleVersionResult, RusotoError<DeleteRuleVersionError>>;
2818
2819    /// <p>Gets all versions for a specified detector.</p>
2820    async fn describe_detector(
2821        &self,
2822        input: DescribeDetectorRequest,
2823    ) -> Result<DescribeDetectorResult, RusotoError<DescribeDetectorError>>;
2824
2825    /// <p>Gets all of the model versions for the specified model type or for the specified model type and model ID. You can also get details for a single, specified model version. </p>
2826    async fn describe_model_versions(
2827        &self,
2828        input: DescribeModelVersionsRequest,
2829    ) -> Result<DescribeModelVersionsResult, RusotoError<DescribeModelVersionsError>>;
2830
2831    /// <p>Gets a particular detector version. </p>
2832    async fn get_detector_version(
2833        &self,
2834        input: GetDetectorVersionRequest,
2835    ) -> Result<GetDetectorVersionResult, RusotoError<GetDetectorVersionError>>;
2836
2837    /// <p>Gets all of detectors. This is a paginated API. If you provide a null <code>maxSizePerPage</code>, this actions retrieves a maximum of 10 records per page. If you provide a <code>maxSizePerPage</code>, the value must be between 5 and 10. To get the next page results, provide the pagination token from the <code>GetEventTypesResponse</code> as part of your request. A null pagination token fetches the records from the beginning. </p>
2838    async fn get_detectors(
2839        &self,
2840        input: GetDetectorsRequest,
2841    ) -> Result<GetDetectorsResult, RusotoError<GetDetectorsError>>;
2842
2843    /// <p>Gets the details for one or more Amazon SageMaker models that have been imported into the service. This is a paginated API. If you provide a null <code>maxSizePerPage</code>, this actions retrieves a maximum of 10 records per page. If you provide a <code>maxSizePerPage</code>, the value must be between 5 and 10. To get the next page results, provide the pagination token from the <code>GetExternalModelsResult</code> as part of your request. A null pagination token fetches the records from the beginning. </p>
2844    async fn get_external_models(
2845        &self,
2846        input: GetExternalModelsRequest,
2847    ) -> Result<GetExternalModelsResult, RusotoError<GetExternalModelsError>>;
2848
2849    /// <p>Gets a model version. </p>
2850    async fn get_model_version(
2851        &self,
2852        input: GetModelVersionRequest,
2853    ) -> Result<GetModelVersionResult, RusotoError<GetModelVersionError>>;
2854
2855    /// <p>Gets all of the models for the AWS account, or the specified model type, or gets a single model for the specified model type, model ID combination. </p>
2856    async fn get_models(
2857        &self,
2858        input: GetModelsRequest,
2859    ) -> Result<GetModelsResult, RusotoError<GetModelsError>>;
2860
2861    /// <p>Gets one or more outcomes. This is a paginated API. If you provide a null <code>maxSizePerPage</code>, this actions retrieves a maximum of 10 records per page. If you provide a <code>maxSizePerPage</code>, the value must be between 50 and 100. To get the next page results, provide the pagination token from the <code>GetOutcomesResult</code> as part of your request. A null pagination token fetches the records from the beginning. </p>
2862    async fn get_outcomes(
2863        &self,
2864        input: GetOutcomesRequest,
2865    ) -> Result<GetOutcomesResult, RusotoError<GetOutcomesError>>;
2866
2867    /// <p>Evaluates an event against a detector version. If a version ID is not provided, the detector’s (<code>ACTIVE</code>) version is used. </p>
2868    async fn get_prediction(
2869        &self,
2870        input: GetPredictionRequest,
2871    ) -> Result<GetPredictionResult, RusotoError<GetPredictionError>>;
2872
2873    /// <p>Gets all rules available for the specified detector.</p>
2874    async fn get_rules(
2875        &self,
2876        input: GetRulesRequest,
2877    ) -> Result<GetRulesResult, RusotoError<GetRulesError>>;
2878
2879    /// <p>Gets all of the variables or the specific variable. This is a paginated API. Providing null <code>maxSizePerPage</code> results in retrieving maximum of 100 records per page. If you provide <code>maxSizePerPage</code> the value must be between 50 and 100. To get the next page result, a provide a pagination token from <code>GetVariablesResult</code> as part of your request. Null pagination token fetches the records from the beginning. </p>
2880    async fn get_variables(
2881        &self,
2882        input: GetVariablesRequest,
2883    ) -> Result<GetVariablesResult, RusotoError<GetVariablesError>>;
2884
2885    /// <p>Creates or updates a detector. </p>
2886    async fn put_detector(
2887        &self,
2888        input: PutDetectorRequest,
2889    ) -> Result<PutDetectorResult, RusotoError<PutDetectorError>>;
2890
2891    /// <p>Creates or updates an Amazon SageMaker model endpoint. You can also use this action to update the configuration of the model endpoint, including the IAM role and/or the mapped variables. </p>
2892    async fn put_external_model(
2893        &self,
2894        input: PutExternalModelRequest,
2895    ) -> Result<PutExternalModelResult, RusotoError<PutExternalModelError>>;
2896
2897    /// <p>Creates or updates a model. </p>
2898    async fn put_model(
2899        &self,
2900        input: PutModelRequest,
2901    ) -> Result<PutModelResult, RusotoError<PutModelError>>;
2902
2903    /// <p>Creates or updates an outcome. </p>
2904    async fn put_outcome(
2905        &self,
2906        input: PutOutcomeRequest,
2907    ) -> Result<PutOutcomeResult, RusotoError<PutOutcomeError>>;
2908
2909    /// <p> Updates a detector version. The detector version attributes that you can update include models, external model endpoints, rules, and description. You can only update a <code>DRAFT</code> detector version.</p>
2910    async fn update_detector_version(
2911        &self,
2912        input: UpdateDetectorVersionRequest,
2913    ) -> Result<UpdateDetectorVersionResult, RusotoError<UpdateDetectorVersionError>>;
2914
2915    /// <p>Updates the detector version's description. You can update the metadata for any detector version (<code>DRAFT, ACTIVE,</code> or <code>INACTIVE</code>). </p>
2916    async fn update_detector_version_metadata(
2917        &self,
2918        input: UpdateDetectorVersionMetadataRequest,
2919    ) -> Result<UpdateDetectorVersionMetadataResult, RusotoError<UpdateDetectorVersionMetadataError>>;
2920
2921    /// <p>Updates the detector version’s status. You can perform the following promotions or demotions using <code>UpdateDetectorVersionStatus</code>: <code>DRAFT</code> to <code>ACTIVE</code>, <code>ACTIVE</code> to <code>INACTIVE</code>, and <code>INACTIVE</code> to <code>ACTIVE</code>.</p>
2922    async fn update_detector_version_status(
2923        &self,
2924        input: UpdateDetectorVersionStatusRequest,
2925    ) -> Result<UpdateDetectorVersionStatusResult, RusotoError<UpdateDetectorVersionStatusError>>;
2926
2927    /// <p><p>Updates a model version. You can update the description and status attributes using this action. You can perform the following status updates: </p> <ol> <li> <p>Change the <code>TRAINING<em>COMPLETE</code> status to <code>ACTIVE</code> </p> </li> <li> <p>Change <code>ACTIVE</code> back to <code>TRAINING</em>COMPLETE</code> </p> </li> </ol></p>
2928    async fn update_model_version(
2929        &self,
2930        input: UpdateModelVersionRequest,
2931    ) -> Result<UpdateModelVersionResult, RusotoError<UpdateModelVersionError>>;
2932
2933    /// <p>Updates a rule's metadata. </p>
2934    async fn update_rule_metadata(
2935        &self,
2936        input: UpdateRuleMetadataRequest,
2937    ) -> Result<UpdateRuleMetadataResult, RusotoError<UpdateRuleMetadataError>>;
2938
2939    /// <p>Updates a rule version resulting in a new rule version. </p>
2940    async fn update_rule_version(
2941        &self,
2942        input: UpdateRuleVersionRequest,
2943    ) -> Result<UpdateRuleVersionResult, RusotoError<UpdateRuleVersionError>>;
2944
2945    /// <p>Updates a variable.</p>
2946    async fn update_variable(
2947        &self,
2948        input: UpdateVariableRequest,
2949    ) -> Result<UpdateVariableResult, RusotoError<UpdateVariableError>>;
2950}
2951/// A client for the Amazon Fraud Detector API.
2952#[derive(Clone)]
2953pub struct FraudDetectorClient {
2954    client: Client,
2955    region: region::Region,
2956}
2957
2958impl FraudDetectorClient {
2959    /// Creates a client backed by the default tokio event loop.
2960    ///
2961    /// The client will use the default credentials provider and tls client.
2962    pub fn new(region: region::Region) -> FraudDetectorClient {
2963        FraudDetectorClient {
2964            client: Client::shared(),
2965            region,
2966        }
2967    }
2968
2969    pub fn new_with<P, D>(
2970        request_dispatcher: D,
2971        credentials_provider: P,
2972        region: region::Region,
2973    ) -> FraudDetectorClient
2974    where
2975        P: ProvideAwsCredentials + Send + Sync + 'static,
2976        D: DispatchSignedRequest + Send + Sync + 'static,
2977    {
2978        FraudDetectorClient {
2979            client: Client::new_with(credentials_provider, request_dispatcher),
2980            region,
2981        }
2982    }
2983
2984    pub fn new_with_client(client: Client, region: region::Region) -> FraudDetectorClient {
2985        FraudDetectorClient { client, region }
2986    }
2987}
2988
2989#[async_trait]
2990impl FraudDetector for FraudDetectorClient {
2991    /// <p>Creates a batch of variables.</p>
2992    async fn batch_create_variable(
2993        &self,
2994        input: BatchCreateVariableRequest,
2995    ) -> Result<BatchCreateVariableResult, RusotoError<BatchCreateVariableError>> {
2996        let mut request = self.new_signed_request("POST", "/");
2997        request.add_header(
2998            "x-amz-target",
2999            "AWSHawksNestServiceFacade.BatchCreateVariable",
3000        );
3001        let encoded = serde_json::to_string(&input).unwrap();
3002        request.set_payload(Some(encoded));
3003
3004        let response = self
3005            .sign_and_dispatch(request, BatchCreateVariableError::from_response)
3006            .await?;
3007        let mut response = response;
3008        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3009        proto::json::ResponsePayload::new(&response).deserialize::<BatchCreateVariableResult, _>()
3010    }
3011
3012    /// <p>Gets a batch of variables.</p>
3013    async fn batch_get_variable(
3014        &self,
3015        input: BatchGetVariableRequest,
3016    ) -> Result<BatchGetVariableResult, RusotoError<BatchGetVariableError>> {
3017        let mut request = self.new_signed_request("POST", "/");
3018        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.BatchGetVariable");
3019        let encoded = serde_json::to_string(&input).unwrap();
3020        request.set_payload(Some(encoded));
3021
3022        let response = self
3023            .sign_and_dispatch(request, BatchGetVariableError::from_response)
3024            .await?;
3025        let mut response = response;
3026        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3027        proto::json::ResponsePayload::new(&response).deserialize::<BatchGetVariableResult, _>()
3028    }
3029
3030    /// <p>Creates a detector version. The detector version starts in a <code>DRAFT</code> status.</p>
3031    async fn create_detector_version(
3032        &self,
3033        input: CreateDetectorVersionRequest,
3034    ) -> Result<CreateDetectorVersionResult, RusotoError<CreateDetectorVersionError>> {
3035        let mut request = self.new_signed_request("POST", "/");
3036        request.add_header(
3037            "x-amz-target",
3038            "AWSHawksNestServiceFacade.CreateDetectorVersion",
3039        );
3040        let encoded = serde_json::to_string(&input).unwrap();
3041        request.set_payload(Some(encoded));
3042
3043        let response = self
3044            .sign_and_dispatch(request, CreateDetectorVersionError::from_response)
3045            .await?;
3046        let mut response = response;
3047        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3048        proto::json::ResponsePayload::new(&response).deserialize::<CreateDetectorVersionResult, _>()
3049    }
3050
3051    /// <p>Creates a version of the model using the specified model type. </p>
3052    async fn create_model_version(
3053        &self,
3054        input: CreateModelVersionRequest,
3055    ) -> Result<CreateModelVersionResult, RusotoError<CreateModelVersionError>> {
3056        let mut request = self.new_signed_request("POST", "/");
3057        request.add_header(
3058            "x-amz-target",
3059            "AWSHawksNestServiceFacade.CreateModelVersion",
3060        );
3061        let encoded = serde_json::to_string(&input).unwrap();
3062        request.set_payload(Some(encoded));
3063
3064        let response = self
3065            .sign_and_dispatch(request, CreateModelVersionError::from_response)
3066            .await?;
3067        let mut response = response;
3068        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3069        proto::json::ResponsePayload::new(&response).deserialize::<CreateModelVersionResult, _>()
3070    }
3071
3072    /// <p>Creates a rule for use with the specified detector. </p>
3073    async fn create_rule(
3074        &self,
3075        input: CreateRuleRequest,
3076    ) -> Result<CreateRuleResult, RusotoError<CreateRuleError>> {
3077        let mut request = self.new_signed_request("POST", "/");
3078        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.CreateRule");
3079        let encoded = serde_json::to_string(&input).unwrap();
3080        request.set_payload(Some(encoded));
3081
3082        let response = self
3083            .sign_and_dispatch(request, CreateRuleError::from_response)
3084            .await?;
3085        let mut response = response;
3086        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3087        proto::json::ResponsePayload::new(&response).deserialize::<CreateRuleResult, _>()
3088    }
3089
3090    /// <p>Creates a variable.</p>
3091    async fn create_variable(
3092        &self,
3093        input: CreateVariableRequest,
3094    ) -> Result<CreateVariableResult, RusotoError<CreateVariableError>> {
3095        let mut request = self.new_signed_request("POST", "/");
3096        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.CreateVariable");
3097        let encoded = serde_json::to_string(&input).unwrap();
3098        request.set_payload(Some(encoded));
3099
3100        let response = self
3101            .sign_and_dispatch(request, CreateVariableError::from_response)
3102            .await?;
3103        let mut response = response;
3104        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3105        proto::json::ResponsePayload::new(&response).deserialize::<CreateVariableResult, _>()
3106    }
3107
3108    /// <p>Deletes the detector. Before deleting a detector, you must first delete all detector versions and rule versions associated with the detector.</p>
3109    async fn delete_detector(
3110        &self,
3111        input: DeleteDetectorRequest,
3112    ) -> Result<DeleteDetectorResult, RusotoError<DeleteDetectorError>> {
3113        let mut request = self.new_signed_request("POST", "/");
3114        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.DeleteDetector");
3115        let encoded = serde_json::to_string(&input).unwrap();
3116        request.set_payload(Some(encoded));
3117
3118        let response = self
3119            .sign_and_dispatch(request, DeleteDetectorError::from_response)
3120            .await?;
3121        let mut response = response;
3122        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3123        proto::json::ResponsePayload::new(&response).deserialize::<DeleteDetectorResult, _>()
3124    }
3125
3126    /// <p>Deletes the detector version. You cannot delete detector versions that are in <code>ACTIVE</code> status.</p>
3127    async fn delete_detector_version(
3128        &self,
3129        input: DeleteDetectorVersionRequest,
3130    ) -> Result<DeleteDetectorVersionResult, RusotoError<DeleteDetectorVersionError>> {
3131        let mut request = self.new_signed_request("POST", "/");
3132        request.add_header(
3133            "x-amz-target",
3134            "AWSHawksNestServiceFacade.DeleteDetectorVersion",
3135        );
3136        let encoded = serde_json::to_string(&input).unwrap();
3137        request.set_payload(Some(encoded));
3138
3139        let response = self
3140            .sign_and_dispatch(request, DeleteDetectorVersionError::from_response)
3141            .await?;
3142        let mut response = response;
3143        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3144        proto::json::ResponsePayload::new(&response).deserialize::<DeleteDetectorVersionResult, _>()
3145    }
3146
3147    /// <p>Deletes the specified event.</p>
3148    async fn delete_event(
3149        &self,
3150        input: DeleteEventRequest,
3151    ) -> Result<DeleteEventResult, RusotoError<DeleteEventError>> {
3152        let mut request = self.new_signed_request("POST", "/");
3153        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.DeleteEvent");
3154        let encoded = serde_json::to_string(&input).unwrap();
3155        request.set_payload(Some(encoded));
3156
3157        let response = self
3158            .sign_and_dispatch(request, DeleteEventError::from_response)
3159            .await?;
3160        let mut response = response;
3161        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3162        proto::json::ResponsePayload::new(&response).deserialize::<DeleteEventResult, _>()
3163    }
3164
3165    /// <p>Deletes the rule version. You cannot delete a rule version if it is used by an <code>ACTIVE</code> or <code>INACTIVE</code> detector version.</p>
3166    async fn delete_rule_version(
3167        &self,
3168        input: DeleteRuleVersionRequest,
3169    ) -> Result<DeleteRuleVersionResult, RusotoError<DeleteRuleVersionError>> {
3170        let mut request = self.new_signed_request("POST", "/");
3171        request.add_header(
3172            "x-amz-target",
3173            "AWSHawksNestServiceFacade.DeleteRuleVersion",
3174        );
3175        let encoded = serde_json::to_string(&input).unwrap();
3176        request.set_payload(Some(encoded));
3177
3178        let response = self
3179            .sign_and_dispatch(request, DeleteRuleVersionError::from_response)
3180            .await?;
3181        let mut response = response;
3182        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3183        proto::json::ResponsePayload::new(&response).deserialize::<DeleteRuleVersionResult, _>()
3184    }
3185
3186    /// <p>Gets all versions for a specified detector.</p>
3187    async fn describe_detector(
3188        &self,
3189        input: DescribeDetectorRequest,
3190    ) -> Result<DescribeDetectorResult, RusotoError<DescribeDetectorError>> {
3191        let mut request = self.new_signed_request("POST", "/");
3192        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.DescribeDetector");
3193        let encoded = serde_json::to_string(&input).unwrap();
3194        request.set_payload(Some(encoded));
3195
3196        let response = self
3197            .sign_and_dispatch(request, DescribeDetectorError::from_response)
3198            .await?;
3199        let mut response = response;
3200        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3201        proto::json::ResponsePayload::new(&response).deserialize::<DescribeDetectorResult, _>()
3202    }
3203
3204    /// <p>Gets all of the model versions for the specified model type or for the specified model type and model ID. You can also get details for a single, specified model version. </p>
3205    async fn describe_model_versions(
3206        &self,
3207        input: DescribeModelVersionsRequest,
3208    ) -> Result<DescribeModelVersionsResult, RusotoError<DescribeModelVersionsError>> {
3209        let mut request = self.new_signed_request("POST", "/");
3210        request.add_header(
3211            "x-amz-target",
3212            "AWSHawksNestServiceFacade.DescribeModelVersions",
3213        );
3214        let encoded = serde_json::to_string(&input).unwrap();
3215        request.set_payload(Some(encoded));
3216
3217        let response = self
3218            .sign_and_dispatch(request, DescribeModelVersionsError::from_response)
3219            .await?;
3220        let mut response = response;
3221        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3222        proto::json::ResponsePayload::new(&response).deserialize::<DescribeModelVersionsResult, _>()
3223    }
3224
3225    /// <p>Gets a particular detector version. </p>
3226    async fn get_detector_version(
3227        &self,
3228        input: GetDetectorVersionRequest,
3229    ) -> Result<GetDetectorVersionResult, RusotoError<GetDetectorVersionError>> {
3230        let mut request = self.new_signed_request("POST", "/");
3231        request.add_header(
3232            "x-amz-target",
3233            "AWSHawksNestServiceFacade.GetDetectorVersion",
3234        );
3235        let encoded = serde_json::to_string(&input).unwrap();
3236        request.set_payload(Some(encoded));
3237
3238        let response = self
3239            .sign_and_dispatch(request, GetDetectorVersionError::from_response)
3240            .await?;
3241        let mut response = response;
3242        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3243        proto::json::ResponsePayload::new(&response).deserialize::<GetDetectorVersionResult, _>()
3244    }
3245
3246    /// <p>Gets all of detectors. This is a paginated API. If you provide a null <code>maxSizePerPage</code>, this actions retrieves a maximum of 10 records per page. If you provide a <code>maxSizePerPage</code>, the value must be between 5 and 10. To get the next page results, provide the pagination token from the <code>GetEventTypesResponse</code> as part of your request. A null pagination token fetches the records from the beginning. </p>
3247    async fn get_detectors(
3248        &self,
3249        input: GetDetectorsRequest,
3250    ) -> Result<GetDetectorsResult, RusotoError<GetDetectorsError>> {
3251        let mut request = self.new_signed_request("POST", "/");
3252        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.GetDetectors");
3253        let encoded = serde_json::to_string(&input).unwrap();
3254        request.set_payload(Some(encoded));
3255
3256        let response = self
3257            .sign_and_dispatch(request, GetDetectorsError::from_response)
3258            .await?;
3259        let mut response = response;
3260        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3261        proto::json::ResponsePayload::new(&response).deserialize::<GetDetectorsResult, _>()
3262    }
3263
3264    /// <p>Gets the details for one or more Amazon SageMaker models that have been imported into the service. This is a paginated API. If you provide a null <code>maxSizePerPage</code>, this actions retrieves a maximum of 10 records per page. If you provide a <code>maxSizePerPage</code>, the value must be between 5 and 10. To get the next page results, provide the pagination token from the <code>GetExternalModelsResult</code> as part of your request. A null pagination token fetches the records from the beginning. </p>
3265    async fn get_external_models(
3266        &self,
3267        input: GetExternalModelsRequest,
3268    ) -> Result<GetExternalModelsResult, RusotoError<GetExternalModelsError>> {
3269        let mut request = self.new_signed_request("POST", "/");
3270        request.add_header(
3271            "x-amz-target",
3272            "AWSHawksNestServiceFacade.GetExternalModels",
3273        );
3274        let encoded = serde_json::to_string(&input).unwrap();
3275        request.set_payload(Some(encoded));
3276
3277        let response = self
3278            .sign_and_dispatch(request, GetExternalModelsError::from_response)
3279            .await?;
3280        let mut response = response;
3281        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3282        proto::json::ResponsePayload::new(&response).deserialize::<GetExternalModelsResult, _>()
3283    }
3284
3285    /// <p>Gets a model version. </p>
3286    async fn get_model_version(
3287        &self,
3288        input: GetModelVersionRequest,
3289    ) -> Result<GetModelVersionResult, RusotoError<GetModelVersionError>> {
3290        let mut request = self.new_signed_request("POST", "/");
3291        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.GetModelVersion");
3292        let encoded = serde_json::to_string(&input).unwrap();
3293        request.set_payload(Some(encoded));
3294
3295        let response = self
3296            .sign_and_dispatch(request, GetModelVersionError::from_response)
3297            .await?;
3298        let mut response = response;
3299        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3300        proto::json::ResponsePayload::new(&response).deserialize::<GetModelVersionResult, _>()
3301    }
3302
3303    /// <p>Gets all of the models for the AWS account, or the specified model type, or gets a single model for the specified model type, model ID combination. </p>
3304    async fn get_models(
3305        &self,
3306        input: GetModelsRequest,
3307    ) -> Result<GetModelsResult, RusotoError<GetModelsError>> {
3308        let mut request = self.new_signed_request("POST", "/");
3309        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.GetModels");
3310        let encoded = serde_json::to_string(&input).unwrap();
3311        request.set_payload(Some(encoded));
3312
3313        let response = self
3314            .sign_and_dispatch(request, GetModelsError::from_response)
3315            .await?;
3316        let mut response = response;
3317        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3318        proto::json::ResponsePayload::new(&response).deserialize::<GetModelsResult, _>()
3319    }
3320
3321    /// <p>Gets one or more outcomes. This is a paginated API. If you provide a null <code>maxSizePerPage</code>, this actions retrieves a maximum of 10 records per page. If you provide a <code>maxSizePerPage</code>, the value must be between 50 and 100. To get the next page results, provide the pagination token from the <code>GetOutcomesResult</code> as part of your request. A null pagination token fetches the records from the beginning. </p>
3322    async fn get_outcomes(
3323        &self,
3324        input: GetOutcomesRequest,
3325    ) -> Result<GetOutcomesResult, RusotoError<GetOutcomesError>> {
3326        let mut request = self.new_signed_request("POST", "/");
3327        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.GetOutcomes");
3328        let encoded = serde_json::to_string(&input).unwrap();
3329        request.set_payload(Some(encoded));
3330
3331        let response = self
3332            .sign_and_dispatch(request, GetOutcomesError::from_response)
3333            .await?;
3334        let mut response = response;
3335        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3336        proto::json::ResponsePayload::new(&response).deserialize::<GetOutcomesResult, _>()
3337    }
3338
3339    /// <p>Evaluates an event against a detector version. If a version ID is not provided, the detector’s (<code>ACTIVE</code>) version is used. </p>
3340    async fn get_prediction(
3341        &self,
3342        input: GetPredictionRequest,
3343    ) -> Result<GetPredictionResult, RusotoError<GetPredictionError>> {
3344        let mut request = self.new_signed_request("POST", "/");
3345        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.GetPrediction");
3346        let encoded = serde_json::to_string(&input).unwrap();
3347        request.set_payload(Some(encoded));
3348
3349        let response = self
3350            .sign_and_dispatch(request, GetPredictionError::from_response)
3351            .await?;
3352        let mut response = response;
3353        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3354        proto::json::ResponsePayload::new(&response).deserialize::<GetPredictionResult, _>()
3355    }
3356
3357    /// <p>Gets all rules available for the specified detector.</p>
3358    async fn get_rules(
3359        &self,
3360        input: GetRulesRequest,
3361    ) -> Result<GetRulesResult, RusotoError<GetRulesError>> {
3362        let mut request = self.new_signed_request("POST", "/");
3363        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.GetRules");
3364        let encoded = serde_json::to_string(&input).unwrap();
3365        request.set_payload(Some(encoded));
3366
3367        let response = self
3368            .sign_and_dispatch(request, GetRulesError::from_response)
3369            .await?;
3370        let mut response = response;
3371        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3372        proto::json::ResponsePayload::new(&response).deserialize::<GetRulesResult, _>()
3373    }
3374
3375    /// <p>Gets all of the variables or the specific variable. This is a paginated API. Providing null <code>maxSizePerPage</code> results in retrieving maximum of 100 records per page. If you provide <code>maxSizePerPage</code> the value must be between 50 and 100. To get the next page result, a provide a pagination token from <code>GetVariablesResult</code> as part of your request. Null pagination token fetches the records from the beginning. </p>
3376    async fn get_variables(
3377        &self,
3378        input: GetVariablesRequest,
3379    ) -> Result<GetVariablesResult, RusotoError<GetVariablesError>> {
3380        let mut request = self.new_signed_request("POST", "/");
3381        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.GetVariables");
3382        let encoded = serde_json::to_string(&input).unwrap();
3383        request.set_payload(Some(encoded));
3384
3385        let response = self
3386            .sign_and_dispatch(request, GetVariablesError::from_response)
3387            .await?;
3388        let mut response = response;
3389        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3390        proto::json::ResponsePayload::new(&response).deserialize::<GetVariablesResult, _>()
3391    }
3392
3393    /// <p>Creates or updates a detector. </p>
3394    async fn put_detector(
3395        &self,
3396        input: PutDetectorRequest,
3397    ) -> Result<PutDetectorResult, RusotoError<PutDetectorError>> {
3398        let mut request = self.new_signed_request("POST", "/");
3399        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.PutDetector");
3400        let encoded = serde_json::to_string(&input).unwrap();
3401        request.set_payload(Some(encoded));
3402
3403        let response = self
3404            .sign_and_dispatch(request, PutDetectorError::from_response)
3405            .await?;
3406        let mut response = response;
3407        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3408        proto::json::ResponsePayload::new(&response).deserialize::<PutDetectorResult, _>()
3409    }
3410
3411    /// <p>Creates or updates an Amazon SageMaker model endpoint. You can also use this action to update the configuration of the model endpoint, including the IAM role and/or the mapped variables. </p>
3412    async fn put_external_model(
3413        &self,
3414        input: PutExternalModelRequest,
3415    ) -> Result<PutExternalModelResult, RusotoError<PutExternalModelError>> {
3416        let mut request = self.new_signed_request("POST", "/");
3417        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.PutExternalModel");
3418        let encoded = serde_json::to_string(&input).unwrap();
3419        request.set_payload(Some(encoded));
3420
3421        let response = self
3422            .sign_and_dispatch(request, PutExternalModelError::from_response)
3423            .await?;
3424        let mut response = response;
3425        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3426        proto::json::ResponsePayload::new(&response).deserialize::<PutExternalModelResult, _>()
3427    }
3428
3429    /// <p>Creates or updates a model. </p>
3430    async fn put_model(
3431        &self,
3432        input: PutModelRequest,
3433    ) -> Result<PutModelResult, RusotoError<PutModelError>> {
3434        let mut request = self.new_signed_request("POST", "/");
3435        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.PutModel");
3436        let encoded = serde_json::to_string(&input).unwrap();
3437        request.set_payload(Some(encoded));
3438
3439        let response = self
3440            .sign_and_dispatch(request, PutModelError::from_response)
3441            .await?;
3442        let mut response = response;
3443        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3444        proto::json::ResponsePayload::new(&response).deserialize::<PutModelResult, _>()
3445    }
3446
3447    /// <p>Creates or updates an outcome. </p>
3448    async fn put_outcome(
3449        &self,
3450        input: PutOutcomeRequest,
3451    ) -> Result<PutOutcomeResult, RusotoError<PutOutcomeError>> {
3452        let mut request = self.new_signed_request("POST", "/");
3453        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.PutOutcome");
3454        let encoded = serde_json::to_string(&input).unwrap();
3455        request.set_payload(Some(encoded));
3456
3457        let response = self
3458            .sign_and_dispatch(request, PutOutcomeError::from_response)
3459            .await?;
3460        let mut response = response;
3461        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3462        proto::json::ResponsePayload::new(&response).deserialize::<PutOutcomeResult, _>()
3463    }
3464
3465    /// <p> Updates a detector version. The detector version attributes that you can update include models, external model endpoints, rules, and description. You can only update a <code>DRAFT</code> detector version.</p>
3466    async fn update_detector_version(
3467        &self,
3468        input: UpdateDetectorVersionRequest,
3469    ) -> Result<UpdateDetectorVersionResult, RusotoError<UpdateDetectorVersionError>> {
3470        let mut request = self.new_signed_request("POST", "/");
3471        request.add_header(
3472            "x-amz-target",
3473            "AWSHawksNestServiceFacade.UpdateDetectorVersion",
3474        );
3475        let encoded = serde_json::to_string(&input).unwrap();
3476        request.set_payload(Some(encoded));
3477
3478        let response = self
3479            .sign_and_dispatch(request, UpdateDetectorVersionError::from_response)
3480            .await?;
3481        let mut response = response;
3482        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3483        proto::json::ResponsePayload::new(&response).deserialize::<UpdateDetectorVersionResult, _>()
3484    }
3485
3486    /// <p>Updates the detector version's description. You can update the metadata for any detector version (<code>DRAFT, ACTIVE,</code> or <code>INACTIVE</code>). </p>
3487    async fn update_detector_version_metadata(
3488        &self,
3489        input: UpdateDetectorVersionMetadataRequest,
3490    ) -> Result<UpdateDetectorVersionMetadataResult, RusotoError<UpdateDetectorVersionMetadataError>>
3491    {
3492        let mut request = self.new_signed_request("POST", "/");
3493        request.add_header(
3494            "x-amz-target",
3495            "AWSHawksNestServiceFacade.UpdateDetectorVersionMetadata",
3496        );
3497        let encoded = serde_json::to_string(&input).unwrap();
3498        request.set_payload(Some(encoded));
3499
3500        let response = self
3501            .sign_and_dispatch(request, UpdateDetectorVersionMetadataError::from_response)
3502            .await?;
3503        let mut response = response;
3504        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3505        proto::json::ResponsePayload::new(&response)
3506            .deserialize::<UpdateDetectorVersionMetadataResult, _>()
3507    }
3508
3509    /// <p>Updates the detector version’s status. You can perform the following promotions or demotions using <code>UpdateDetectorVersionStatus</code>: <code>DRAFT</code> to <code>ACTIVE</code>, <code>ACTIVE</code> to <code>INACTIVE</code>, and <code>INACTIVE</code> to <code>ACTIVE</code>.</p>
3510    async fn update_detector_version_status(
3511        &self,
3512        input: UpdateDetectorVersionStatusRequest,
3513    ) -> Result<UpdateDetectorVersionStatusResult, RusotoError<UpdateDetectorVersionStatusError>>
3514    {
3515        let mut request = self.new_signed_request("POST", "/");
3516        request.add_header(
3517            "x-amz-target",
3518            "AWSHawksNestServiceFacade.UpdateDetectorVersionStatus",
3519        );
3520        let encoded = serde_json::to_string(&input).unwrap();
3521        request.set_payload(Some(encoded));
3522
3523        let response = self
3524            .sign_and_dispatch(request, UpdateDetectorVersionStatusError::from_response)
3525            .await?;
3526        let mut response = response;
3527        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3528        proto::json::ResponsePayload::new(&response)
3529            .deserialize::<UpdateDetectorVersionStatusResult, _>()
3530    }
3531
3532    /// <p><p>Updates a model version. You can update the description and status attributes using this action. You can perform the following status updates: </p> <ol> <li> <p>Change the <code>TRAINING<em>COMPLETE</code> status to <code>ACTIVE</code> </p> </li> <li> <p>Change <code>ACTIVE</code> back to <code>TRAINING</em>COMPLETE</code> </p> </li> </ol></p>
3533    async fn update_model_version(
3534        &self,
3535        input: UpdateModelVersionRequest,
3536    ) -> Result<UpdateModelVersionResult, RusotoError<UpdateModelVersionError>> {
3537        let mut request = self.new_signed_request("POST", "/");
3538        request.add_header(
3539            "x-amz-target",
3540            "AWSHawksNestServiceFacade.UpdateModelVersion",
3541        );
3542        let encoded = serde_json::to_string(&input).unwrap();
3543        request.set_payload(Some(encoded));
3544
3545        let response = self
3546            .sign_and_dispatch(request, UpdateModelVersionError::from_response)
3547            .await?;
3548        let mut response = response;
3549        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3550        proto::json::ResponsePayload::new(&response).deserialize::<UpdateModelVersionResult, _>()
3551    }
3552
3553    /// <p>Updates a rule's metadata. </p>
3554    async fn update_rule_metadata(
3555        &self,
3556        input: UpdateRuleMetadataRequest,
3557    ) -> Result<UpdateRuleMetadataResult, RusotoError<UpdateRuleMetadataError>> {
3558        let mut request = self.new_signed_request("POST", "/");
3559        request.add_header(
3560            "x-amz-target",
3561            "AWSHawksNestServiceFacade.UpdateRuleMetadata",
3562        );
3563        let encoded = serde_json::to_string(&input).unwrap();
3564        request.set_payload(Some(encoded));
3565
3566        let response = self
3567            .sign_and_dispatch(request, UpdateRuleMetadataError::from_response)
3568            .await?;
3569        let mut response = response;
3570        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3571        proto::json::ResponsePayload::new(&response).deserialize::<UpdateRuleMetadataResult, _>()
3572    }
3573
3574    /// <p>Updates a rule version resulting in a new rule version. </p>
3575    async fn update_rule_version(
3576        &self,
3577        input: UpdateRuleVersionRequest,
3578    ) -> Result<UpdateRuleVersionResult, RusotoError<UpdateRuleVersionError>> {
3579        let mut request = self.new_signed_request("POST", "/");
3580        request.add_header(
3581            "x-amz-target",
3582            "AWSHawksNestServiceFacade.UpdateRuleVersion",
3583        );
3584        let encoded = serde_json::to_string(&input).unwrap();
3585        request.set_payload(Some(encoded));
3586
3587        let response = self
3588            .sign_and_dispatch(request, UpdateRuleVersionError::from_response)
3589            .await?;
3590        let mut response = response;
3591        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3592        proto::json::ResponsePayload::new(&response).deserialize::<UpdateRuleVersionResult, _>()
3593    }
3594
3595    /// <p>Updates a variable.</p>
3596    async fn update_variable(
3597        &self,
3598        input: UpdateVariableRequest,
3599    ) -> Result<UpdateVariableResult, RusotoError<UpdateVariableError>> {
3600        let mut request = self.new_signed_request("POST", "/");
3601        request.add_header("x-amz-target", "AWSHawksNestServiceFacade.UpdateVariable");
3602        let encoded = serde_json::to_string(&input).unwrap();
3603        request.set_payload(Some(encoded));
3604
3605        let response = self
3606            .sign_and_dispatch(request, UpdateVariableError::from_response)
3607            .await?;
3608        let mut response = response;
3609        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3610        proto::json::ResponsePayload::new(&response).deserialize::<UpdateVariableResult, _>()
3611    }
3612}