use std::error::Error;
use std::fmt;
use async_trait::async_trait;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError};
use rusoto_core::param::{Params, ServiceParams};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
use serde_json;
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct AssetDestinationEntry {
#[serde(rename = "AssetId")]
pub asset_id: String,
#[serde(rename = "Bucket")]
pub bucket: String,
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AssetDetails {
#[serde(rename = "S3SnapshotAsset")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_snapshot_asset: Option<S3SnapshotAsset>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AssetEntry {
#[serde(rename = "Arn")]
pub arn: String,
#[serde(rename = "AssetDetails")]
pub asset_details: AssetDetails,
#[serde(rename = "AssetType")]
pub asset_type: String,
#[serde(rename = "CreatedAt")]
pub created_at: f64,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "RevisionId")]
pub revision_id: String,
#[serde(rename = "SourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_id: Option<String>,
#[serde(rename = "UpdatedAt")]
pub updated_at: f64,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct AssetSourceEntry {
#[serde(rename = "Bucket")]
pub bucket: String,
#[serde(rename = "Key")]
pub key: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CancelJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateDataSetRequest {
#[serde(rename = "AssetType")]
pub asset_type: String,
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateDataSetResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "AssetType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub asset_type: Option<String>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[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>,
#[serde(rename = "Origin")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origin: Option<String>,
#[serde(rename = "OriginDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origin_details: Option<OriginDetails>,
#[serde(rename = "SourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_id: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<f64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateJobRequest {
#[serde(rename = "Details")]
pub details: RequestDetails,
#[serde(rename = "Type")]
pub type_: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateJobResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "Details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub details: Option<ResponseDetails>,
#[serde(rename = "Errors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub errors: Option<Vec<JobError>>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<f64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateRevisionRequest {
#[serde(rename = "Comment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<String>,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateRevisionResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Comment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<String>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "DataSetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_set_id: Option<String>,
#[serde(rename = "Finalized")]
#[serde(skip_serializing_if = "Option::is_none")]
pub finalized: Option<bool>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "SourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_id: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DataSetEntry {
#[serde(rename = "Arn")]
pub arn: String,
#[serde(rename = "AssetType")]
pub asset_type: String,
#[serde(rename = "CreatedAt")]
pub created_at: f64,
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Origin")]
pub origin: String,
#[serde(rename = "OriginDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origin_details: Option<OriginDetails>,
#[serde(rename = "SourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_id: Option<String>,
#[serde(rename = "UpdatedAt")]
pub updated_at: f64,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteAssetRequest {
#[serde(rename = "AssetId")]
pub asset_id: String,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "RevisionId")]
pub revision_id: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteDataSetRequest {
#[serde(rename = "DataSetId")]
pub data_set_id: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteRevisionRequest {
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "RevisionId")]
pub revision_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Details {
#[serde(rename = "ImportAssetFromSignedUrlJobErrorDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub import_asset_from_signed_url_job_error_details:
Option<ImportAssetFromSignedUrlJobErrorDetails>,
#[serde(rename = "ImportAssetsFromS3JobErrorDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub import_assets_from_s3_job_error_details: Option<Vec<AssetSourceEntry>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ExportAssetToSignedUrlRequestDetails {
#[serde(rename = "AssetId")]
pub asset_id: String,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "RevisionId")]
pub revision_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ExportAssetToSignedUrlResponseDetails {
#[serde(rename = "AssetId")]
pub asset_id: String,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "RevisionId")]
pub revision_id: String,
#[serde(rename = "SignedUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub signed_url: Option<String>,
#[serde(rename = "SignedUrlExpiresAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub signed_url_expires_at: Option<f64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ExportAssetsToS3RequestDetails {
#[serde(rename = "AssetDestinations")]
pub asset_destinations: Vec<AssetDestinationEntry>,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "Encryption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption: Option<ExportServerSideEncryption>,
#[serde(rename = "RevisionId")]
pub revision_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ExportAssetsToS3ResponseDetails {
#[serde(rename = "AssetDestinations")]
pub asset_destinations: Vec<AssetDestinationEntry>,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "Encryption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption: Option<ExportServerSideEncryption>,
#[serde(rename = "RevisionId")]
pub revision_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct ExportServerSideEncryption {
#[serde(rename = "KmsKeyArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_arn: Option<String>,
#[serde(rename = "Type")]
pub type_: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetAssetRequest {
#[serde(rename = "AssetId")]
pub asset_id: String,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "RevisionId")]
pub revision_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetAssetResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "AssetDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub asset_details: Option<AssetDetails>,
#[serde(rename = "AssetType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub asset_type: Option<String>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "DataSetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_set_id: Option<String>,
#[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>,
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
#[serde(rename = "SourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_id: Option<String>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<f64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetDataSetRequest {
#[serde(rename = "DataSetId")]
pub data_set_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetDataSetResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "AssetType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub asset_type: Option<String>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[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>,
#[serde(rename = "Origin")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origin: Option<String>,
#[serde(rename = "OriginDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origin_details: Option<OriginDetails>,
#[serde(rename = "SourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_id: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<f64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetJobResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "Details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub details: Option<ResponseDetails>,
#[serde(rename = "Errors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub errors: Option<Vec<JobError>>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<f64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetRevisionRequest {
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "RevisionId")]
pub revision_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetRevisionResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Comment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<String>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "DataSetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_set_id: Option<String>,
#[serde(rename = "Finalized")]
#[serde(skip_serializing_if = "Option::is_none")]
pub finalized: Option<bool>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "SourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_id: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ImportAssetFromSignedUrlJobErrorDetails {
#[serde(rename = "AssetName")]
pub asset_name: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ImportAssetFromSignedUrlRequestDetails {
#[serde(rename = "AssetName")]
pub asset_name: String,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "Md5Hash")]
pub md_5_hash: String,
#[serde(rename = "RevisionId")]
pub revision_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ImportAssetFromSignedUrlResponseDetails {
#[serde(rename = "AssetName")]
pub asset_name: String,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "Md5Hash")]
#[serde(skip_serializing_if = "Option::is_none")]
pub md_5_hash: Option<String>,
#[serde(rename = "RevisionId")]
pub revision_id: String,
#[serde(rename = "SignedUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub signed_url: Option<String>,
#[serde(rename = "SignedUrlExpiresAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub signed_url_expires_at: Option<f64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ImportAssetsFromS3RequestDetails {
#[serde(rename = "AssetSources")]
pub asset_sources: Vec<AssetSourceEntry>,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "RevisionId")]
pub revision_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ImportAssetsFromS3ResponseDetails {
#[serde(rename = "AssetSources")]
pub asset_sources: Vec<AssetSourceEntry>,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "RevisionId")]
pub revision_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct JobEntry {
#[serde(rename = "Arn")]
pub arn: String,
#[serde(rename = "CreatedAt")]
pub created_at: f64,
#[serde(rename = "Details")]
pub details: ResponseDetails,
#[serde(rename = "Errors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub errors: Option<Vec<JobError>>,
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "State")]
pub state: String,
#[serde(rename = "Type")]
pub type_: String,
#[serde(rename = "UpdatedAt")]
pub updated_at: f64,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct JobError {
#[serde(rename = "Code")]
pub code: String,
#[serde(rename = "Details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub details: Option<Details>,
#[serde(rename = "LimitName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit_name: Option<String>,
#[serde(rename = "LimitValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit_value: Option<f64>,
#[serde(rename = "Message")]
pub message: String,
#[serde(rename = "ResourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
#[serde(rename = "ResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListDataSetRevisionsRequest {
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListDataSetRevisionsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Revisions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revisions: Option<Vec<RevisionEntry>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListDataSetsRequest {
#[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 = "Origin")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origin: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListDataSetsResponse {
#[serde(rename = "DataSets")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_sets: Option<Vec<DataSetEntry>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListJobsRequest {
#[serde(rename = "DataSetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_set_id: Option<String>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListJobsResponse {
#[serde(rename = "Jobs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub jobs: Option<Vec<JobEntry>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListRevisionAssetsRequest {
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "RevisionId")]
pub revision_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListRevisionAssetsResponse {
#[serde(rename = "Assets")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assets: Option<Vec<AssetEntry>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListTagsForResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListTagsForResourceResponse {
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct OriginDetails {
#[serde(rename = "ProductId")]
pub product_id: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct RequestDetails {
#[serde(rename = "ExportAssetToSignedUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub export_asset_to_signed_url: Option<ExportAssetToSignedUrlRequestDetails>,
#[serde(rename = "ExportAssetsToS3")]
#[serde(skip_serializing_if = "Option::is_none")]
pub export_assets_to_s3: Option<ExportAssetsToS3RequestDetails>,
#[serde(rename = "ImportAssetFromSignedUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub import_asset_from_signed_url: Option<ImportAssetFromSignedUrlRequestDetails>,
#[serde(rename = "ImportAssetsFromS3")]
#[serde(skip_serializing_if = "Option::is_none")]
pub import_assets_from_s3: Option<ImportAssetsFromS3RequestDetails>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ResponseDetails {
#[serde(rename = "ExportAssetToSignedUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub export_asset_to_signed_url: Option<ExportAssetToSignedUrlResponseDetails>,
#[serde(rename = "ExportAssetsToS3")]
#[serde(skip_serializing_if = "Option::is_none")]
pub export_assets_to_s3: Option<ExportAssetsToS3ResponseDetails>,
#[serde(rename = "ImportAssetFromSignedUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub import_asset_from_signed_url: Option<ImportAssetFromSignedUrlResponseDetails>,
#[serde(rename = "ImportAssetsFromS3")]
#[serde(skip_serializing_if = "Option::is_none")]
pub import_assets_from_s3: Option<ImportAssetsFromS3ResponseDetails>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RevisionEntry {
#[serde(rename = "Arn")]
pub arn: String,
#[serde(rename = "Comment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<String>,
#[serde(rename = "CreatedAt")]
pub created_at: f64,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "Finalized")]
#[serde(skip_serializing_if = "Option::is_none")]
pub finalized: Option<bool>,
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "SourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_id: Option<String>,
#[serde(rename = "UpdatedAt")]
pub updated_at: f64,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct S3SnapshotAsset {
#[serde(rename = "Size")]
pub size: f64,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct StartJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct StartJobResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct TagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "Tags")]
pub tags: ::std::collections::HashMap<String, String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UntagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateAssetRequest {
#[serde(rename = "AssetId")]
pub asset_id: String,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "RevisionId")]
pub revision_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateAssetResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "AssetDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub asset_details: Option<AssetDetails>,
#[serde(rename = "AssetType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub asset_type: Option<String>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "DataSetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_set_id: Option<String>,
#[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>,
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
#[serde(rename = "SourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_id: Option<String>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<f64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateDataSetRequest {
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateDataSetResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "AssetType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub asset_type: Option<String>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[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>,
#[serde(rename = "Origin")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origin: Option<String>,
#[serde(rename = "OriginDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origin_details: Option<OriginDetails>,
#[serde(rename = "SourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_id: Option<String>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<f64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateRevisionRequest {
#[serde(rename = "Comment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<String>,
#[serde(rename = "DataSetId")]
pub data_set_id: String,
#[serde(rename = "Finalized")]
#[serde(skip_serializing_if = "Option::is_none")]
pub finalized: Option<bool>,
#[serde(rename = "RevisionId")]
pub revision_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateRevisionResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Comment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<String>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "DataSetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_set_id: Option<String>,
#[serde(rename = "Finalized")]
#[serde(skip_serializing_if = "Option::is_none")]
pub finalized: Option<bool>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "SourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_id: Option<String>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<f64>,
}
#[derive(Debug, PartialEq)]
pub enum CancelJobError {
Conflict(String),
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl CancelJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CancelJobError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConflictException" => {
return RusotoError::Service(CancelJobError::Conflict(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(CancelJobError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CancelJobError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(CancelJobError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CancelJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CancelJobError::Conflict(ref cause) => write!(f, "{}", cause),
CancelJobError::InternalServer(ref cause) => write!(f, "{}", cause),
CancelJobError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
CancelJobError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CancelJobError {}
#[derive(Debug, PartialEq)]
pub enum CreateDataSetError {
AccessDenied(String),
InternalServer(String),
ServiceLimitExceeded(String),
Throttling(String),
}
impl CreateDataSetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateDataSetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(CreateDataSetError::AccessDenied(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(CreateDataSetError::InternalServer(err.msg))
}
"ServiceLimitExceededException" => {
return RusotoError::Service(CreateDataSetError::ServiceLimitExceeded(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(CreateDataSetError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateDataSetError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateDataSetError::AccessDenied(ref cause) => write!(f, "{}", cause),
CreateDataSetError::InternalServer(ref cause) => write!(f, "{}", cause),
CreateDataSetError::ServiceLimitExceeded(ref cause) => write!(f, "{}", cause),
CreateDataSetError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateDataSetError {}
#[derive(Debug, PartialEq)]
pub enum CreateJobError {
AccessDenied(String),
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl CreateJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateJobError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(CreateJobError::AccessDenied(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(CreateJobError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CreateJobError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(CreateJobError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateJobError::AccessDenied(ref cause) => write!(f, "{}", cause),
CreateJobError::InternalServer(ref cause) => write!(f, "{}", cause),
CreateJobError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
CreateJobError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateJobError {}
#[derive(Debug, PartialEq)]
pub enum CreateRevisionError {
AccessDenied(String),
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl CreateRevisionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateRevisionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(CreateRevisionError::AccessDenied(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(CreateRevisionError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CreateRevisionError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(CreateRevisionError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateRevisionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateRevisionError::AccessDenied(ref cause) => write!(f, "{}", cause),
CreateRevisionError::InternalServer(ref cause) => write!(f, "{}", cause),
CreateRevisionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
CreateRevisionError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateRevisionError {}
#[derive(Debug, PartialEq)]
pub enum DeleteAssetError {
AccessDenied(String),
Conflict(String),
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl DeleteAssetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteAssetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DeleteAssetError::AccessDenied(err.msg))
}
"ConflictException" => {
return RusotoError::Service(DeleteAssetError::Conflict(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(DeleteAssetError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteAssetError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(DeleteAssetError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteAssetError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteAssetError::AccessDenied(ref cause) => write!(f, "{}", cause),
DeleteAssetError::Conflict(ref cause) => write!(f, "{}", cause),
DeleteAssetError::InternalServer(ref cause) => write!(f, "{}", cause),
DeleteAssetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DeleteAssetError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteAssetError {}
#[derive(Debug, PartialEq)]
pub enum DeleteDataSetError {
AccessDenied(String),
Conflict(String),
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl DeleteDataSetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDataSetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DeleteDataSetError::AccessDenied(err.msg))
}
"ConflictException" => {
return RusotoError::Service(DeleteDataSetError::Conflict(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(DeleteDataSetError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteDataSetError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(DeleteDataSetError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteDataSetError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteDataSetError::AccessDenied(ref cause) => write!(f, "{}", cause),
DeleteDataSetError::Conflict(ref cause) => write!(f, "{}", cause),
DeleteDataSetError::InternalServer(ref cause) => write!(f, "{}", cause),
DeleteDataSetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DeleteDataSetError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteDataSetError {}
#[derive(Debug, PartialEq)]
pub enum DeleteRevisionError {
AccessDenied(String),
Conflict(String),
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl DeleteRevisionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteRevisionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DeleteRevisionError::AccessDenied(err.msg))
}
"ConflictException" => {
return RusotoError::Service(DeleteRevisionError::Conflict(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(DeleteRevisionError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteRevisionError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(DeleteRevisionError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteRevisionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteRevisionError::AccessDenied(ref cause) => write!(f, "{}", cause),
DeleteRevisionError::Conflict(ref cause) => write!(f, "{}", cause),
DeleteRevisionError::InternalServer(ref cause) => write!(f, "{}", cause),
DeleteRevisionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DeleteRevisionError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteRevisionError {}
#[derive(Debug, PartialEq)]
pub enum GetAssetError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetAssetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetAssetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetAssetError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetAssetError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(GetAssetError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetAssetError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetAssetError::InternalServer(ref cause) => write!(f, "{}", cause),
GetAssetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetAssetError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetAssetError {}
#[derive(Debug, PartialEq)]
pub enum GetDataSetError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetDataSetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDataSetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetDataSetError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetDataSetError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(GetDataSetError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetDataSetError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetDataSetError::InternalServer(ref cause) => write!(f, "{}", cause),
GetDataSetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetDataSetError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetDataSetError {}
#[derive(Debug, PartialEq)]
pub enum GetJobError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetJobError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetJobError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetJobError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(GetJobError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetJobError::InternalServer(ref cause) => write!(f, "{}", cause),
GetJobError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetJobError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetJobError {}
#[derive(Debug, PartialEq)]
pub enum GetRevisionError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetRevisionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetRevisionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetRevisionError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetRevisionError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(GetRevisionError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetRevisionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetRevisionError::InternalServer(ref cause) => write!(f, "{}", cause),
GetRevisionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetRevisionError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetRevisionError {}
#[derive(Debug, PartialEq)]
pub enum ListDataSetRevisionsError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl ListDataSetRevisionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListDataSetRevisionsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListDataSetRevisionsError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListDataSetRevisionsError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(ListDataSetRevisionsError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListDataSetRevisionsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListDataSetRevisionsError::InternalServer(ref cause) => write!(f, "{}", cause),
ListDataSetRevisionsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
ListDataSetRevisionsError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListDataSetRevisionsError {}
#[derive(Debug, PartialEq)]
pub enum ListDataSetsError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl ListDataSetsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListDataSetsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListDataSetsError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListDataSetsError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(ListDataSetsError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListDataSetsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListDataSetsError::InternalServer(ref cause) => write!(f, "{}", cause),
ListDataSetsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
ListDataSetsError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListDataSetsError {}
#[derive(Debug, PartialEq)]
pub enum ListJobsError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl ListJobsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListJobsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListJobsError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListJobsError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(ListJobsError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListJobsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListJobsError::InternalServer(ref cause) => write!(f, "{}", cause),
ListJobsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
ListJobsError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListJobsError {}
#[derive(Debug, PartialEq)]
pub enum ListRevisionAssetsError {
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl ListRevisionAssetsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListRevisionAssetsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListRevisionAssetsError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListRevisionAssetsError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(ListRevisionAssetsError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListRevisionAssetsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListRevisionAssetsError::InternalServer(ref cause) => write!(f, "{}", cause),
ListRevisionAssetsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
ListRevisionAssetsError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListRevisionAssetsError {}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListTagsForResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {}
}
}
impl Error for ListTagsForResourceError {}
#[derive(Debug, PartialEq)]
pub enum StartJobError {
AccessDenied(String),
Conflict(String),
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl StartJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartJobError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(StartJobError::AccessDenied(err.msg))
}
"ConflictException" => {
return RusotoError::Service(StartJobError::Conflict(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(StartJobError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(StartJobError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(StartJobError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for StartJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
StartJobError::AccessDenied(ref cause) => write!(f, "{}", cause),
StartJobError::Conflict(ref cause) => write!(f, "{}", cause),
StartJobError::InternalServer(ref cause) => write!(f, "{}", cause),
StartJobError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
StartJobError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for StartJobError {}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {}
impl TagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for TagResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {}
}
}
impl Error for TagResourceError {}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {}
impl UntagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UntagResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {}
}
}
impl Error for UntagResourceError {}
#[derive(Debug, PartialEq)]
pub enum UpdateAssetError {
AccessDenied(String),
Conflict(String),
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl UpdateAssetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateAssetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(UpdateAssetError::AccessDenied(err.msg))
}
"ConflictException" => {
return RusotoError::Service(UpdateAssetError::Conflict(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(UpdateAssetError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateAssetError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(UpdateAssetError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateAssetError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateAssetError::AccessDenied(ref cause) => write!(f, "{}", cause),
UpdateAssetError::Conflict(ref cause) => write!(f, "{}", cause),
UpdateAssetError::InternalServer(ref cause) => write!(f, "{}", cause),
UpdateAssetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UpdateAssetError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateAssetError {}
#[derive(Debug, PartialEq)]
pub enum UpdateDataSetError {
AccessDenied(String),
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl UpdateDataSetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateDataSetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(UpdateDataSetError::AccessDenied(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(UpdateDataSetError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateDataSetError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(UpdateDataSetError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateDataSetError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateDataSetError::AccessDenied(ref cause) => write!(f, "{}", cause),
UpdateDataSetError::InternalServer(ref cause) => write!(f, "{}", cause),
UpdateDataSetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UpdateDataSetError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateDataSetError {}
#[derive(Debug, PartialEq)]
pub enum UpdateRevisionError {
AccessDenied(String),
Conflict(String),
InternalServer(String),
ResourceNotFound(String),
Throttling(String),
}
impl UpdateRevisionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateRevisionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(UpdateRevisionError::AccessDenied(err.msg))
}
"ConflictException" => {
return RusotoError::Service(UpdateRevisionError::Conflict(err.msg))
}
"InternalServerException" => {
return RusotoError::Service(UpdateRevisionError::InternalServer(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateRevisionError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(UpdateRevisionError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateRevisionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateRevisionError::AccessDenied(ref cause) => write!(f, "{}", cause),
UpdateRevisionError::Conflict(ref cause) => write!(f, "{}", cause),
UpdateRevisionError::InternalServer(ref cause) => write!(f, "{}", cause),
UpdateRevisionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UpdateRevisionError::Throttling(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateRevisionError {}
#[async_trait]
pub trait DataExchange {
async fn cancel_job(&self, input: CancelJobRequest) -> Result<(), RusotoError<CancelJobError>>;
async fn create_data_set(
&self,
input: CreateDataSetRequest,
) -> Result<CreateDataSetResponse, RusotoError<CreateDataSetError>>;
async fn create_job(
&self,
input: CreateJobRequest,
) -> Result<CreateJobResponse, RusotoError<CreateJobError>>;
async fn create_revision(
&self,
input: CreateRevisionRequest,
) -> Result<CreateRevisionResponse, RusotoError<CreateRevisionError>>;
async fn delete_asset(
&self,
input: DeleteAssetRequest,
) -> Result<(), RusotoError<DeleteAssetError>>;
async fn delete_data_set(
&self,
input: DeleteDataSetRequest,
) -> Result<(), RusotoError<DeleteDataSetError>>;
async fn delete_revision(
&self,
input: DeleteRevisionRequest,
) -> Result<(), RusotoError<DeleteRevisionError>>;
async fn get_asset(
&self,
input: GetAssetRequest,
) -> Result<GetAssetResponse, RusotoError<GetAssetError>>;
async fn get_data_set(
&self,
input: GetDataSetRequest,
) -> Result<GetDataSetResponse, RusotoError<GetDataSetError>>;
async fn get_job(
&self,
input: GetJobRequest,
) -> Result<GetJobResponse, RusotoError<GetJobError>>;
async fn get_revision(
&self,
input: GetRevisionRequest,
) -> Result<GetRevisionResponse, RusotoError<GetRevisionError>>;
async fn list_data_set_revisions(
&self,
input: ListDataSetRevisionsRequest,
) -> Result<ListDataSetRevisionsResponse, RusotoError<ListDataSetRevisionsError>>;
async fn list_data_sets(
&self,
input: ListDataSetsRequest,
) -> Result<ListDataSetsResponse, RusotoError<ListDataSetsError>>;
async fn list_jobs(
&self,
input: ListJobsRequest,
) -> Result<ListJobsResponse, RusotoError<ListJobsError>>;
async fn list_revision_assets(
&self,
input: ListRevisionAssetsRequest,
) -> Result<ListRevisionAssetsResponse, RusotoError<ListRevisionAssetsError>>;
async fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>>;
async fn start_job(
&self,
input: StartJobRequest,
) -> Result<StartJobResponse, RusotoError<StartJobError>>;
async fn tag_resource(
&self,
input: TagResourceRequest,
) -> Result<(), RusotoError<TagResourceError>>;
async fn untag_resource(
&self,
input: UntagResourceRequest,
) -> Result<(), RusotoError<UntagResourceError>>;
async fn update_asset(
&self,
input: UpdateAssetRequest,
) -> Result<UpdateAssetResponse, RusotoError<UpdateAssetError>>;
async fn update_data_set(
&self,
input: UpdateDataSetRequest,
) -> Result<UpdateDataSetResponse, RusotoError<UpdateDataSetError>>;
async fn update_revision(
&self,
input: UpdateRevisionRequest,
) -> Result<UpdateRevisionResponse, RusotoError<UpdateRevisionError>>;
}
#[derive(Clone)]
pub struct DataExchangeClient {
client: Client,
region: region::Region,
}
impl DataExchangeClient {
pub fn new(region: region::Region) -> DataExchangeClient {
DataExchangeClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> DataExchangeClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
D: DispatchSignedRequest + Send + Sync + 'static,
{
DataExchangeClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
pub fn new_with_client(client: Client, region: region::Region) -> DataExchangeClient {
DataExchangeClient { client, region }
}
}
#[async_trait]
impl DataExchange for DataExchangeClient {
#[allow(unused_mut)]
async fn cancel_job(&self, input: CancelJobRequest) -> Result<(), RusotoError<CancelJobError>> {
let request_uri = format!("/v1/jobs/{job_id}", job_id = input.job_id);
let mut request = SignedRequest::new("DELETE", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 204 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = ::std::mem::drop(response);
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(CancelJobError::from_response(response))
}
}
#[allow(unused_mut)]
async fn create_data_set(
&self,
input: CreateDataSetRequest,
) -> Result<CreateDataSetResponse, RusotoError<CreateDataSetError>> {
let request_uri = "/v1/data-sets";
let mut request = SignedRequest::new("POST", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 201 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateDataSetResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(CreateDataSetError::from_response(response))
}
}
#[allow(unused_mut)]
async fn create_job(
&self,
input: CreateJobRequest,
) -> Result<CreateJobResponse, RusotoError<CreateJobError>> {
let request_uri = "/v1/jobs";
let mut request = SignedRequest::new("POST", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 201 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateJobResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(CreateJobError::from_response(response))
}
}
#[allow(unused_mut)]
async fn create_revision(
&self,
input: CreateRevisionRequest,
) -> Result<CreateRevisionResponse, RusotoError<CreateRevisionError>> {
let request_uri = format!(
"/v1/data-sets/{data_set_id}/revisions",
data_set_id = input.data_set_id
);
let mut request = SignedRequest::new("POST", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 201 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateRevisionResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(CreateRevisionError::from_response(response))
}
}
#[allow(unused_mut)]
async fn delete_asset(
&self,
input: DeleteAssetRequest,
) -> Result<(), RusotoError<DeleteAssetError>> {
let request_uri = format!(
"/v1/data-sets/{data_set_id}/revisions/{revision_id}/assets/{asset_id}",
asset_id = input.asset_id,
data_set_id = input.data_set_id,
revision_id = input.revision_id
);
let mut request = SignedRequest::new("DELETE", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 204 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = ::std::mem::drop(response);
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(DeleteAssetError::from_response(response))
}
}
#[allow(unused_mut)]
async fn delete_data_set(
&self,
input: DeleteDataSetRequest,
) -> Result<(), RusotoError<DeleteDataSetError>> {
let request_uri = format!(
"/v1/data-sets/{data_set_id}",
data_set_id = input.data_set_id
);
let mut request = SignedRequest::new("DELETE", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 204 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = ::std::mem::drop(response);
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(DeleteDataSetError::from_response(response))
}
}
#[allow(unused_mut)]
async fn delete_revision(
&self,
input: DeleteRevisionRequest,
) -> Result<(), RusotoError<DeleteRevisionError>> {
let request_uri = format!(
"/v1/data-sets/{data_set_id}/revisions/{revision_id}",
data_set_id = input.data_set_id,
revision_id = input.revision_id
);
let mut request = SignedRequest::new("DELETE", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 204 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = ::std::mem::drop(response);
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(DeleteRevisionError::from_response(response))
}
}
#[allow(unused_mut)]
async fn get_asset(
&self,
input: GetAssetRequest,
) -> Result<GetAssetResponse, RusotoError<GetAssetError>> {
let request_uri = format!(
"/v1/data-sets/{data_set_id}/revisions/{revision_id}/assets/{asset_id}",
asset_id = input.asset_id,
data_set_id = input.data_set_id,
revision_id = input.revision_id
);
let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetAssetResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(GetAssetError::from_response(response))
}
}
#[allow(unused_mut)]
async fn get_data_set(
&self,
input: GetDataSetRequest,
) -> Result<GetDataSetResponse, RusotoError<GetDataSetError>> {
let request_uri = format!(
"/v1/data-sets/{data_set_id}",
data_set_id = input.data_set_id
);
let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetDataSetResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(GetDataSetError::from_response(response))
}
}
#[allow(unused_mut)]
async fn get_job(
&self,
input: GetJobRequest,
) -> Result<GetJobResponse, RusotoError<GetJobError>> {
let request_uri = format!("/v1/jobs/{job_id}", job_id = input.job_id);
let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result =
proto::json::ResponsePayload::new(&response).deserialize::<GetJobResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(GetJobError::from_response(response))
}
}
#[allow(unused_mut)]
async fn get_revision(
&self,
input: GetRevisionRequest,
) -> Result<GetRevisionResponse, RusotoError<GetRevisionError>> {
let request_uri = format!(
"/v1/data-sets/{data_set_id}/revisions/{revision_id}",
data_set_id = input.data_set_id,
revision_id = input.revision_id
);
let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetRevisionResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(GetRevisionError::from_response(response))
}
}
#[allow(unused_mut)]
async fn list_data_set_revisions(
&self,
input: ListDataSetRevisionsRequest,
) -> Result<ListDataSetRevisionsResponse, RusotoError<ListDataSetRevisionsError>> {
let request_uri = format!(
"/v1/data-sets/{data_set_id}/revisions",
data_set_id = input.data_set_id
);
let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListDataSetRevisionsResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(ListDataSetRevisionsError::from_response(response))
}
}
#[allow(unused_mut)]
async fn list_data_sets(
&self,
input: ListDataSetsRequest,
) -> Result<ListDataSetsResponse, RusotoError<ListDataSetsError>> {
let request_uri = "/v1/data-sets";
let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
if let Some(ref x) = input.origin {
params.put("origin", x);
}
request.set_params(params);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListDataSetsResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(ListDataSetsError::from_response(response))
}
}
#[allow(unused_mut)]
async fn list_jobs(
&self,
input: ListJobsRequest,
) -> Result<ListJobsResponse, RusotoError<ListJobsError>> {
let request_uri = "/v1/jobs";
let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.data_set_id {
params.put("dataSetId", x);
}
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
if let Some(ref x) = input.revision_id {
params.put("revisionId", x);
}
request.set_params(params);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListJobsResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(ListJobsError::from_response(response))
}
}
#[allow(unused_mut)]
async fn list_revision_assets(
&self,
input: ListRevisionAssetsRequest,
) -> Result<ListRevisionAssetsResponse, RusotoError<ListRevisionAssetsError>> {
let request_uri = format!(
"/v1/data-sets/{data_set_id}/revisions/{revision_id}/assets",
data_set_id = input.data_set_id,
revision_id = input.revision_id
);
let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListRevisionAssetsResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(ListRevisionAssetsError::from_response(response))
}
}
#[allow(unused_mut)]
async fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>> {
let request_uri = format!("/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsForResourceResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(ListTagsForResourceError::from_response(response))
}
}
#[allow(unused_mut)]
async fn start_job(
&self,
input: StartJobRequest,
) -> Result<StartJobResponse, RusotoError<StartJobError>> {
let request_uri = format!("/v1/jobs/{job_id}", job_id = input.job_id);
let mut request = SignedRequest::new("PATCH", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 202 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<StartJobResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(StartJobError::from_response(response))
}
}
#[allow(unused_mut)]
async fn tag_resource(
&self,
input: TagResourceRequest,
) -> Result<(), RusotoError<TagResourceError>> {
let request_uri = format!("/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("POST", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 204 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = ::std::mem::drop(response);
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(TagResourceError::from_response(response))
}
}
#[allow(unused_mut)]
async fn untag_resource(
&self,
input: UntagResourceRequest,
) -> Result<(), RusotoError<UntagResourceError>> {
let request_uri = format!("/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("DELETE", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
for item in input.tag_keys.iter() {
params.put("tagKeys", item);
}
request.set_params(params);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 204 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = ::std::mem::drop(response);
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(UntagResourceError::from_response(response))
}
}
#[allow(unused_mut)]
async fn update_asset(
&self,
input: UpdateAssetRequest,
) -> Result<UpdateAssetResponse, RusotoError<UpdateAssetError>> {
let request_uri = format!(
"/v1/data-sets/{data_set_id}/revisions/{revision_id}/assets/{asset_id}",
asset_id = input.asset_id,
data_set_id = input.data_set_id,
revision_id = input.revision_id
);
let mut request = SignedRequest::new("PATCH", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateAssetResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(UpdateAssetError::from_response(response))
}
}
#[allow(unused_mut)]
async fn update_data_set(
&self,
input: UpdateDataSetRequest,
) -> Result<UpdateDataSetResponse, RusotoError<UpdateDataSetError>> {
let request_uri = format!(
"/v1/data-sets/{data_set_id}",
data_set_id = input.data_set_id
);
let mut request = SignedRequest::new("PATCH", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateDataSetResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(UpdateDataSetError::from_response(response))
}
}
#[allow(unused_mut)]
async fn update_revision(
&self,
input: UpdateRevisionRequest,
) -> Result<UpdateRevisionResponse, RusotoError<UpdateRevisionError>> {
let request_uri = format!(
"/v1/data-sets/{data_set_id}/revisions/{revision_id}",
data_set_id = input.data_set_id,
revision_id = input.revision_id
);
let mut request = SignedRequest::new("PATCH", "dataexchange", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateRevisionResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(UpdateRevisionError::from_response(response))
}
}
}