use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ActivityFailedEventDetails {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ActivityListItem {
#[serde(rename = "activityArn")]
pub activity_arn: String,
#[serde(rename = "creationDate")]
pub creation_date: f64,
#[serde(rename = "name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ActivityScheduleFailedEventDetails {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ActivityScheduledEventDetails {
#[serde(rename = "heartbeatInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub heartbeat_in_seconds: Option<i64>,
#[serde(rename = "input")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input: Option<String>,
#[serde(rename = "resource")]
pub resource: String,
#[serde(rename = "timeoutInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timeout_in_seconds: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ActivityStartedEventDetails {
#[serde(rename = "workerName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub worker_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ActivitySucceededEventDetails {
#[serde(rename = "output")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ActivityTimedOutEventDetails {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateActivityInput {
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateActivityOutput {
#[serde(rename = "activityArn")]
pub activity_arn: String,
#[serde(rename = "creationDate")]
pub creation_date: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateStateMachineInput {
#[serde(rename = "definition")]
pub definition: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "roleArn")]
pub role_arn: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateStateMachineOutput {
#[serde(rename = "creationDate")]
pub creation_date: f64,
#[serde(rename = "stateMachineArn")]
pub state_machine_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteActivityInput {
#[serde(rename = "activityArn")]
pub activity_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteActivityOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteStateMachineInput {
#[serde(rename = "stateMachineArn")]
pub state_machine_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteStateMachineOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeActivityInput {
#[serde(rename = "activityArn")]
pub activity_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeActivityOutput {
#[serde(rename = "activityArn")]
pub activity_arn: String,
#[serde(rename = "creationDate")]
pub creation_date: f64,
#[serde(rename = "name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeExecutionInput {
#[serde(rename = "executionArn")]
pub execution_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeExecutionOutput {
#[serde(rename = "executionArn")]
pub execution_arn: String,
#[serde(rename = "input")]
pub input: String,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "output")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output: Option<String>,
#[serde(rename = "startDate")]
pub start_date: f64,
#[serde(rename = "stateMachineArn")]
pub state_machine_arn: String,
#[serde(rename = "status")]
pub status: String,
#[serde(rename = "stopDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stop_date: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeStateMachineForExecutionInput {
#[serde(rename = "executionArn")]
pub execution_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeStateMachineForExecutionOutput {
#[serde(rename = "definition")]
pub definition: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "roleArn")]
pub role_arn: String,
#[serde(rename = "stateMachineArn")]
pub state_machine_arn: String,
#[serde(rename = "updateDate")]
pub update_date: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeStateMachineInput {
#[serde(rename = "stateMachineArn")]
pub state_machine_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeStateMachineOutput {
#[serde(rename = "creationDate")]
pub creation_date: f64,
#[serde(rename = "definition")]
pub definition: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "roleArn")]
pub role_arn: String,
#[serde(rename = "stateMachineArn")]
pub state_machine_arn: String,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ExecutionAbortedEventDetails {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ExecutionFailedEventDetails {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ExecutionListItem {
#[serde(rename = "executionArn")]
pub execution_arn: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "startDate")]
pub start_date: f64,
#[serde(rename = "stateMachineArn")]
pub state_machine_arn: String,
#[serde(rename = "status")]
pub status: String,
#[serde(rename = "stopDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stop_date: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ExecutionStartedEventDetails {
#[serde(rename = "input")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input: Option<String>,
#[serde(rename = "roleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ExecutionSucceededEventDetails {
#[serde(rename = "output")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ExecutionTimedOutEventDetails {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetActivityTaskInput {
#[serde(rename = "activityArn")]
pub activity_arn: String,
#[serde(rename = "workerName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub worker_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetActivityTaskOutput {
#[serde(rename = "input")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input: Option<String>,
#[serde(rename = "taskToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetExecutionHistoryInput {
#[serde(rename = "executionArn")]
pub execution_arn: String,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "reverseOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reverse_order: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetExecutionHistoryOutput {
#[serde(rename = "events")]
pub events: Vec<HistoryEvent>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct HistoryEvent {
#[serde(rename = "activityFailedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub activity_failed_event_details: Option<ActivityFailedEventDetails>,
#[serde(rename = "activityScheduleFailedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub activity_schedule_failed_event_details: Option<ActivityScheduleFailedEventDetails>,
#[serde(rename = "activityScheduledEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub activity_scheduled_event_details: Option<ActivityScheduledEventDetails>,
#[serde(rename = "activityStartedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub activity_started_event_details: Option<ActivityStartedEventDetails>,
#[serde(rename = "activitySucceededEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub activity_succeeded_event_details: Option<ActivitySucceededEventDetails>,
#[serde(rename = "activityTimedOutEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub activity_timed_out_event_details: Option<ActivityTimedOutEventDetails>,
#[serde(rename = "executionAbortedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub execution_aborted_event_details: Option<ExecutionAbortedEventDetails>,
#[serde(rename = "executionFailedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub execution_failed_event_details: Option<ExecutionFailedEventDetails>,
#[serde(rename = "executionStartedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub execution_started_event_details: Option<ExecutionStartedEventDetails>,
#[serde(rename = "executionSucceededEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub execution_succeeded_event_details: Option<ExecutionSucceededEventDetails>,
#[serde(rename = "executionTimedOutEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub execution_timed_out_event_details: Option<ExecutionTimedOutEventDetails>,
#[serde(rename = "id")]
pub id: i64,
#[serde(rename = "lambdaFunctionFailedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lambda_function_failed_event_details: Option<LambdaFunctionFailedEventDetails>,
#[serde(rename = "lambdaFunctionScheduleFailedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lambda_function_schedule_failed_event_details:
Option<LambdaFunctionScheduleFailedEventDetails>,
#[serde(rename = "lambdaFunctionScheduledEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lambda_function_scheduled_event_details: Option<LambdaFunctionScheduledEventDetails>,
#[serde(rename = "lambdaFunctionStartFailedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lambda_function_start_failed_event_details: Option<LambdaFunctionStartFailedEventDetails>,
#[serde(rename = "lambdaFunctionSucceededEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lambda_function_succeeded_event_details: Option<LambdaFunctionSucceededEventDetails>,
#[serde(rename = "lambdaFunctionTimedOutEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lambda_function_timed_out_event_details: Option<LambdaFunctionTimedOutEventDetails>,
#[serde(rename = "previousEventId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub previous_event_id: Option<i64>,
#[serde(rename = "stateEnteredEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state_entered_event_details: Option<StateEnteredEventDetails>,
#[serde(rename = "stateExitedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state_exited_event_details: Option<StateExitedEventDetails>,
#[serde(rename = "taskFailedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_failed_event_details: Option<TaskFailedEventDetails>,
#[serde(rename = "taskScheduledEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_scheduled_event_details: Option<TaskScheduledEventDetails>,
#[serde(rename = "taskStartFailedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_start_failed_event_details: Option<TaskStartFailedEventDetails>,
#[serde(rename = "taskStartedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_started_event_details: Option<TaskStartedEventDetails>,
#[serde(rename = "taskSubmitFailedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_submit_failed_event_details: Option<TaskSubmitFailedEventDetails>,
#[serde(rename = "taskSubmittedEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_submitted_event_details: Option<TaskSubmittedEventDetails>,
#[serde(rename = "taskSucceededEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_succeeded_event_details: Option<TaskSucceededEventDetails>,
#[serde(rename = "taskTimedOutEventDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_timed_out_event_details: Option<TaskTimedOutEventDetails>,
#[serde(rename = "timestamp")]
pub timestamp: f64,
#[serde(rename = "type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LambdaFunctionFailedEventDetails {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LambdaFunctionScheduleFailedEventDetails {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LambdaFunctionScheduledEventDetails {
#[serde(rename = "input")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input: Option<String>,
#[serde(rename = "resource")]
pub resource: String,
#[serde(rename = "timeoutInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timeout_in_seconds: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LambdaFunctionStartFailedEventDetails {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LambdaFunctionSucceededEventDetails {
#[serde(rename = "output")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LambdaFunctionTimedOutEventDetails {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListActivitiesInput {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListActivitiesOutput {
#[serde(rename = "activities")]
pub activities: Vec<ActivityListItem>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListExecutionsInput {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "stateMachineArn")]
pub state_machine_arn: String,
#[serde(rename = "statusFilter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_filter: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListExecutionsOutput {
#[serde(rename = "executions")]
pub executions: Vec<ExecutionListItem>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListStateMachinesInput {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListStateMachinesOutput {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "stateMachines")]
pub state_machines: Vec<StateMachineListItem>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsForResourceInput {
#[serde(rename = "resourceArn")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagsForResourceOutput {
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SendTaskFailureInput {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "taskToken")]
pub task_token: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SendTaskFailureOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SendTaskHeartbeatInput {
#[serde(rename = "taskToken")]
pub task_token: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SendTaskHeartbeatOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SendTaskSuccessInput {
#[serde(rename = "output")]
pub output: String,
#[serde(rename = "taskToken")]
pub task_token: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SendTaskSuccessOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartExecutionInput {
#[serde(rename = "input")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "stateMachineArn")]
pub state_machine_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StartExecutionOutput {
#[serde(rename = "executionArn")]
pub execution_arn: String,
#[serde(rename = "startDate")]
pub start_date: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StateEnteredEventDetails {
#[serde(rename = "input")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input: Option<String>,
#[serde(rename = "name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StateExitedEventDetails {
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "output")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StateMachineListItem {
#[serde(rename = "creationDate")]
pub creation_date: f64,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "stateMachineArn")]
pub state_machine_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopExecutionInput {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "executionArn")]
pub execution_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StopExecutionOutput {
#[serde(rename = "stopDate")]
pub stop_date: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Tag {
#[serde(rename = "key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TagResourceInput {
#[serde(rename = "resourceArn")]
pub resource_arn: String,
#[serde(rename = "tags")]
pub tags: Vec<Tag>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TagResourceOutput {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TaskFailedEventDetails {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "resource")]
pub resource: String,
#[serde(rename = "resourceType")]
pub resource_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TaskScheduledEventDetails {
#[serde(rename = "parameters")]
pub parameters: String,
#[serde(rename = "region")]
pub region: String,
#[serde(rename = "resource")]
pub resource: String,
#[serde(rename = "resourceType")]
pub resource_type: String,
#[serde(rename = "timeoutInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timeout_in_seconds: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TaskStartFailedEventDetails {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "resource")]
pub resource: String,
#[serde(rename = "resourceType")]
pub resource_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TaskStartedEventDetails {
#[serde(rename = "resource")]
pub resource: String,
#[serde(rename = "resourceType")]
pub resource_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TaskSubmitFailedEventDetails {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "resource")]
pub resource: String,
#[serde(rename = "resourceType")]
pub resource_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TaskSubmittedEventDetails {
#[serde(rename = "output")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output: Option<String>,
#[serde(rename = "resource")]
pub resource: String,
#[serde(rename = "resourceType")]
pub resource_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TaskSucceededEventDetails {
#[serde(rename = "output")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output: Option<String>,
#[serde(rename = "resource")]
pub resource: String,
#[serde(rename = "resourceType")]
pub resource_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TaskTimedOutEventDetails {
#[serde(rename = "cause")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "resource")]
pub resource: String,
#[serde(rename = "resourceType")]
pub resource_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UntagResourceInput {
#[serde(rename = "resourceArn")]
pub resource_arn: String,
#[serde(rename = "tagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UntagResourceOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateStateMachineInput {
#[serde(rename = "definition")]
#[serde(skip_serializing_if = "Option::is_none")]
pub definition: Option<String>,
#[serde(rename = "roleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
#[serde(rename = "stateMachineArn")]
pub state_machine_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateStateMachineOutput {
#[serde(rename = "updateDate")]
pub update_date: f64,
}
#[derive(Debug, PartialEq)]
pub enum CreateActivityError {
ActivityLimitExceeded(String),
InvalidName(String),
TooManyTags(String),
}
impl CreateActivityError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateActivityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ActivityLimitExceeded" => {
return RusotoError::Service(CreateActivityError::ActivityLimitExceeded(
err.msg,
))
}
"InvalidName" => {
return RusotoError::Service(CreateActivityError::InvalidName(err.msg))
}
"TooManyTags" => {
return RusotoError::Service(CreateActivityError::TooManyTags(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateActivityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateActivityError {
fn description(&self) -> &str {
match *self {
CreateActivityError::ActivityLimitExceeded(ref cause) => cause,
CreateActivityError::InvalidName(ref cause) => cause,
CreateActivityError::TooManyTags(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateStateMachineError {
InvalidArn(String),
InvalidDefinition(String),
InvalidName(String),
StateMachineAlreadyExists(String),
StateMachineDeleting(String),
StateMachineLimitExceeded(String),
TooManyTags(String),
}
impl CreateStateMachineError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateStateMachineError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArn" => {
return RusotoError::Service(CreateStateMachineError::InvalidArn(err.msg))
}
"InvalidDefinition" => {
return RusotoError::Service(CreateStateMachineError::InvalidDefinition(
err.msg,
))
}
"InvalidName" => {
return RusotoError::Service(CreateStateMachineError::InvalidName(err.msg))
}
"StateMachineAlreadyExists" => {
return RusotoError::Service(
CreateStateMachineError::StateMachineAlreadyExists(err.msg),
)
}
"StateMachineDeleting" => {
return RusotoError::Service(CreateStateMachineError::StateMachineDeleting(
err.msg,
))
}
"StateMachineLimitExceeded" => {
return RusotoError::Service(
CreateStateMachineError::StateMachineLimitExceeded(err.msg),
)
}
"TooManyTags" => {
return RusotoError::Service(CreateStateMachineError::TooManyTags(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateStateMachineError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateStateMachineError {
fn description(&self) -> &str {
match *self {
CreateStateMachineError::InvalidArn(ref cause) => cause,
CreateStateMachineError::InvalidDefinition(ref cause) => cause,
CreateStateMachineError::InvalidName(ref cause) => cause,
CreateStateMachineError::StateMachineAlreadyExists(ref cause) => cause,
CreateStateMachineError::StateMachineDeleting(ref cause) => cause,
CreateStateMachineError::StateMachineLimitExceeded(ref cause) => cause,
CreateStateMachineError::TooManyTags(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteActivityError {
InvalidArn(String),
}
impl DeleteActivityError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteActivityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArn" => {
return RusotoError::Service(DeleteActivityError::InvalidArn(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteActivityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteActivityError {
fn description(&self) -> &str {
match *self {
DeleteActivityError::InvalidArn(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteStateMachineError {
InvalidArn(String),
}
impl DeleteStateMachineError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteStateMachineError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArn" => {
return RusotoError::Service(DeleteStateMachineError::InvalidArn(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteStateMachineError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteStateMachineError {
fn description(&self) -> &str {
match *self {
DeleteStateMachineError::InvalidArn(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeActivityError {
ActivityDoesNotExist(String),
InvalidArn(String),
}
impl DescribeActivityError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeActivityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ActivityDoesNotExist" => {
return RusotoError::Service(DescribeActivityError::ActivityDoesNotExist(
err.msg,
))
}
"InvalidArn" => {
return RusotoError::Service(DescribeActivityError::InvalidArn(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeActivityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeActivityError {
fn description(&self) -> &str {
match *self {
DescribeActivityError::ActivityDoesNotExist(ref cause) => cause,
DescribeActivityError::InvalidArn(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeExecutionError {
ExecutionDoesNotExist(String),
InvalidArn(String),
}
impl DescribeExecutionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeExecutionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ExecutionDoesNotExist" => {
return RusotoError::Service(DescribeExecutionError::ExecutionDoesNotExist(
err.msg,
))
}
"InvalidArn" => {
return RusotoError::Service(DescribeExecutionError::InvalidArn(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeExecutionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeExecutionError {
fn description(&self) -> &str {
match *self {
DescribeExecutionError::ExecutionDoesNotExist(ref cause) => cause,
DescribeExecutionError::InvalidArn(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeStateMachineError {
InvalidArn(String),
StateMachineDoesNotExist(String),
}
impl DescribeStateMachineError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeStateMachineError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArn" => {
return RusotoError::Service(DescribeStateMachineError::InvalidArn(err.msg))
}
"StateMachineDoesNotExist" => {
return RusotoError::Service(
DescribeStateMachineError::StateMachineDoesNotExist(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeStateMachineError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeStateMachineError {
fn description(&self) -> &str {
match *self {
DescribeStateMachineError::InvalidArn(ref cause) => cause,
DescribeStateMachineError::StateMachineDoesNotExist(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeStateMachineForExecutionError {
ExecutionDoesNotExist(String),
InvalidArn(String),
}
impl DescribeStateMachineForExecutionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeStateMachineForExecutionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ExecutionDoesNotExist" => {
return RusotoError::Service(
DescribeStateMachineForExecutionError::ExecutionDoesNotExist(err.msg),
)
}
"InvalidArn" => {
return RusotoError::Service(DescribeStateMachineForExecutionError::InvalidArn(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeStateMachineForExecutionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeStateMachineForExecutionError {
fn description(&self) -> &str {
match *self {
DescribeStateMachineForExecutionError::ExecutionDoesNotExist(ref cause) => cause,
DescribeStateMachineForExecutionError::InvalidArn(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetActivityTaskError {
ActivityDoesNotExist(String),
ActivityWorkerLimitExceeded(String),
InvalidArn(String),
}
impl GetActivityTaskError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetActivityTaskError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ActivityDoesNotExist" => {
return RusotoError::Service(GetActivityTaskError::ActivityDoesNotExist(
err.msg,
))
}
"ActivityWorkerLimitExceeded" => {
return RusotoError::Service(GetActivityTaskError::ActivityWorkerLimitExceeded(
err.msg,
))
}
"InvalidArn" => {
return RusotoError::Service(GetActivityTaskError::InvalidArn(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetActivityTaskError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetActivityTaskError {
fn description(&self) -> &str {
match *self {
GetActivityTaskError::ActivityDoesNotExist(ref cause) => cause,
GetActivityTaskError::ActivityWorkerLimitExceeded(ref cause) => cause,
GetActivityTaskError::InvalidArn(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetExecutionHistoryError {
ExecutionDoesNotExist(String),
InvalidArn(String),
InvalidToken(String),
}
impl GetExecutionHistoryError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetExecutionHistoryError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ExecutionDoesNotExist" => {
return RusotoError::Service(GetExecutionHistoryError::ExecutionDoesNotExist(
err.msg,
))
}
"InvalidArn" => {
return RusotoError::Service(GetExecutionHistoryError::InvalidArn(err.msg))
}
"InvalidToken" => {
return RusotoError::Service(GetExecutionHistoryError::InvalidToken(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetExecutionHistoryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetExecutionHistoryError {
fn description(&self) -> &str {
match *self {
GetExecutionHistoryError::ExecutionDoesNotExist(ref cause) => cause,
GetExecutionHistoryError::InvalidArn(ref cause) => cause,
GetExecutionHistoryError::InvalidToken(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListActivitiesError {
InvalidToken(String),
}
impl ListActivitiesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListActivitiesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidToken" => {
return RusotoError::Service(ListActivitiesError::InvalidToken(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListActivitiesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListActivitiesError {
fn description(&self) -> &str {
match *self {
ListActivitiesError::InvalidToken(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListExecutionsError {
InvalidArn(String),
InvalidToken(String),
StateMachineDoesNotExist(String),
}
impl ListExecutionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListExecutionsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArn" => {
return RusotoError::Service(ListExecutionsError::InvalidArn(err.msg))
}
"InvalidToken" => {
return RusotoError::Service(ListExecutionsError::InvalidToken(err.msg))
}
"StateMachineDoesNotExist" => {
return RusotoError::Service(ListExecutionsError::StateMachineDoesNotExist(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListExecutionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListExecutionsError {
fn description(&self) -> &str {
match *self {
ListExecutionsError::InvalidArn(ref cause) => cause,
ListExecutionsError::InvalidToken(ref cause) => cause,
ListExecutionsError::StateMachineDoesNotExist(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListStateMachinesError {
InvalidToken(String),
}
impl ListStateMachinesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListStateMachinesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidToken" => {
return RusotoError::Service(ListStateMachinesError::InvalidToken(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListStateMachinesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListStateMachinesError {
fn description(&self) -> &str {
match *self {
ListStateMachinesError::InvalidToken(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {
InvalidArn(String),
ResourceNotFound(String),
}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArn" => {
return RusotoError::Service(ListTagsForResourceError::InvalidArn(err.msg))
}
"ResourceNotFound" => {
return RusotoError::Service(ListTagsForResourceError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTagsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsForResourceError {
fn description(&self) -> &str {
match *self {
ListTagsForResourceError::InvalidArn(ref cause) => cause,
ListTagsForResourceError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum SendTaskFailureError {
InvalidToken(String),
TaskDoesNotExist(String),
TaskTimedOut(String),
}
impl SendTaskFailureError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SendTaskFailureError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidToken" => {
return RusotoError::Service(SendTaskFailureError::InvalidToken(err.msg))
}
"TaskDoesNotExist" => {
return RusotoError::Service(SendTaskFailureError::TaskDoesNotExist(err.msg))
}
"TaskTimedOut" => {
return RusotoError::Service(SendTaskFailureError::TaskTimedOut(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for SendTaskFailureError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SendTaskFailureError {
fn description(&self) -> &str {
match *self {
SendTaskFailureError::InvalidToken(ref cause) => cause,
SendTaskFailureError::TaskDoesNotExist(ref cause) => cause,
SendTaskFailureError::TaskTimedOut(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum SendTaskHeartbeatError {
InvalidToken(String),
TaskDoesNotExist(String),
TaskTimedOut(String),
}
impl SendTaskHeartbeatError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SendTaskHeartbeatError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidToken" => {
return RusotoError::Service(SendTaskHeartbeatError::InvalidToken(err.msg))
}
"TaskDoesNotExist" => {
return RusotoError::Service(SendTaskHeartbeatError::TaskDoesNotExist(err.msg))
}
"TaskTimedOut" => {
return RusotoError::Service(SendTaskHeartbeatError::TaskTimedOut(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for SendTaskHeartbeatError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SendTaskHeartbeatError {
fn description(&self) -> &str {
match *self {
SendTaskHeartbeatError::InvalidToken(ref cause) => cause,
SendTaskHeartbeatError::TaskDoesNotExist(ref cause) => cause,
SendTaskHeartbeatError::TaskTimedOut(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum SendTaskSuccessError {
InvalidOutput(String),
InvalidToken(String),
TaskDoesNotExist(String),
TaskTimedOut(String),
}
impl SendTaskSuccessError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SendTaskSuccessError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidOutput" => {
return RusotoError::Service(SendTaskSuccessError::InvalidOutput(err.msg))
}
"InvalidToken" => {
return RusotoError::Service(SendTaskSuccessError::InvalidToken(err.msg))
}
"TaskDoesNotExist" => {
return RusotoError::Service(SendTaskSuccessError::TaskDoesNotExist(err.msg))
}
"TaskTimedOut" => {
return RusotoError::Service(SendTaskSuccessError::TaskTimedOut(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for SendTaskSuccessError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SendTaskSuccessError {
fn description(&self) -> &str {
match *self {
SendTaskSuccessError::InvalidOutput(ref cause) => cause,
SendTaskSuccessError::InvalidToken(ref cause) => cause,
SendTaskSuccessError::TaskDoesNotExist(ref cause) => cause,
SendTaskSuccessError::TaskTimedOut(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartExecutionError {
ExecutionAlreadyExists(String),
ExecutionLimitExceeded(String),
InvalidArn(String),
InvalidExecutionInput(String),
InvalidName(String),
StateMachineDeleting(String),
StateMachineDoesNotExist(String),
}
impl StartExecutionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartExecutionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ExecutionAlreadyExists" => {
return RusotoError::Service(StartExecutionError::ExecutionAlreadyExists(
err.msg,
))
}
"ExecutionLimitExceeded" => {
return RusotoError::Service(StartExecutionError::ExecutionLimitExceeded(
err.msg,
))
}
"InvalidArn" => {
return RusotoError::Service(StartExecutionError::InvalidArn(err.msg))
}
"InvalidExecutionInput" => {
return RusotoError::Service(StartExecutionError::InvalidExecutionInput(
err.msg,
))
}
"InvalidName" => {
return RusotoError::Service(StartExecutionError::InvalidName(err.msg))
}
"StateMachineDeleting" => {
return RusotoError::Service(StartExecutionError::StateMachineDeleting(err.msg))
}
"StateMachineDoesNotExist" => {
return RusotoError::Service(StartExecutionError::StateMachineDoesNotExist(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartExecutionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartExecutionError {
fn description(&self) -> &str {
match *self {
StartExecutionError::ExecutionAlreadyExists(ref cause) => cause,
StartExecutionError::ExecutionLimitExceeded(ref cause) => cause,
StartExecutionError::InvalidArn(ref cause) => cause,
StartExecutionError::InvalidExecutionInput(ref cause) => cause,
StartExecutionError::InvalidName(ref cause) => cause,
StartExecutionError::StateMachineDeleting(ref cause) => cause,
StartExecutionError::StateMachineDoesNotExist(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopExecutionError {
ExecutionDoesNotExist(String),
InvalidArn(String),
}
impl StopExecutionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StopExecutionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ExecutionDoesNotExist" => {
return RusotoError::Service(StopExecutionError::ExecutionDoesNotExist(err.msg))
}
"InvalidArn" => {
return RusotoError::Service(StopExecutionError::InvalidArn(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StopExecutionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopExecutionError {
fn description(&self) -> &str {
match *self {
StopExecutionError::ExecutionDoesNotExist(ref cause) => cause,
StopExecutionError::InvalidArn(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
InvalidArn(String),
ResourceNotFound(String),
TooManyTags(String),
}
impl TagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArn" => return RusotoError::Service(TagResourceError::InvalidArn(err.msg)),
"ResourceNotFound" => {
return RusotoError::Service(TagResourceError::ResourceNotFound(err.msg))
}
"TooManyTags" => {
return RusotoError::Service(TagResourceError::TooManyTags(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for TagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagResourceError {
fn description(&self) -> &str {
match *self {
TagResourceError::InvalidArn(ref cause) => cause,
TagResourceError::ResourceNotFound(ref cause) => cause,
TagResourceError::TooManyTags(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
InvalidArn(String),
ResourceNotFound(String),
}
impl UntagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArn" => {
return RusotoError::Service(UntagResourceError::InvalidArn(err.msg))
}
"ResourceNotFound" => {
return RusotoError::Service(UntagResourceError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagResourceError {
fn description(&self) -> &str {
match *self {
UntagResourceError::InvalidArn(ref cause) => cause,
UntagResourceError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateStateMachineError {
InvalidArn(String),
InvalidDefinition(String),
MissingRequiredParameter(String),
StateMachineDeleting(String),
StateMachineDoesNotExist(String),
}
impl UpdateStateMachineError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateStateMachineError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArn" => {
return RusotoError::Service(UpdateStateMachineError::InvalidArn(err.msg))
}
"InvalidDefinition" => {
return RusotoError::Service(UpdateStateMachineError::InvalidDefinition(
err.msg,
))
}
"MissingRequiredParameter" => {
return RusotoError::Service(UpdateStateMachineError::MissingRequiredParameter(
err.msg,
))
}
"StateMachineDeleting" => {
return RusotoError::Service(UpdateStateMachineError::StateMachineDeleting(
err.msg,
))
}
"StateMachineDoesNotExist" => {
return RusotoError::Service(UpdateStateMachineError::StateMachineDoesNotExist(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateStateMachineError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateStateMachineError {
fn description(&self) -> &str {
match *self {
UpdateStateMachineError::InvalidArn(ref cause) => cause,
UpdateStateMachineError::InvalidDefinition(ref cause) => cause,
UpdateStateMachineError::MissingRequiredParameter(ref cause) => cause,
UpdateStateMachineError::StateMachineDeleting(ref cause) => cause,
UpdateStateMachineError::StateMachineDoesNotExist(ref cause) => cause,
}
}
}
pub trait StepFunctions {
fn create_activity(
&self,
input: CreateActivityInput,
) -> RusotoFuture<CreateActivityOutput, CreateActivityError>;
fn create_state_machine(
&self,
input: CreateStateMachineInput,
) -> RusotoFuture<CreateStateMachineOutput, CreateStateMachineError>;
fn delete_activity(
&self,
input: DeleteActivityInput,
) -> RusotoFuture<DeleteActivityOutput, DeleteActivityError>;
fn delete_state_machine(
&self,
input: DeleteStateMachineInput,
) -> RusotoFuture<DeleteStateMachineOutput, DeleteStateMachineError>;
fn describe_activity(
&self,
input: DescribeActivityInput,
) -> RusotoFuture<DescribeActivityOutput, DescribeActivityError>;
fn describe_execution(
&self,
input: DescribeExecutionInput,
) -> RusotoFuture<DescribeExecutionOutput, DescribeExecutionError>;
fn describe_state_machine(
&self,
input: DescribeStateMachineInput,
) -> RusotoFuture<DescribeStateMachineOutput, DescribeStateMachineError>;
fn describe_state_machine_for_execution(
&self,
input: DescribeStateMachineForExecutionInput,
) -> RusotoFuture<DescribeStateMachineForExecutionOutput, DescribeStateMachineForExecutionError>;
fn get_activity_task(
&self,
input: GetActivityTaskInput,
) -> RusotoFuture<GetActivityTaskOutput, GetActivityTaskError>;
fn get_execution_history(
&self,
input: GetExecutionHistoryInput,
) -> RusotoFuture<GetExecutionHistoryOutput, GetExecutionHistoryError>;
fn list_activities(
&self,
input: ListActivitiesInput,
) -> RusotoFuture<ListActivitiesOutput, ListActivitiesError>;
fn list_executions(
&self,
input: ListExecutionsInput,
) -> RusotoFuture<ListExecutionsOutput, ListExecutionsError>;
fn list_state_machines(
&self,
input: ListStateMachinesInput,
) -> RusotoFuture<ListStateMachinesOutput, ListStateMachinesError>;
fn list_tags_for_resource(
&self,
input: ListTagsForResourceInput,
) -> RusotoFuture<ListTagsForResourceOutput, ListTagsForResourceError>;
fn send_task_failure(
&self,
input: SendTaskFailureInput,
) -> RusotoFuture<SendTaskFailureOutput, SendTaskFailureError>;
fn send_task_heartbeat(
&self,
input: SendTaskHeartbeatInput,
) -> RusotoFuture<SendTaskHeartbeatOutput, SendTaskHeartbeatError>;
fn send_task_success(
&self,
input: SendTaskSuccessInput,
) -> RusotoFuture<SendTaskSuccessOutput, SendTaskSuccessError>;
fn start_execution(
&self,
input: StartExecutionInput,
) -> RusotoFuture<StartExecutionOutput, StartExecutionError>;
fn stop_execution(
&self,
input: StopExecutionInput,
) -> RusotoFuture<StopExecutionOutput, StopExecutionError>;
fn tag_resource(
&self,
input: TagResourceInput,
) -> RusotoFuture<TagResourceOutput, TagResourceError>;
fn untag_resource(
&self,
input: UntagResourceInput,
) -> RusotoFuture<UntagResourceOutput, UntagResourceError>;
fn update_state_machine(
&self,
input: UpdateStateMachineInput,
) -> RusotoFuture<UpdateStateMachineOutput, UpdateStateMachineError>;
}
#[derive(Clone)]
pub struct StepFunctionsClient {
client: Client,
region: region::Region,
}
impl StepFunctionsClient {
pub fn new(region: region::Region) -> StepFunctionsClient {
StepFunctionsClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> StepFunctionsClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
StepFunctionsClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl StepFunctions for StepFunctionsClient {
fn create_activity(
&self,
input: CreateActivityInput,
) -> RusotoFuture<CreateActivityOutput, CreateActivityError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.CreateActivity");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateActivityOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateActivityError::from_response(response))),
)
}
})
}
fn create_state_machine(
&self,
input: CreateStateMachineInput,
) -> RusotoFuture<CreateStateMachineOutput, CreateStateMachineError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.CreateStateMachine");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateStateMachineOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateStateMachineError::from_response(response))),
)
}
})
}
fn delete_activity(
&self,
input: DeleteActivityInput,
) -> RusotoFuture<DeleteActivityOutput, DeleteActivityError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.DeleteActivity");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteActivityOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteActivityError::from_response(response))),
)
}
})
}
fn delete_state_machine(
&self,
input: DeleteStateMachineInput,
) -> RusotoFuture<DeleteStateMachineOutput, DeleteStateMachineError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.DeleteStateMachine");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteStateMachineOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteStateMachineError::from_response(response))),
)
}
})
}
fn describe_activity(
&self,
input: DescribeActivityInput,
) -> RusotoFuture<DescribeActivityOutput, DescribeActivityError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.DescribeActivity");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeActivityOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeActivityError::from_response(response))),
)
}
})
}
fn describe_execution(
&self,
input: DescribeExecutionInput,
) -> RusotoFuture<DescribeExecutionOutput, DescribeExecutionError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.DescribeExecution");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeExecutionOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeExecutionError::from_response(response))),
)
}
})
}
fn describe_state_machine(
&self,
input: DescribeStateMachineInput,
) -> RusotoFuture<DescribeStateMachineOutput, DescribeStateMachineError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.DescribeStateMachine");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeStateMachineOutput, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeStateMachineError::from_response(response))
}),
)
}
})
}
fn describe_state_machine_for_execution(
&self,
input: DescribeStateMachineForExecutionInput,
) -> RusotoFuture<DescribeStateMachineForExecutionOutput, DescribeStateMachineForExecutionError>
{
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header(
"x-amz-target",
"AWSStepFunctions.DescribeStateMachineForExecution",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeStateMachineForExecutionOutput, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeStateMachineForExecutionError::from_response(
response,
))
}))
}
})
}
fn get_activity_task(
&self,
input: GetActivityTaskInput,
) -> RusotoFuture<GetActivityTaskOutput, GetActivityTaskError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.GetActivityTask");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetActivityTaskOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetActivityTaskError::from_response(response))),
)
}
})
}
fn get_execution_history(
&self,
input: GetExecutionHistoryInput,
) -> RusotoFuture<GetExecutionHistoryOutput, GetExecutionHistoryError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.GetExecutionHistory");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetExecutionHistoryOutput, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetExecutionHistoryError::from_response(response))
}),
)
}
})
}
fn list_activities(
&self,
input: ListActivitiesInput,
) -> RusotoFuture<ListActivitiesOutput, ListActivitiesError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.ListActivities");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListActivitiesOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListActivitiesError::from_response(response))),
)
}
})
}
fn list_executions(
&self,
input: ListExecutionsInput,
) -> RusotoFuture<ListExecutionsOutput, ListExecutionsError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.ListExecutions");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListExecutionsOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListExecutionsError::from_response(response))),
)
}
})
}
fn list_state_machines(
&self,
input: ListStateMachinesInput,
) -> RusotoFuture<ListStateMachinesOutput, ListStateMachinesError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.ListStateMachines");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListStateMachinesOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListStateMachinesError::from_response(response))),
)
}
})
}
fn list_tags_for_resource(
&self,
input: ListTagsForResourceInput,
) -> RusotoFuture<ListTagsForResourceOutput, ListTagsForResourceError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.ListTagsForResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsForResourceOutput, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListTagsForResourceError::from_response(response))
}),
)
}
})
}
fn send_task_failure(
&self,
input: SendTaskFailureInput,
) -> RusotoFuture<SendTaskFailureOutput, SendTaskFailureError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.SendTaskFailure");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<SendTaskFailureOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(SendTaskFailureError::from_response(response))),
)
}
})
}
fn send_task_heartbeat(
&self,
input: SendTaskHeartbeatInput,
) -> RusotoFuture<SendTaskHeartbeatOutput, SendTaskHeartbeatError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.SendTaskHeartbeat");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<SendTaskHeartbeatOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(SendTaskHeartbeatError::from_response(response))),
)
}
})
}
fn send_task_success(
&self,
input: SendTaskSuccessInput,
) -> RusotoFuture<SendTaskSuccessOutput, SendTaskSuccessError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.SendTaskSuccess");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<SendTaskSuccessOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(SendTaskSuccessError::from_response(response))),
)
}
})
}
fn start_execution(
&self,
input: StartExecutionInput,
) -> RusotoFuture<StartExecutionOutput, StartExecutionError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.StartExecution");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StartExecutionOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StartExecutionError::from_response(response))),
)
}
})
}
fn stop_execution(
&self,
input: StopExecutionInput,
) -> RusotoFuture<StopExecutionOutput, StopExecutionError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.StopExecution");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StopExecutionOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StopExecutionError::from_response(response))),
)
}
})
}
fn tag_resource(
&self,
input: TagResourceInput,
) -> RusotoFuture<TagResourceOutput, TagResourceError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.TagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<TagResourceOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TagResourceError::from_response(response))),
)
}
})
}
fn untag_resource(
&self,
input: UntagResourceInput,
) -> RusotoFuture<UntagResourceOutput, UntagResourceError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.UntagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UntagResourceOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UntagResourceError::from_response(response))),
)
}
})
}
fn update_state_machine(
&self,
input: UpdateStateMachineInput,
) -> RusotoFuture<UpdateStateMachineOutput, UpdateStateMachineError> {
let mut request = SignedRequest::new("POST", "states", &self.region, "/");
request.set_content_type("application/x-amz-json-1.0".to_owned());
request.add_header("x-amz-target", "AWSStepFunctions.UpdateStateMachine");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateStateMachineOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateStateMachineError::from_response(response))),
)
}
})
}
}