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, Serialize)]
pub struct ActivatePipelineInput {
#[serde(rename = "parameterValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_values: Option<Vec<ParameterValue>>,
#[serde(rename = "pipelineId")]
pub pipeline_id: String,
#[serde(rename = "startTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_timestamp: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ActivatePipelineOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AddTagsInput {
#[serde(rename = "pipelineId")]
pub pipeline_id: String,
#[serde(rename = "tags")]
pub tags: Vec<Tag>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AddTagsOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreatePipelineInput {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "uniqueId")]
pub unique_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreatePipelineOutput {
#[serde(rename = "pipelineId")]
pub pipeline_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeactivatePipelineInput {
#[serde(rename = "cancelActive")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cancel_active: Option<bool>,
#[serde(rename = "pipelineId")]
pub pipeline_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeactivatePipelineOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeletePipelineInput {
#[serde(rename = "pipelineId")]
pub pipeline_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeObjectsInput {
#[serde(rename = "evaluateExpressions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub evaluate_expressions: Option<bool>,
#[serde(rename = "marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "objectIds")]
pub object_ids: Vec<String>,
#[serde(rename = "pipelineId")]
pub pipeline_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeObjectsOutput {
#[serde(rename = "hasMoreResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub has_more_results: Option<bool>,
#[serde(rename = "marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "pipelineObjects")]
pub pipeline_objects: Vec<PipelineObject>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribePipelinesInput {
#[serde(rename = "pipelineIds")]
pub pipeline_ids: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribePipelinesOutput {
#[serde(rename = "pipelineDescriptionList")]
pub pipeline_description_list: Vec<PipelineDescription>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct EvaluateExpressionInput {
#[serde(rename = "expression")]
pub expression: String,
#[serde(rename = "objectId")]
pub object_id: String,
#[serde(rename = "pipelineId")]
pub pipeline_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct EvaluateExpressionOutput {
#[serde(rename = "evaluatedExpression")]
pub evaluated_expression: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Field {
#[serde(rename = "key")]
pub key: String,
#[serde(rename = "refValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ref_value: Option<String>,
#[serde(rename = "stringValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub string_value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetPipelineDefinitionInput {
#[serde(rename = "pipelineId")]
pub pipeline_id: String,
#[serde(rename = "version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetPipelineDefinitionOutput {
#[serde(rename = "parameterObjects")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_objects: Option<Vec<ParameterObject>>,
#[serde(rename = "parameterValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_values: Option<Vec<ParameterValue>>,
#[serde(rename = "pipelineObjects")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pipeline_objects: Option<Vec<PipelineObject>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InstanceIdentity {
#[serde(rename = "document")]
#[serde(skip_serializing_if = "Option::is_none")]
pub document: Option<String>,
#[serde(rename = "signature")]
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListPipelinesInput {
#[serde(rename = "marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListPipelinesOutput {
#[serde(rename = "hasMoreResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub has_more_results: Option<bool>,
#[serde(rename = "marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "pipelineIdList")]
pub pipeline_id_list: Vec<PipelineIdName>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct Operator {
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "values")]
#[serde(skip_serializing_if = "Option::is_none")]
pub values: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ParameterAttribute {
#[serde(rename = "key")]
pub key: String,
#[serde(rename = "stringValue")]
pub string_value: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ParameterObject {
#[serde(rename = "attributes")]
pub attributes: Vec<ParameterAttribute>,
#[serde(rename = "id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ParameterValue {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "stringValue")]
pub string_value: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PipelineDescription {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "fields")]
pub fields: Vec<Field>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "pipelineId")]
pub pipeline_id: 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 PipelineIdName {
#[serde(rename = "id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PipelineObject {
#[serde(rename = "fields")]
pub fields: Vec<Field>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PollForTaskInput {
#[serde(rename = "hostname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hostname: Option<String>,
#[serde(rename = "instanceIdentity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_identity: Option<InstanceIdentity>,
#[serde(rename = "workerGroup")]
pub worker_group: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PollForTaskOutput {
#[serde(rename = "taskObject")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_object: Option<TaskObject>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutPipelineDefinitionInput {
#[serde(rename = "parameterObjects")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_objects: Option<Vec<ParameterObject>>,
#[serde(rename = "parameterValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_values: Option<Vec<ParameterValue>>,
#[serde(rename = "pipelineId")]
pub pipeline_id: String,
#[serde(rename = "pipelineObjects")]
pub pipeline_objects: Vec<PipelineObject>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutPipelineDefinitionOutput {
#[serde(rename = "errored")]
pub errored: bool,
#[serde(rename = "validationErrors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub validation_errors: Option<Vec<ValidationError>>,
#[serde(rename = "validationWarnings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub validation_warnings: Option<Vec<ValidationWarning>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct Query {
#[serde(rename = "selectors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub selectors: Option<Vec<Selector>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct QueryObjectsInput {
#[serde(rename = "limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "pipelineId")]
pub pipeline_id: String,
#[serde(rename = "query")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query: Option<Query>,
#[serde(rename = "sphere")]
pub sphere: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct QueryObjectsOutput {
#[serde(rename = "hasMoreResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub has_more_results: Option<bool>,
#[serde(rename = "ids")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ids: Option<Vec<String>>,
#[serde(rename = "marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RemoveTagsInput {
#[serde(rename = "pipelineId")]
pub pipeline_id: String,
#[serde(rename = "tagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RemoveTagsOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ReportTaskProgressInput {
#[serde(rename = "fields")]
#[serde(skip_serializing_if = "Option::is_none")]
pub fields: Option<Vec<Field>>,
#[serde(rename = "taskId")]
pub task_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ReportTaskProgressOutput {
#[serde(rename = "canceled")]
pub canceled: bool,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ReportTaskRunnerHeartbeatInput {
#[serde(rename = "hostname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hostname: Option<String>,
#[serde(rename = "taskrunnerId")]
pub taskrunner_id: String,
#[serde(rename = "workerGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub worker_group: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ReportTaskRunnerHeartbeatOutput {
#[serde(rename = "terminate")]
pub terminate: bool,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct Selector {
#[serde(rename = "fieldName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub field_name: Option<String>,
#[serde(rename = "operator")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operator: Option<Operator>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SetStatusInput {
#[serde(rename = "objectIds")]
pub object_ids: Vec<String>,
#[serde(rename = "pipelineId")]
pub pipeline_id: String,
#[serde(rename = "status")]
pub status: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SetTaskStatusInput {
#[serde(rename = "errorId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_id: Option<String>,
#[serde(rename = "errorMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_message: Option<String>,
#[serde(rename = "errorStackTrace")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_stack_trace: Option<String>,
#[serde(rename = "taskId")]
pub task_id: String,
#[serde(rename = "taskStatus")]
pub task_status: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SetTaskStatusOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Tag {
#[serde(rename = "key")]
pub key: String,
#[serde(rename = "value")]
pub value: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TaskObject {
#[serde(rename = "attemptId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attempt_id: Option<String>,
#[serde(rename = "objects")]
#[serde(skip_serializing_if = "Option::is_none")]
pub objects: Option<::std::collections::HashMap<String, PipelineObject>>,
#[serde(rename = "pipelineId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pipeline_id: Option<String>,
#[serde(rename = "taskId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ValidatePipelineDefinitionInput {
#[serde(rename = "parameterObjects")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_objects: Option<Vec<ParameterObject>>,
#[serde(rename = "parameterValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_values: Option<Vec<ParameterValue>>,
#[serde(rename = "pipelineId")]
pub pipeline_id: String,
#[serde(rename = "pipelineObjects")]
pub pipeline_objects: Vec<PipelineObject>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ValidatePipelineDefinitionOutput {
#[serde(rename = "errored")]
pub errored: bool,
#[serde(rename = "validationErrors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub validation_errors: Option<Vec<ValidationError>>,
#[serde(rename = "validationWarnings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub validation_warnings: Option<Vec<ValidationWarning>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ValidationError {
#[serde(rename = "errors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub errors: Option<Vec<String>>,
#[serde(rename = "id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ValidationWarning {
#[serde(rename = "id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "warnings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub warnings: Option<Vec<String>>,
}
#[derive(Debug, PartialEq)]
pub enum ActivatePipelineError {
InternalServiceError(String),
InvalidRequest(String),
PipelineDeleted(String),
PipelineNotFound(String),
}
impl ActivatePipelineError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ActivatePipelineError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(ActivatePipelineError::InternalServiceError(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(ActivatePipelineError::InvalidRequest(err.msg))
}
"PipelineDeletedException" => {
return RusotoError::Service(ActivatePipelineError::PipelineDeleted(err.msg))
}
"PipelineNotFoundException" => {
return RusotoError::Service(ActivatePipelineError::PipelineNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ActivatePipelineError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ActivatePipelineError {
fn description(&self) -> &str {
match *self {
ActivatePipelineError::InternalServiceError(ref cause) => cause,
ActivatePipelineError::InvalidRequest(ref cause) => cause,
ActivatePipelineError::PipelineDeleted(ref cause) => cause,
ActivatePipelineError::PipelineNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum AddTagsError {
InternalServiceError(String),
InvalidRequest(String),
PipelineDeleted(String),
PipelineNotFound(String),
}
impl AddTagsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AddTagsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(AddTagsError::InternalServiceError(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(AddTagsError::InvalidRequest(err.msg))
}
"PipelineDeletedException" => {
return RusotoError::Service(AddTagsError::PipelineDeleted(err.msg))
}
"PipelineNotFoundException" => {
return RusotoError::Service(AddTagsError::PipelineNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AddTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddTagsError {
fn description(&self) -> &str {
match *self {
AddTagsError::InternalServiceError(ref cause) => cause,
AddTagsError::InvalidRequest(ref cause) => cause,
AddTagsError::PipelineDeleted(ref cause) => cause,
AddTagsError::PipelineNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreatePipelineError {
InternalServiceError(String),
InvalidRequest(String),
}
impl CreatePipelineError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreatePipelineError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(CreatePipelineError::InternalServiceError(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(CreatePipelineError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreatePipelineError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreatePipelineError {
fn description(&self) -> &str {
match *self {
CreatePipelineError::InternalServiceError(ref cause) => cause,
CreatePipelineError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeactivatePipelineError {
InternalServiceError(String),
InvalidRequest(String),
PipelineDeleted(String),
PipelineNotFound(String),
}
impl DeactivatePipelineError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeactivatePipelineError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(DeactivatePipelineError::InternalServiceError(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(DeactivatePipelineError::InvalidRequest(err.msg))
}
"PipelineDeletedException" => {
return RusotoError::Service(DeactivatePipelineError::PipelineDeleted(err.msg))
}
"PipelineNotFoundException" => {
return RusotoError::Service(DeactivatePipelineError::PipelineNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeactivatePipelineError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeactivatePipelineError {
fn description(&self) -> &str {
match *self {
DeactivatePipelineError::InternalServiceError(ref cause) => cause,
DeactivatePipelineError::InvalidRequest(ref cause) => cause,
DeactivatePipelineError::PipelineDeleted(ref cause) => cause,
DeactivatePipelineError::PipelineNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeletePipelineError {
InternalServiceError(String),
InvalidRequest(String),
PipelineNotFound(String),
}
impl DeletePipelineError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeletePipelineError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(DeletePipelineError::InternalServiceError(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(DeletePipelineError::InvalidRequest(err.msg))
}
"PipelineNotFoundException" => {
return RusotoError::Service(DeletePipelineError::PipelineNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeletePipelineError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeletePipelineError {
fn description(&self) -> &str {
match *self {
DeletePipelineError::InternalServiceError(ref cause) => cause,
DeletePipelineError::InvalidRequest(ref cause) => cause,
DeletePipelineError::PipelineNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeObjectsError {
InternalServiceError(String),
InvalidRequest(String),
PipelineDeleted(String),
PipelineNotFound(String),
}
impl DescribeObjectsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeObjectsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(DescribeObjectsError::InternalServiceError(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(DescribeObjectsError::InvalidRequest(err.msg))
}
"PipelineDeletedException" => {
return RusotoError::Service(DescribeObjectsError::PipelineDeleted(err.msg))
}
"PipelineNotFoundException" => {
return RusotoError::Service(DescribeObjectsError::PipelineNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeObjectsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeObjectsError {
fn description(&self) -> &str {
match *self {
DescribeObjectsError::InternalServiceError(ref cause) => cause,
DescribeObjectsError::InvalidRequest(ref cause) => cause,
DescribeObjectsError::PipelineDeleted(ref cause) => cause,
DescribeObjectsError::PipelineNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribePipelinesError {
InternalServiceError(String),
InvalidRequest(String),
PipelineDeleted(String),
PipelineNotFound(String),
}
impl DescribePipelinesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribePipelinesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(DescribePipelinesError::InternalServiceError(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(DescribePipelinesError::InvalidRequest(err.msg))
}
"PipelineDeletedException" => {
return RusotoError::Service(DescribePipelinesError::PipelineDeleted(err.msg))
}
"PipelineNotFoundException" => {
return RusotoError::Service(DescribePipelinesError::PipelineNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribePipelinesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribePipelinesError {
fn description(&self) -> &str {
match *self {
DescribePipelinesError::InternalServiceError(ref cause) => cause,
DescribePipelinesError::InvalidRequest(ref cause) => cause,
DescribePipelinesError::PipelineDeleted(ref cause) => cause,
DescribePipelinesError::PipelineNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum EvaluateExpressionError {
InternalServiceError(String),
InvalidRequest(String),
PipelineDeleted(String),
PipelineNotFound(String),
TaskNotFound(String),
}
impl EvaluateExpressionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<EvaluateExpressionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(EvaluateExpressionError::InternalServiceError(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(EvaluateExpressionError::InvalidRequest(err.msg))
}
"PipelineDeletedException" => {
return RusotoError::Service(EvaluateExpressionError::PipelineDeleted(err.msg))
}
"PipelineNotFoundException" => {
return RusotoError::Service(EvaluateExpressionError::PipelineNotFound(err.msg))
}
"TaskNotFoundException" => {
return RusotoError::Service(EvaluateExpressionError::TaskNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for EvaluateExpressionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for EvaluateExpressionError {
fn description(&self) -> &str {
match *self {
EvaluateExpressionError::InternalServiceError(ref cause) => cause,
EvaluateExpressionError::InvalidRequest(ref cause) => cause,
EvaluateExpressionError::PipelineDeleted(ref cause) => cause,
EvaluateExpressionError::PipelineNotFound(ref cause) => cause,
EvaluateExpressionError::TaskNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetPipelineDefinitionError {
InternalServiceError(String),
InvalidRequest(String),
PipelineDeleted(String),
PipelineNotFound(String),
}
impl GetPipelineDefinitionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetPipelineDefinitionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(GetPipelineDefinitionError::InternalServiceError(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(GetPipelineDefinitionError::InvalidRequest(
err.msg,
))
}
"PipelineDeletedException" => {
return RusotoError::Service(GetPipelineDefinitionError::PipelineDeleted(
err.msg,
))
}
"PipelineNotFoundException" => {
return RusotoError::Service(GetPipelineDefinitionError::PipelineNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetPipelineDefinitionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetPipelineDefinitionError {
fn description(&self) -> &str {
match *self {
GetPipelineDefinitionError::InternalServiceError(ref cause) => cause,
GetPipelineDefinitionError::InvalidRequest(ref cause) => cause,
GetPipelineDefinitionError::PipelineDeleted(ref cause) => cause,
GetPipelineDefinitionError::PipelineNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListPipelinesError {
InternalServiceError(String),
InvalidRequest(String),
}
impl ListPipelinesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListPipelinesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(ListPipelinesError::InternalServiceError(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(ListPipelinesError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListPipelinesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListPipelinesError {
fn description(&self) -> &str {
match *self {
ListPipelinesError::InternalServiceError(ref cause) => cause,
ListPipelinesError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PollForTaskError {
InternalServiceError(String),
InvalidRequest(String),
TaskNotFound(String),
}
impl PollForTaskError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PollForTaskError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(PollForTaskError::InternalServiceError(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(PollForTaskError::InvalidRequest(err.msg))
}
"TaskNotFoundException" => {
return RusotoError::Service(PollForTaskError::TaskNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PollForTaskError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PollForTaskError {
fn description(&self) -> &str {
match *self {
PollForTaskError::InternalServiceError(ref cause) => cause,
PollForTaskError::InvalidRequest(ref cause) => cause,
PollForTaskError::TaskNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutPipelineDefinitionError {
InternalServiceError(String),
InvalidRequest(String),
PipelineDeleted(String),
PipelineNotFound(String),
}
impl PutPipelineDefinitionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutPipelineDefinitionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(PutPipelineDefinitionError::InternalServiceError(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(PutPipelineDefinitionError::InvalidRequest(
err.msg,
))
}
"PipelineDeletedException" => {
return RusotoError::Service(PutPipelineDefinitionError::PipelineDeleted(
err.msg,
))
}
"PipelineNotFoundException" => {
return RusotoError::Service(PutPipelineDefinitionError::PipelineNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PutPipelineDefinitionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutPipelineDefinitionError {
fn description(&self) -> &str {
match *self {
PutPipelineDefinitionError::InternalServiceError(ref cause) => cause,
PutPipelineDefinitionError::InvalidRequest(ref cause) => cause,
PutPipelineDefinitionError::PipelineDeleted(ref cause) => cause,
PutPipelineDefinitionError::PipelineNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum QueryObjectsError {
InternalServiceError(String),
InvalidRequest(String),
PipelineDeleted(String),
PipelineNotFound(String),
}
impl QueryObjectsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<QueryObjectsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(QueryObjectsError::InternalServiceError(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(QueryObjectsError::InvalidRequest(err.msg))
}
"PipelineDeletedException" => {
return RusotoError::Service(QueryObjectsError::PipelineDeleted(err.msg))
}
"PipelineNotFoundException" => {
return RusotoError::Service(QueryObjectsError::PipelineNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for QueryObjectsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for QueryObjectsError {
fn description(&self) -> &str {
match *self {
QueryObjectsError::InternalServiceError(ref cause) => cause,
QueryObjectsError::InvalidRequest(ref cause) => cause,
QueryObjectsError::PipelineDeleted(ref cause) => cause,
QueryObjectsError::PipelineNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RemoveTagsError {
InternalServiceError(String),
InvalidRequest(String),
PipelineDeleted(String),
PipelineNotFound(String),
}
impl RemoveTagsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RemoveTagsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(RemoveTagsError::InternalServiceError(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(RemoveTagsError::InvalidRequest(err.msg))
}
"PipelineDeletedException" => {
return RusotoError::Service(RemoveTagsError::PipelineDeleted(err.msg))
}
"PipelineNotFoundException" => {
return RusotoError::Service(RemoveTagsError::PipelineNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for RemoveTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RemoveTagsError {
fn description(&self) -> &str {
match *self {
RemoveTagsError::InternalServiceError(ref cause) => cause,
RemoveTagsError::InvalidRequest(ref cause) => cause,
RemoveTagsError::PipelineDeleted(ref cause) => cause,
RemoveTagsError::PipelineNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ReportTaskProgressError {
InternalServiceError(String),
InvalidRequest(String),
PipelineDeleted(String),
PipelineNotFound(String),
TaskNotFound(String),
}
impl ReportTaskProgressError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ReportTaskProgressError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(ReportTaskProgressError::InternalServiceError(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(ReportTaskProgressError::InvalidRequest(err.msg))
}
"PipelineDeletedException" => {
return RusotoError::Service(ReportTaskProgressError::PipelineDeleted(err.msg))
}
"PipelineNotFoundException" => {
return RusotoError::Service(ReportTaskProgressError::PipelineNotFound(err.msg))
}
"TaskNotFoundException" => {
return RusotoError::Service(ReportTaskProgressError::TaskNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ReportTaskProgressError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ReportTaskProgressError {
fn description(&self) -> &str {
match *self {
ReportTaskProgressError::InternalServiceError(ref cause) => cause,
ReportTaskProgressError::InvalidRequest(ref cause) => cause,
ReportTaskProgressError::PipelineDeleted(ref cause) => cause,
ReportTaskProgressError::PipelineNotFound(ref cause) => cause,
ReportTaskProgressError::TaskNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ReportTaskRunnerHeartbeatError {
InternalServiceError(String),
InvalidRequest(String),
}
impl ReportTaskRunnerHeartbeatError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ReportTaskRunnerHeartbeatError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(
ReportTaskRunnerHeartbeatError::InternalServiceError(err.msg),
)
}
"InvalidRequestException" => {
return RusotoError::Service(ReportTaskRunnerHeartbeatError::InvalidRequest(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ReportTaskRunnerHeartbeatError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ReportTaskRunnerHeartbeatError {
fn description(&self) -> &str {
match *self {
ReportTaskRunnerHeartbeatError::InternalServiceError(ref cause) => cause,
ReportTaskRunnerHeartbeatError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum SetStatusError {
InternalServiceError(String),
InvalidRequest(String),
PipelineDeleted(String),
PipelineNotFound(String),
}
impl SetStatusError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SetStatusError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(SetStatusError::InternalServiceError(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(SetStatusError::InvalidRequest(err.msg))
}
"PipelineDeletedException" => {
return RusotoError::Service(SetStatusError::PipelineDeleted(err.msg))
}
"PipelineNotFoundException" => {
return RusotoError::Service(SetStatusError::PipelineNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for SetStatusError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SetStatusError {
fn description(&self) -> &str {
match *self {
SetStatusError::InternalServiceError(ref cause) => cause,
SetStatusError::InvalidRequest(ref cause) => cause,
SetStatusError::PipelineDeleted(ref cause) => cause,
SetStatusError::PipelineNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum SetTaskStatusError {
InternalServiceError(String),
InvalidRequest(String),
PipelineDeleted(String),
PipelineNotFound(String),
TaskNotFound(String),
}
impl SetTaskStatusError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SetTaskStatusError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(SetTaskStatusError::InternalServiceError(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(SetTaskStatusError::InvalidRequest(err.msg))
}
"PipelineDeletedException" => {
return RusotoError::Service(SetTaskStatusError::PipelineDeleted(err.msg))
}
"PipelineNotFoundException" => {
return RusotoError::Service(SetTaskStatusError::PipelineNotFound(err.msg))
}
"TaskNotFoundException" => {
return RusotoError::Service(SetTaskStatusError::TaskNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for SetTaskStatusError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SetTaskStatusError {
fn description(&self) -> &str {
match *self {
SetTaskStatusError::InternalServiceError(ref cause) => cause,
SetTaskStatusError::InvalidRequest(ref cause) => cause,
SetTaskStatusError::PipelineDeleted(ref cause) => cause,
SetTaskStatusError::PipelineNotFound(ref cause) => cause,
SetTaskStatusError::TaskNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ValidatePipelineDefinitionError {
InternalServiceError(String),
InvalidRequest(String),
PipelineDeleted(String),
PipelineNotFound(String),
}
impl ValidatePipelineDefinitionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ValidatePipelineDefinitionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceError" => {
return RusotoError::Service(
ValidatePipelineDefinitionError::InternalServiceError(err.msg),
)
}
"InvalidRequestException" => {
return RusotoError::Service(ValidatePipelineDefinitionError::InvalidRequest(
err.msg,
))
}
"PipelineDeletedException" => {
return RusotoError::Service(ValidatePipelineDefinitionError::PipelineDeleted(
err.msg,
))
}
"PipelineNotFoundException" => {
return RusotoError::Service(ValidatePipelineDefinitionError::PipelineNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ValidatePipelineDefinitionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ValidatePipelineDefinitionError {
fn description(&self) -> &str {
match *self {
ValidatePipelineDefinitionError::InternalServiceError(ref cause) => cause,
ValidatePipelineDefinitionError::InvalidRequest(ref cause) => cause,
ValidatePipelineDefinitionError::PipelineDeleted(ref cause) => cause,
ValidatePipelineDefinitionError::PipelineNotFound(ref cause) => cause,
}
}
}
pub trait DataPipeline {
fn activate_pipeline(
&self,
input: ActivatePipelineInput,
) -> RusotoFuture<ActivatePipelineOutput, ActivatePipelineError>;
fn add_tags(&self, input: AddTagsInput) -> RusotoFuture<AddTagsOutput, AddTagsError>;
fn create_pipeline(
&self,
input: CreatePipelineInput,
) -> RusotoFuture<CreatePipelineOutput, CreatePipelineError>;
fn deactivate_pipeline(
&self,
input: DeactivatePipelineInput,
) -> RusotoFuture<DeactivatePipelineOutput, DeactivatePipelineError>;
fn delete_pipeline(&self, input: DeletePipelineInput) -> RusotoFuture<(), DeletePipelineError>;
fn describe_objects(
&self,
input: DescribeObjectsInput,
) -> RusotoFuture<DescribeObjectsOutput, DescribeObjectsError>;
fn describe_pipelines(
&self,
input: DescribePipelinesInput,
) -> RusotoFuture<DescribePipelinesOutput, DescribePipelinesError>;
fn evaluate_expression(
&self,
input: EvaluateExpressionInput,
) -> RusotoFuture<EvaluateExpressionOutput, EvaluateExpressionError>;
fn get_pipeline_definition(
&self,
input: GetPipelineDefinitionInput,
) -> RusotoFuture<GetPipelineDefinitionOutput, GetPipelineDefinitionError>;
fn list_pipelines(
&self,
input: ListPipelinesInput,
) -> RusotoFuture<ListPipelinesOutput, ListPipelinesError>;
fn poll_for_task(
&self,
input: PollForTaskInput,
) -> RusotoFuture<PollForTaskOutput, PollForTaskError>;
fn put_pipeline_definition(
&self,
input: PutPipelineDefinitionInput,
) -> RusotoFuture<PutPipelineDefinitionOutput, PutPipelineDefinitionError>;
fn query_objects(
&self,
input: QueryObjectsInput,
) -> RusotoFuture<QueryObjectsOutput, QueryObjectsError>;
fn remove_tags(
&self,
input: RemoveTagsInput,
) -> RusotoFuture<RemoveTagsOutput, RemoveTagsError>;
fn report_task_progress(
&self,
input: ReportTaskProgressInput,
) -> RusotoFuture<ReportTaskProgressOutput, ReportTaskProgressError>;
fn report_task_runner_heartbeat(
&self,
input: ReportTaskRunnerHeartbeatInput,
) -> RusotoFuture<ReportTaskRunnerHeartbeatOutput, ReportTaskRunnerHeartbeatError>;
fn set_status(&self, input: SetStatusInput) -> RusotoFuture<(), SetStatusError>;
fn set_task_status(
&self,
input: SetTaskStatusInput,
) -> RusotoFuture<SetTaskStatusOutput, SetTaskStatusError>;
fn validate_pipeline_definition(
&self,
input: ValidatePipelineDefinitionInput,
) -> RusotoFuture<ValidatePipelineDefinitionOutput, ValidatePipelineDefinitionError>;
}
#[derive(Clone)]
pub struct DataPipelineClient {
client: Client,
region: region::Region,
}
impl DataPipelineClient {
pub fn new(region: region::Region) -> DataPipelineClient {
DataPipelineClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> DataPipelineClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
DataPipelineClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl DataPipeline for DataPipelineClient {
fn activate_pipeline(
&self,
input: ActivatePipelineInput,
) -> RusotoFuture<ActivatePipelineOutput, ActivatePipelineError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.ActivatePipeline");
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::<ActivatePipelineOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ActivatePipelineError::from_response(response))),
)
}
})
}
fn add_tags(&self, input: AddTagsInput) -> RusotoFuture<AddTagsOutput, AddTagsError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.AddTags");
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::<AddTagsOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AddTagsError::from_response(response))),
)
}
})
}
fn create_pipeline(
&self,
input: CreatePipelineInput,
) -> RusotoFuture<CreatePipelineOutput, CreatePipelineError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.CreatePipeline");
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::<CreatePipelineOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreatePipelineError::from_response(response))),
)
}
})
}
fn deactivate_pipeline(
&self,
input: DeactivatePipelineInput,
) -> RusotoFuture<DeactivatePipelineOutput, DeactivatePipelineError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.DeactivatePipeline");
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::<DeactivatePipelineOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeactivatePipelineError::from_response(response))),
)
}
})
}
fn delete_pipeline(&self, input: DeletePipelineInput) -> RusotoFuture<(), DeletePipelineError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.DeletePipeline");
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(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeletePipelineError::from_response(response))),
)
}
})
}
fn describe_objects(
&self,
input: DescribeObjectsInput,
) -> RusotoFuture<DescribeObjectsOutput, DescribeObjectsError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.DescribeObjects");
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::<DescribeObjectsOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeObjectsError::from_response(response))),
)
}
})
}
fn describe_pipelines(
&self,
input: DescribePipelinesInput,
) -> RusotoFuture<DescribePipelinesOutput, DescribePipelinesError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.DescribePipelines");
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::<DescribePipelinesOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribePipelinesError::from_response(response))),
)
}
})
}
fn evaluate_expression(
&self,
input: EvaluateExpressionInput,
) -> RusotoFuture<EvaluateExpressionOutput, EvaluateExpressionError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.EvaluateExpression");
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::<EvaluateExpressionOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(EvaluateExpressionError::from_response(response))),
)
}
})
}
fn get_pipeline_definition(
&self,
input: GetPipelineDefinitionInput,
) -> RusotoFuture<GetPipelineDefinitionOutput, GetPipelineDefinitionError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.GetPipelineDefinition");
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::<GetPipelineDefinitionOutput, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetPipelineDefinitionError::from_response(response))
}),
)
}
})
}
fn list_pipelines(
&self,
input: ListPipelinesInput,
) -> RusotoFuture<ListPipelinesOutput, ListPipelinesError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.ListPipelines");
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::<ListPipelinesOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListPipelinesError::from_response(response))),
)
}
})
}
fn poll_for_task(
&self,
input: PollForTaskInput,
) -> RusotoFuture<PollForTaskOutput, PollForTaskError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.PollForTask");
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::<PollForTaskOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(PollForTaskError::from_response(response))),
)
}
})
}
fn put_pipeline_definition(
&self,
input: PutPipelineDefinitionInput,
) -> RusotoFuture<PutPipelineDefinitionOutput, PutPipelineDefinitionError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.PutPipelineDefinition");
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::<PutPipelineDefinitionOutput, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(PutPipelineDefinitionError::from_response(response))
}),
)
}
})
}
fn query_objects(
&self,
input: QueryObjectsInput,
) -> RusotoFuture<QueryObjectsOutput, QueryObjectsError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.QueryObjects");
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::<QueryObjectsOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(QueryObjectsError::from_response(response))),
)
}
})
}
fn remove_tags(
&self,
input: RemoveTagsInput,
) -> RusotoFuture<RemoveTagsOutput, RemoveTagsError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.RemoveTags");
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::<RemoveTagsOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(RemoveTagsError::from_response(response))),
)
}
})
}
fn report_task_progress(
&self,
input: ReportTaskProgressInput,
) -> RusotoFuture<ReportTaskProgressOutput, ReportTaskProgressError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.ReportTaskProgress");
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::<ReportTaskProgressOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ReportTaskProgressError::from_response(response))),
)
}
})
}
fn report_task_runner_heartbeat(
&self,
input: ReportTaskRunnerHeartbeatInput,
) -> RusotoFuture<ReportTaskRunnerHeartbeatOutput, ReportTaskRunnerHeartbeatError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.ReportTaskRunnerHeartbeat");
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::<ReportTaskRunnerHeartbeatOutput, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ReportTaskRunnerHeartbeatError::from_response(response))
}))
}
})
}
fn set_status(&self, input: SetStatusInput) -> RusotoFuture<(), SetStatusError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.SetStatus");
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(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(SetStatusError::from_response(response))),
)
}
})
}
fn set_task_status(
&self,
input: SetTaskStatusInput,
) -> RusotoFuture<SetTaskStatusOutput, SetTaskStatusError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.SetTaskStatus");
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::<SetTaskStatusOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(SetTaskStatusError::from_response(response))),
)
}
})
}
fn validate_pipeline_definition(
&self,
input: ValidatePipelineDefinitionInput,
) -> RusotoFuture<ValidatePipelineDefinitionOutput, ValidatePipelineDefinitionError> {
let mut request = SignedRequest::new("POST", "datapipeline", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DataPipeline.ValidatePipelineDefinition");
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::<ValidatePipelineDefinitionOutput, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ValidatePipelineDefinitionError::from_response(response))
}))
}
})
}
}