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::param::{Params, ServiceParams};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AccountLimit {
#[serde(rename = "CodeSizeUnzipped")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code_size_unzipped: Option<i64>,
#[serde(rename = "CodeSizeZipped")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code_size_zipped: Option<i64>,
#[serde(rename = "ConcurrentExecutions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub concurrent_executions: Option<i64>,
#[serde(rename = "TotalCodeSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_code_size: Option<i64>,
#[serde(rename = "UnreservedConcurrentExecutions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unreserved_concurrent_executions: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AccountUsage {
#[serde(rename = "FunctionCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_count: Option<i64>,
#[serde(rename = "TotalCodeSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_code_size: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AddLayerVersionPermissionRequest {
#[serde(rename = "Action")]
pub action: String,
#[serde(rename = "LayerName")]
pub layer_name: String,
#[serde(rename = "OrganizationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization_id: Option<String>,
#[serde(rename = "Principal")]
pub principal: String,
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
#[serde(rename = "StatementId")]
pub statement_id: String,
#[serde(rename = "VersionNumber")]
pub version_number: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AddLayerVersionPermissionResponse {
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
#[serde(rename = "Statement")]
#[serde(skip_serializing_if = "Option::is_none")]
pub statement: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AddPermissionRequest {
#[serde(rename = "Action")]
pub action: String,
#[serde(rename = "EventSourceToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_source_token: Option<String>,
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "Principal")]
pub principal: String,
#[serde(rename = "Qualifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualifier: Option<String>,
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
#[serde(rename = "SourceAccount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_account: Option<String>,
#[serde(rename = "SourceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_arn: Option<String>,
#[serde(rename = "StatementId")]
pub statement_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AddPermissionResponse {
#[serde(rename = "Statement")]
#[serde(skip_serializing_if = "Option::is_none")]
pub statement: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AliasConfiguration {
#[serde(rename = "AliasArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub alias_arn: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "FunctionVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_version: 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 = "RoutingConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub routing_config: Option<AliasRoutingConfiguration>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AliasRoutingConfiguration {
#[serde(rename = "AdditionalVersionWeights")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_version_weights: Option<::std::collections::HashMap<String, f64>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Concurrency {
#[serde(rename = "ReservedConcurrentExecutions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reserved_concurrent_executions: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateAliasRequest {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "FunctionVersion")]
pub function_version: String,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "RoutingConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub routing_config: Option<AliasRoutingConfiguration>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateEventSourceMappingRequest {
#[serde(rename = "BatchSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub batch_size: Option<i64>,
#[serde(rename = "Enabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
#[serde(rename = "EventSourceArn")]
pub event_source_arn: String,
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "StartingPosition")]
#[serde(skip_serializing_if = "Option::is_none")]
pub starting_position: Option<String>,
#[serde(rename = "StartingPositionTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub starting_position_timestamp: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateFunctionRequest {
#[serde(rename = "Code")]
pub code: FunctionCode,
#[serde(rename = "DeadLetterConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dead_letter_config: Option<DeadLetterConfig>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Environment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub environment: Option<Environment>,
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "Handler")]
pub handler: String,
#[serde(rename = "KMSKeyArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_arn: Option<String>,
#[serde(rename = "Layers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layers: Option<Vec<String>>,
#[serde(rename = "MemorySize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory_size: Option<i64>,
#[serde(rename = "Publish")]
#[serde(skip_serializing_if = "Option::is_none")]
pub publish: Option<bool>,
#[serde(rename = "Role")]
pub role: String,
#[serde(rename = "Runtime")]
pub runtime: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "Timeout")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timeout: Option<i64>,
#[serde(rename = "TracingConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tracing_config: Option<TracingConfig>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DeadLetterConfig {
#[serde(rename = "TargetArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteAliasRequest {
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteEventSourceMappingRequest {
#[serde(rename = "UUID")]
pub uuid: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteFunctionConcurrencyRequest {
#[serde(rename = "FunctionName")]
pub function_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteFunctionRequest {
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "Qualifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualifier: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteLayerVersionRequest {
#[serde(rename = "LayerName")]
pub layer_name: String,
#[serde(rename = "VersionNumber")]
pub version_number: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct Environment {
#[serde(rename = "Variables")]
#[serde(skip_serializing_if = "Option::is_none")]
pub variables: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct EnvironmentError {
#[serde(rename = "ErrorCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_code: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct EnvironmentResponse {
#[serde(rename = "Error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<EnvironmentError>,
#[serde(rename = "Variables")]
#[serde(skip_serializing_if = "Option::is_none")]
pub variables: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct EventSourceMappingConfiguration {
#[serde(rename = "BatchSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub batch_size: Option<i64>,
#[serde(rename = "EventSourceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_source_arn: Option<String>,
#[serde(rename = "FunctionArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_arn: Option<String>,
#[serde(rename = "LastModified")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified: Option<f64>,
#[serde(rename = "LastProcessingResult")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_processing_result: Option<String>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "StateTransitionReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state_transition_reason: Option<String>,
#[serde(rename = "UUID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uuid: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct FunctionCode {
#[serde(rename = "S3Bucket")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_bucket: Option<String>,
#[serde(rename = "S3Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_key: Option<String>,
#[serde(rename = "S3ObjectVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_object_version: Option<String>,
#[serde(rename = "ZipFile")]
#[serde(
deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
default
)]
#[serde(skip_serializing_if = "Option::is_none")]
pub zip_file: Option<bytes::Bytes>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct FunctionCodeLocation {
#[serde(rename = "Location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<String>,
#[serde(rename = "RepositoryType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct FunctionConfiguration {
#[serde(rename = "CodeSha256")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code_sha_256: Option<String>,
#[serde(rename = "CodeSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code_size: Option<i64>,
#[serde(rename = "DeadLetterConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dead_letter_config: Option<DeadLetterConfig>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Environment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub environment: Option<EnvironmentResponse>,
#[serde(rename = "FunctionArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_arn: Option<String>,
#[serde(rename = "FunctionName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_name: Option<String>,
#[serde(rename = "Handler")]
#[serde(skip_serializing_if = "Option::is_none")]
pub handler: Option<String>,
#[serde(rename = "KMSKeyArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_arn: Option<String>,
#[serde(rename = "LastModified")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified: Option<String>,
#[serde(rename = "Layers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layers: Option<Vec<Layer>>,
#[serde(rename = "MasterArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub master_arn: Option<String>,
#[serde(rename = "MemorySize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory_size: Option<i64>,
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
#[serde(rename = "Role")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role: Option<String>,
#[serde(rename = "Runtime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub runtime: Option<String>,
#[serde(rename = "Timeout")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timeout: Option<i64>,
#[serde(rename = "TracingConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tracing_config: Option<TracingConfigResponse>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfigResponse>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetAccountSettingsRequest {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetAccountSettingsResponse {
#[serde(rename = "AccountLimit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_limit: Option<AccountLimit>,
#[serde(rename = "AccountUsage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_usage: Option<AccountUsage>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetAliasRequest {
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetEventSourceMappingRequest {
#[serde(rename = "UUID")]
pub uuid: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetFunctionConfigurationRequest {
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "Qualifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualifier: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetFunctionRequest {
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "Qualifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualifier: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetFunctionResponse {
#[serde(rename = "Code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<FunctionCodeLocation>,
#[serde(rename = "Concurrency")]
#[serde(skip_serializing_if = "Option::is_none")]
pub concurrency: Option<Concurrency>,
#[serde(rename = "Configuration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration: Option<FunctionConfiguration>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetLayerVersionByArnRequest {
#[serde(rename = "Arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetLayerVersionPolicyRequest {
#[serde(rename = "LayerName")]
pub layer_name: String,
#[serde(rename = "VersionNumber")]
pub version_number: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetLayerVersionPolicyResponse {
#[serde(rename = "Policy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub policy: Option<String>,
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetLayerVersionRequest {
#[serde(rename = "LayerName")]
pub layer_name: String,
#[serde(rename = "VersionNumber")]
pub version_number: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetLayerVersionResponse {
#[serde(rename = "CompatibleRuntimes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compatible_runtimes: Option<Vec<String>>,
#[serde(rename = "Content")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<LayerVersionContentOutput>,
#[serde(rename = "CreatedDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_date: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "LayerArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layer_arn: Option<String>,
#[serde(rename = "LayerVersionArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layer_version_arn: Option<String>,
#[serde(rename = "LicenseInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_info: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetPolicyRequest {
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "Qualifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualifier: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetPolicyResponse {
#[serde(rename = "Policy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub policy: Option<String>,
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InvocationRequest {
#[serde(rename = "ClientContext")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_context: Option<String>,
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "InvocationType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub invocation_type: Option<String>,
#[serde(rename = "LogType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_type: Option<String>,
#[serde(rename = "Payload")]
#[serde(
deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
default
)]
#[serde(skip_serializing_if = "Option::is_none")]
pub payload: Option<bytes::Bytes>,
#[serde(rename = "Qualifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualifier: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct InvocationResponse {
pub executed_version: Option<String>,
pub function_error: Option<String>,
pub log_result: Option<String>,
pub payload: Option<bytes::Bytes>,
pub status_code: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InvokeAsyncRequest {
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "InvokeArgs")]
#[serde(
deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
default
)]
pub invoke_args: bytes::Bytes,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InvokeAsyncResponse {
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Layer {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "CodeSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code_size: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct LayerVersionContentInput {
#[serde(rename = "S3Bucket")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_bucket: Option<String>,
#[serde(rename = "S3Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_key: Option<String>,
#[serde(rename = "S3ObjectVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_object_version: Option<String>,
#[serde(rename = "ZipFile")]
#[serde(
deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
default
)]
#[serde(skip_serializing_if = "Option::is_none")]
pub zip_file: Option<bytes::Bytes>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LayerVersionContentOutput {
#[serde(rename = "CodeSha256")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code_sha_256: Option<String>,
#[serde(rename = "CodeSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code_size: Option<i64>,
#[serde(rename = "Location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LayerVersionsListItem {
#[serde(rename = "CompatibleRuntimes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compatible_runtimes: Option<Vec<String>>,
#[serde(rename = "CreatedDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_date: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "LayerVersionArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layer_version_arn: Option<String>,
#[serde(rename = "LicenseInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_info: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LayersListItem {
#[serde(rename = "LatestMatchingVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub latest_matching_version: Option<LayerVersionsListItem>,
#[serde(rename = "LayerArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layer_arn: Option<String>,
#[serde(rename = "LayerName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layer_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListAliasesRequest {
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "FunctionVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_version: Option<String>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "MaxItems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_items: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListAliasesResponse {
#[serde(rename = "Aliases")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aliases: Option<Vec<AliasConfiguration>>,
#[serde(rename = "NextMarker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListEventSourceMappingsRequest {
#[serde(rename = "EventSourceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_source_arn: Option<String>,
#[serde(rename = "FunctionName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_name: Option<String>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "MaxItems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_items: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListEventSourceMappingsResponse {
#[serde(rename = "EventSourceMappings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_source_mappings: Option<Vec<EventSourceMappingConfiguration>>,
#[serde(rename = "NextMarker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListFunctionsRequest {
#[serde(rename = "FunctionVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_version: Option<String>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "MasterRegion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub master_region: Option<String>,
#[serde(rename = "MaxItems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_items: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListFunctionsResponse {
#[serde(rename = "Functions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub functions: Option<Vec<FunctionConfiguration>>,
#[serde(rename = "NextMarker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListLayerVersionsRequest {
#[serde(rename = "CompatibleRuntime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compatible_runtime: Option<String>,
#[serde(rename = "LayerName")]
pub layer_name: String,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "MaxItems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_items: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListLayerVersionsResponse {
#[serde(rename = "LayerVersions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layer_versions: Option<Vec<LayerVersionsListItem>>,
#[serde(rename = "NextMarker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListLayersRequest {
#[serde(rename = "CompatibleRuntime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compatible_runtime: Option<String>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "MaxItems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_items: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListLayersResponse {
#[serde(rename = "Layers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layers: Option<Vec<LayersListItem>>,
#[serde(rename = "NextMarker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsRequest {
#[serde(rename = "Resource")]
pub resource: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagsResponse {
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListVersionsByFunctionRequest {
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "MaxItems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_items: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListVersionsByFunctionResponse {
#[serde(rename = "NextMarker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_marker: Option<String>,
#[serde(rename = "Versions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub versions: Option<Vec<FunctionConfiguration>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PublishLayerVersionRequest {
#[serde(rename = "CompatibleRuntimes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compatible_runtimes: Option<Vec<String>>,
#[serde(rename = "Content")]
pub content: LayerVersionContentInput,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "LayerName")]
pub layer_name: String,
#[serde(rename = "LicenseInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_info: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PublishLayerVersionResponse {
#[serde(rename = "CompatibleRuntimes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compatible_runtimes: Option<Vec<String>>,
#[serde(rename = "Content")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<LayerVersionContentOutput>,
#[serde(rename = "CreatedDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_date: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "LayerArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layer_arn: Option<String>,
#[serde(rename = "LayerVersionArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layer_version_arn: Option<String>,
#[serde(rename = "LicenseInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_info: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PublishVersionRequest {
#[serde(rename = "CodeSha256")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code_sha_256: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutFunctionConcurrencyRequest {
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "ReservedConcurrentExecutions")]
pub reserved_concurrent_executions: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RemoveLayerVersionPermissionRequest {
#[serde(rename = "LayerName")]
pub layer_name: String,
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
#[serde(rename = "StatementId")]
pub statement_id: String,
#[serde(rename = "VersionNumber")]
pub version_number: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RemovePermissionRequest {
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "Qualifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualifier: Option<String>,
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
#[serde(rename = "StatementId")]
pub statement_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TagResourceRequest {
#[serde(rename = "Resource")]
pub resource: String,
#[serde(rename = "Tags")]
pub tags: ::std::collections::HashMap<String, String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TracingConfig {
#[serde(rename = "Mode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mode: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TracingConfigResponse {
#[serde(rename = "Mode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mode: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UntagResourceRequest {
#[serde(rename = "Resource")]
pub resource: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateAliasRequest {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "FunctionVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_version: Option<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
#[serde(rename = "RoutingConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub routing_config: Option<AliasRoutingConfiguration>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateEventSourceMappingRequest {
#[serde(rename = "BatchSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub batch_size: Option<i64>,
#[serde(rename = "Enabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
#[serde(rename = "FunctionName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub function_name: Option<String>,
#[serde(rename = "UUID")]
pub uuid: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateFunctionCodeRequest {
#[serde(rename = "DryRun")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dry_run: Option<bool>,
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "Publish")]
#[serde(skip_serializing_if = "Option::is_none")]
pub publish: Option<bool>,
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
#[serde(rename = "S3Bucket")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_bucket: Option<String>,
#[serde(rename = "S3Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_key: Option<String>,
#[serde(rename = "S3ObjectVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_object_version: Option<String>,
#[serde(rename = "ZipFile")]
#[serde(
deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
default
)]
#[serde(skip_serializing_if = "Option::is_none")]
pub zip_file: Option<bytes::Bytes>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateFunctionConfigurationRequest {
#[serde(rename = "DeadLetterConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dead_letter_config: Option<DeadLetterConfig>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Environment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub environment: Option<Environment>,
#[serde(rename = "FunctionName")]
pub function_name: String,
#[serde(rename = "Handler")]
#[serde(skip_serializing_if = "Option::is_none")]
pub handler: Option<String>,
#[serde(rename = "KMSKeyArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_arn: Option<String>,
#[serde(rename = "Layers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layers: Option<Vec<String>>,
#[serde(rename = "MemorySize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory_size: Option<i64>,
#[serde(rename = "RevisionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision_id: Option<String>,
#[serde(rename = "Role")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role: Option<String>,
#[serde(rename = "Runtime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub runtime: Option<String>,
#[serde(rename = "Timeout")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timeout: Option<i64>,
#[serde(rename = "TracingConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tracing_config: Option<TracingConfig>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct VpcConfig {
#[serde(rename = "SecurityGroupIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_group_ids: Option<Vec<String>>,
#[serde(rename = "SubnetIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_ids: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct VpcConfigResponse {
#[serde(rename = "SecurityGroupIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_group_ids: Option<Vec<String>>,
#[serde(rename = "SubnetIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_ids: Option<Vec<String>>,
#[serde(rename = "VpcId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_id: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum AddLayerVersionPermissionError {
InvalidParameterValue(String),
PolicyLengthExceeded(String),
PreconditionFailed(String),
ResourceConflict(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl AddLayerVersionPermissionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AddLayerVersionPermissionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(
AddLayerVersionPermissionError::InvalidParameterValue(err.msg),
)
}
"PolicyLengthExceededException" => {
return RusotoError::Service(
AddLayerVersionPermissionError::PolicyLengthExceeded(err.msg),
)
}
"PreconditionFailedException" => {
return RusotoError::Service(
AddLayerVersionPermissionError::PreconditionFailed(err.msg),
)
}
"ResourceConflictException" => {
return RusotoError::Service(AddLayerVersionPermissionError::ResourceConflict(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(AddLayerVersionPermissionError::ResourceNotFound(
err.msg,
))
}
"ServiceException" => {
return RusotoError::Service(AddLayerVersionPermissionError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(AddLayerVersionPermissionError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AddLayerVersionPermissionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddLayerVersionPermissionError {
fn description(&self) -> &str {
match *self {
AddLayerVersionPermissionError::InvalidParameterValue(ref cause) => cause,
AddLayerVersionPermissionError::PolicyLengthExceeded(ref cause) => cause,
AddLayerVersionPermissionError::PreconditionFailed(ref cause) => cause,
AddLayerVersionPermissionError::ResourceConflict(ref cause) => cause,
AddLayerVersionPermissionError::ResourceNotFound(ref cause) => cause,
AddLayerVersionPermissionError::Service(ref cause) => cause,
AddLayerVersionPermissionError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum AddPermissionError {
InvalidParameterValue(String),
PolicyLengthExceeded(String),
PreconditionFailed(String),
ResourceConflict(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl AddPermissionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AddPermissionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(AddPermissionError::InvalidParameterValue(err.msg))
}
"PolicyLengthExceededException" => {
return RusotoError::Service(AddPermissionError::PolicyLengthExceeded(err.msg))
}
"PreconditionFailedException" => {
return RusotoError::Service(AddPermissionError::PreconditionFailed(err.msg))
}
"ResourceConflictException" => {
return RusotoError::Service(AddPermissionError::ResourceConflict(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(AddPermissionError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(AddPermissionError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(AddPermissionError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AddPermissionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddPermissionError {
fn description(&self) -> &str {
match *self {
AddPermissionError::InvalidParameterValue(ref cause) => cause,
AddPermissionError::PolicyLengthExceeded(ref cause) => cause,
AddPermissionError::PreconditionFailed(ref cause) => cause,
AddPermissionError::ResourceConflict(ref cause) => cause,
AddPermissionError::ResourceNotFound(ref cause) => cause,
AddPermissionError::Service(ref cause) => cause,
AddPermissionError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateAliasError {
InvalidParameterValue(String),
ResourceConflict(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl CreateAliasError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateAliasError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(CreateAliasError::InvalidParameterValue(err.msg))
}
"ResourceConflictException" => {
return RusotoError::Service(CreateAliasError::ResourceConflict(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CreateAliasError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(CreateAliasError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(CreateAliasError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateAliasError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateAliasError {
fn description(&self) -> &str {
match *self {
CreateAliasError::InvalidParameterValue(ref cause) => cause,
CreateAliasError::ResourceConflict(ref cause) => cause,
CreateAliasError::ResourceNotFound(ref cause) => cause,
CreateAliasError::Service(ref cause) => cause,
CreateAliasError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateEventSourceMappingError {
InvalidParameterValue(String),
ResourceConflict(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl CreateEventSourceMappingError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateEventSourceMappingError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(
CreateEventSourceMappingError::InvalidParameterValue(err.msg),
)
}
"ResourceConflictException" => {
return RusotoError::Service(CreateEventSourceMappingError::ResourceConflict(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CreateEventSourceMappingError::ResourceNotFound(
err.msg,
))
}
"ServiceException" => {
return RusotoError::Service(CreateEventSourceMappingError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(CreateEventSourceMappingError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateEventSourceMappingError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateEventSourceMappingError {
fn description(&self) -> &str {
match *self {
CreateEventSourceMappingError::InvalidParameterValue(ref cause) => cause,
CreateEventSourceMappingError::ResourceConflict(ref cause) => cause,
CreateEventSourceMappingError::ResourceNotFound(ref cause) => cause,
CreateEventSourceMappingError::Service(ref cause) => cause,
CreateEventSourceMappingError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateFunctionError {
CodeStorageExceeded(String),
InvalidParameterValue(String),
ResourceConflict(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl CreateFunctionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateFunctionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"CodeStorageExceededException" => {
return RusotoError::Service(CreateFunctionError::CodeStorageExceeded(err.msg))
}
"InvalidParameterValueException" => {
return RusotoError::Service(CreateFunctionError::InvalidParameterValue(
err.msg,
))
}
"ResourceConflictException" => {
return RusotoError::Service(CreateFunctionError::ResourceConflict(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CreateFunctionError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(CreateFunctionError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(CreateFunctionError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateFunctionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateFunctionError {
fn description(&self) -> &str {
match *self {
CreateFunctionError::CodeStorageExceeded(ref cause) => cause,
CreateFunctionError::InvalidParameterValue(ref cause) => cause,
CreateFunctionError::ResourceConflict(ref cause) => cause,
CreateFunctionError::ResourceNotFound(ref cause) => cause,
CreateFunctionError::Service(ref cause) => cause,
CreateFunctionError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteAliasError {
InvalidParameterValue(String),
Service(String),
TooManyRequests(String),
}
impl DeleteAliasError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteAliasError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(DeleteAliasError::InvalidParameterValue(err.msg))
}
"ServiceException" => {
return RusotoError::Service(DeleteAliasError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(DeleteAliasError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteAliasError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteAliasError {
fn description(&self) -> &str {
match *self {
DeleteAliasError::InvalidParameterValue(ref cause) => cause,
DeleteAliasError::Service(ref cause) => cause,
DeleteAliasError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteEventSourceMappingError {
InvalidParameterValue(String),
ResourceInUse(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl DeleteEventSourceMappingError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteEventSourceMappingError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(
DeleteEventSourceMappingError::InvalidParameterValue(err.msg),
)
}
"ResourceInUseException" => {
return RusotoError::Service(DeleteEventSourceMappingError::ResourceInUse(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteEventSourceMappingError::ResourceNotFound(
err.msg,
))
}
"ServiceException" => {
return RusotoError::Service(DeleteEventSourceMappingError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(DeleteEventSourceMappingError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteEventSourceMappingError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteEventSourceMappingError {
fn description(&self) -> &str {
match *self {
DeleteEventSourceMappingError::InvalidParameterValue(ref cause) => cause,
DeleteEventSourceMappingError::ResourceInUse(ref cause) => cause,
DeleteEventSourceMappingError::ResourceNotFound(ref cause) => cause,
DeleteEventSourceMappingError::Service(ref cause) => cause,
DeleteEventSourceMappingError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteFunctionError {
InvalidParameterValue(String),
ResourceConflict(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl DeleteFunctionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteFunctionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(DeleteFunctionError::InvalidParameterValue(
err.msg,
))
}
"ResourceConflictException" => {
return RusotoError::Service(DeleteFunctionError::ResourceConflict(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteFunctionError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(DeleteFunctionError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(DeleteFunctionError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteFunctionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteFunctionError {
fn description(&self) -> &str {
match *self {
DeleteFunctionError::InvalidParameterValue(ref cause) => cause,
DeleteFunctionError::ResourceConflict(ref cause) => cause,
DeleteFunctionError::ResourceNotFound(ref cause) => cause,
DeleteFunctionError::Service(ref cause) => cause,
DeleteFunctionError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteFunctionConcurrencyError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl DeleteFunctionConcurrencyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteFunctionConcurrencyError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(
DeleteFunctionConcurrencyError::InvalidParameterValue(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteFunctionConcurrencyError::ResourceNotFound(
err.msg,
))
}
"ServiceException" => {
return RusotoError::Service(DeleteFunctionConcurrencyError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(DeleteFunctionConcurrencyError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteFunctionConcurrencyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteFunctionConcurrencyError {
fn description(&self) -> &str {
match *self {
DeleteFunctionConcurrencyError::InvalidParameterValue(ref cause) => cause,
DeleteFunctionConcurrencyError::ResourceNotFound(ref cause) => cause,
DeleteFunctionConcurrencyError::Service(ref cause) => cause,
DeleteFunctionConcurrencyError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteLayerVersionError {
Service(String),
TooManyRequests(String),
}
impl DeleteLayerVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteLayerVersionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ServiceException" => {
return RusotoError::Service(DeleteLayerVersionError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(DeleteLayerVersionError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteLayerVersionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteLayerVersionError {
fn description(&self) -> &str {
match *self {
DeleteLayerVersionError::Service(ref cause) => cause,
DeleteLayerVersionError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetAccountSettingsError {
Service(String),
TooManyRequests(String),
}
impl GetAccountSettingsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetAccountSettingsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ServiceException" => {
return RusotoError::Service(GetAccountSettingsError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetAccountSettingsError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetAccountSettingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetAccountSettingsError {
fn description(&self) -> &str {
match *self {
GetAccountSettingsError::Service(ref cause) => cause,
GetAccountSettingsError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetAliasError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl GetAliasError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetAliasError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(GetAliasError::InvalidParameterValue(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetAliasError::ResourceNotFound(err.msg))
}
"ServiceException" => return RusotoError::Service(GetAliasError::Service(err.msg)),
"TooManyRequestsException" => {
return RusotoError::Service(GetAliasError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetAliasError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetAliasError {
fn description(&self) -> &str {
match *self {
GetAliasError::InvalidParameterValue(ref cause) => cause,
GetAliasError::ResourceNotFound(ref cause) => cause,
GetAliasError::Service(ref cause) => cause,
GetAliasError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetEventSourceMappingError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl GetEventSourceMappingError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetEventSourceMappingError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(GetEventSourceMappingError::InvalidParameterValue(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetEventSourceMappingError::ResourceNotFound(
err.msg,
))
}
"ServiceException" => {
return RusotoError::Service(GetEventSourceMappingError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetEventSourceMappingError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetEventSourceMappingError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetEventSourceMappingError {
fn description(&self) -> &str {
match *self {
GetEventSourceMappingError::InvalidParameterValue(ref cause) => cause,
GetEventSourceMappingError::ResourceNotFound(ref cause) => cause,
GetEventSourceMappingError::Service(ref cause) => cause,
GetEventSourceMappingError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetFunctionError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl GetFunctionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetFunctionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(GetFunctionError::InvalidParameterValue(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetFunctionError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(GetFunctionError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetFunctionError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetFunctionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetFunctionError {
fn description(&self) -> &str {
match *self {
GetFunctionError::InvalidParameterValue(ref cause) => cause,
GetFunctionError::ResourceNotFound(ref cause) => cause,
GetFunctionError::Service(ref cause) => cause,
GetFunctionError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetFunctionConfigurationError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl GetFunctionConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetFunctionConfigurationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(
GetFunctionConfigurationError::InvalidParameterValue(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetFunctionConfigurationError::ResourceNotFound(
err.msg,
))
}
"ServiceException" => {
return RusotoError::Service(GetFunctionConfigurationError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetFunctionConfigurationError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetFunctionConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetFunctionConfigurationError {
fn description(&self) -> &str {
match *self {
GetFunctionConfigurationError::InvalidParameterValue(ref cause) => cause,
GetFunctionConfigurationError::ResourceNotFound(ref cause) => cause,
GetFunctionConfigurationError::Service(ref cause) => cause,
GetFunctionConfigurationError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetLayerVersionError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl GetLayerVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetLayerVersionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(GetLayerVersionError::InvalidParameterValue(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetLayerVersionError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(GetLayerVersionError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetLayerVersionError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetLayerVersionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetLayerVersionError {
fn description(&self) -> &str {
match *self {
GetLayerVersionError::InvalidParameterValue(ref cause) => cause,
GetLayerVersionError::ResourceNotFound(ref cause) => cause,
GetLayerVersionError::Service(ref cause) => cause,
GetLayerVersionError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetLayerVersionByArnError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl GetLayerVersionByArnError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetLayerVersionByArnError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(GetLayerVersionByArnError::InvalidParameterValue(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetLayerVersionByArnError::ResourceNotFound(
err.msg,
))
}
"ServiceException" => {
return RusotoError::Service(GetLayerVersionByArnError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetLayerVersionByArnError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetLayerVersionByArnError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetLayerVersionByArnError {
fn description(&self) -> &str {
match *self {
GetLayerVersionByArnError::InvalidParameterValue(ref cause) => cause,
GetLayerVersionByArnError::ResourceNotFound(ref cause) => cause,
GetLayerVersionByArnError::Service(ref cause) => cause,
GetLayerVersionByArnError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetLayerVersionPolicyError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl GetLayerVersionPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetLayerVersionPolicyError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(GetLayerVersionPolicyError::InvalidParameterValue(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetLayerVersionPolicyError::ResourceNotFound(
err.msg,
))
}
"ServiceException" => {
return RusotoError::Service(GetLayerVersionPolicyError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetLayerVersionPolicyError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetLayerVersionPolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetLayerVersionPolicyError {
fn description(&self) -> &str {
match *self {
GetLayerVersionPolicyError::InvalidParameterValue(ref cause) => cause,
GetLayerVersionPolicyError::ResourceNotFound(ref cause) => cause,
GetLayerVersionPolicyError::Service(ref cause) => cause,
GetLayerVersionPolicyError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetPolicyError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl GetPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetPolicyError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(GetPolicyError::InvalidParameterValue(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetPolicyError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(GetPolicyError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetPolicyError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetPolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetPolicyError {
fn description(&self) -> &str {
match *self {
GetPolicyError::InvalidParameterValue(ref cause) => cause,
GetPolicyError::ResourceNotFound(ref cause) => cause,
GetPolicyError::Service(ref cause) => cause,
GetPolicyError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum InvokeError {
EC2AccessDenied(String),
EC2Throttled(String),
EC2Unexpected(String),
ENILimitReached(String),
InvalidParameterValue(String),
InvalidRequestContent(String),
InvalidRuntime(String),
InvalidSecurityGroupID(String),
InvalidSubnetID(String),
InvalidZipFile(String),
KMSAccessDenied(String),
KMSDisabled(String),
KMSInvalidState(String),
KMSNotFound(String),
RequestTooLarge(String),
ResourceNotFound(String),
Service(String),
SubnetIPAddressLimitReached(String),
TooManyRequests(String),
UnsupportedMediaType(String),
}
impl InvokeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<InvokeError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EC2AccessDeniedException" => {
return RusotoError::Service(InvokeError::EC2AccessDenied(err.msg))
}
"EC2ThrottledException" => {
return RusotoError::Service(InvokeError::EC2Throttled(err.msg))
}
"EC2UnexpectedException" => {
return RusotoError::Service(InvokeError::EC2Unexpected(err.msg))
}
"ENILimitReachedException" => {
return RusotoError::Service(InvokeError::ENILimitReached(err.msg))
}
"InvalidParameterValueException" => {
return RusotoError::Service(InvokeError::InvalidParameterValue(err.msg))
}
"InvalidRequestContentException" => {
return RusotoError::Service(InvokeError::InvalidRequestContent(err.msg))
}
"InvalidRuntimeException" => {
return RusotoError::Service(InvokeError::InvalidRuntime(err.msg))
}
"InvalidSecurityGroupIDException" => {
return RusotoError::Service(InvokeError::InvalidSecurityGroupID(err.msg))
}
"InvalidSubnetIDException" => {
return RusotoError::Service(InvokeError::InvalidSubnetID(err.msg))
}
"InvalidZipFileException" => {
return RusotoError::Service(InvokeError::InvalidZipFile(err.msg))
}
"KMSAccessDeniedException" => {
return RusotoError::Service(InvokeError::KMSAccessDenied(err.msg))
}
"KMSDisabledException" => {
return RusotoError::Service(InvokeError::KMSDisabled(err.msg))
}
"KMSInvalidStateException" => {
return RusotoError::Service(InvokeError::KMSInvalidState(err.msg))
}
"KMSNotFoundException" => {
return RusotoError::Service(InvokeError::KMSNotFound(err.msg))
}
"RequestTooLargeException" => {
return RusotoError::Service(InvokeError::RequestTooLarge(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(InvokeError::ResourceNotFound(err.msg))
}
"ServiceException" => return RusotoError::Service(InvokeError::Service(err.msg)),
"SubnetIPAddressLimitReachedException" => {
return RusotoError::Service(InvokeError::SubnetIPAddressLimitReached(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(InvokeError::TooManyRequests(err.msg))
}
"UnsupportedMediaTypeException" => {
return RusotoError::Service(InvokeError::UnsupportedMediaType(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for InvokeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for InvokeError {
fn description(&self) -> &str {
match *self {
InvokeError::EC2AccessDenied(ref cause) => cause,
InvokeError::EC2Throttled(ref cause) => cause,
InvokeError::EC2Unexpected(ref cause) => cause,
InvokeError::ENILimitReached(ref cause) => cause,
InvokeError::InvalidParameterValue(ref cause) => cause,
InvokeError::InvalidRequestContent(ref cause) => cause,
InvokeError::InvalidRuntime(ref cause) => cause,
InvokeError::InvalidSecurityGroupID(ref cause) => cause,
InvokeError::InvalidSubnetID(ref cause) => cause,
InvokeError::InvalidZipFile(ref cause) => cause,
InvokeError::KMSAccessDenied(ref cause) => cause,
InvokeError::KMSDisabled(ref cause) => cause,
InvokeError::KMSInvalidState(ref cause) => cause,
InvokeError::KMSNotFound(ref cause) => cause,
InvokeError::RequestTooLarge(ref cause) => cause,
InvokeError::ResourceNotFound(ref cause) => cause,
InvokeError::Service(ref cause) => cause,
InvokeError::SubnetIPAddressLimitReached(ref cause) => cause,
InvokeError::TooManyRequests(ref cause) => cause,
InvokeError::UnsupportedMediaType(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum InvokeAsyncError {
InvalidRequestContent(String),
InvalidRuntime(String),
ResourceNotFound(String),
Service(String),
}
impl InvokeAsyncError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<InvokeAsyncError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidRequestContentException" => {
return RusotoError::Service(InvokeAsyncError::InvalidRequestContent(err.msg))
}
"InvalidRuntimeException" => {
return RusotoError::Service(InvokeAsyncError::InvalidRuntime(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(InvokeAsyncError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(InvokeAsyncError::Service(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for InvokeAsyncError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for InvokeAsyncError {
fn description(&self) -> &str {
match *self {
InvokeAsyncError::InvalidRequestContent(ref cause) => cause,
InvokeAsyncError::InvalidRuntime(ref cause) => cause,
InvokeAsyncError::ResourceNotFound(ref cause) => cause,
InvokeAsyncError::Service(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListAliasesError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl ListAliasesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListAliasesError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(ListAliasesError::InvalidParameterValue(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListAliasesError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(ListAliasesError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListAliasesError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListAliasesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListAliasesError {
fn description(&self) -> &str {
match *self {
ListAliasesError::InvalidParameterValue(ref cause) => cause,
ListAliasesError::ResourceNotFound(ref cause) => cause,
ListAliasesError::Service(ref cause) => cause,
ListAliasesError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListEventSourceMappingsError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl ListEventSourceMappingsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListEventSourceMappingsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(
ListEventSourceMappingsError::InvalidParameterValue(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListEventSourceMappingsError::ResourceNotFound(
err.msg,
))
}
"ServiceException" => {
return RusotoError::Service(ListEventSourceMappingsError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListEventSourceMappingsError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListEventSourceMappingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListEventSourceMappingsError {
fn description(&self) -> &str {
match *self {
ListEventSourceMappingsError::InvalidParameterValue(ref cause) => cause,
ListEventSourceMappingsError::ResourceNotFound(ref cause) => cause,
ListEventSourceMappingsError::Service(ref cause) => cause,
ListEventSourceMappingsError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListFunctionsError {
InvalidParameterValue(String),
Service(String),
TooManyRequests(String),
}
impl ListFunctionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListFunctionsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(ListFunctionsError::InvalidParameterValue(err.msg))
}
"ServiceException" => {
return RusotoError::Service(ListFunctionsError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListFunctionsError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListFunctionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListFunctionsError {
fn description(&self) -> &str {
match *self {
ListFunctionsError::InvalidParameterValue(ref cause) => cause,
ListFunctionsError::Service(ref cause) => cause,
ListFunctionsError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListLayerVersionsError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl ListLayerVersionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListLayerVersionsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(ListLayerVersionsError::InvalidParameterValue(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListLayerVersionsError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(ListLayerVersionsError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListLayerVersionsError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListLayerVersionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListLayerVersionsError {
fn description(&self) -> &str {
match *self {
ListLayerVersionsError::InvalidParameterValue(ref cause) => cause,
ListLayerVersionsError::ResourceNotFound(ref cause) => cause,
ListLayerVersionsError::Service(ref cause) => cause,
ListLayerVersionsError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListLayersError {
InvalidParameterValue(String),
Service(String),
TooManyRequests(String),
}
impl ListLayersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListLayersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(ListLayersError::InvalidParameterValue(err.msg))
}
"ServiceException" => {
return RusotoError::Service(ListLayersError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListLayersError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListLayersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListLayersError {
fn description(&self) -> &str {
match *self {
ListLayersError::InvalidParameterValue(ref cause) => cause,
ListLayersError::Service(ref cause) => cause,
ListLayersError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl ListTagsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(ListTagsError::InvalidParameterValue(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListTagsError::ResourceNotFound(err.msg))
}
"ServiceException" => return RusotoError::Service(ListTagsError::Service(err.msg)),
"TooManyRequestsException" => {
return RusotoError::Service(ListTagsError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsError {
fn description(&self) -> &str {
match *self {
ListTagsError::InvalidParameterValue(ref cause) => cause,
ListTagsError::ResourceNotFound(ref cause) => cause,
ListTagsError::Service(ref cause) => cause,
ListTagsError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListVersionsByFunctionError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl ListVersionsByFunctionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListVersionsByFunctionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(
ListVersionsByFunctionError::InvalidParameterValue(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListVersionsByFunctionError::ResourceNotFound(
err.msg,
))
}
"ServiceException" => {
return RusotoError::Service(ListVersionsByFunctionError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListVersionsByFunctionError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListVersionsByFunctionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListVersionsByFunctionError {
fn description(&self) -> &str {
match *self {
ListVersionsByFunctionError::InvalidParameterValue(ref cause) => cause,
ListVersionsByFunctionError::ResourceNotFound(ref cause) => cause,
ListVersionsByFunctionError::Service(ref cause) => cause,
ListVersionsByFunctionError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PublishLayerVersionError {
CodeStorageExceeded(String),
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl PublishLayerVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PublishLayerVersionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"CodeStorageExceededException" => {
return RusotoError::Service(PublishLayerVersionError::CodeStorageExceeded(
err.msg,
))
}
"InvalidParameterValueException" => {
return RusotoError::Service(PublishLayerVersionError::InvalidParameterValue(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(PublishLayerVersionError::ResourceNotFound(
err.msg,
))
}
"ServiceException" => {
return RusotoError::Service(PublishLayerVersionError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(PublishLayerVersionError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PublishLayerVersionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PublishLayerVersionError {
fn description(&self) -> &str {
match *self {
PublishLayerVersionError::CodeStorageExceeded(ref cause) => cause,
PublishLayerVersionError::InvalidParameterValue(ref cause) => cause,
PublishLayerVersionError::ResourceNotFound(ref cause) => cause,
PublishLayerVersionError::Service(ref cause) => cause,
PublishLayerVersionError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PublishVersionError {
CodeStorageExceeded(String),
InvalidParameterValue(String),
PreconditionFailed(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl PublishVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PublishVersionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"CodeStorageExceededException" => {
return RusotoError::Service(PublishVersionError::CodeStorageExceeded(err.msg))
}
"InvalidParameterValueException" => {
return RusotoError::Service(PublishVersionError::InvalidParameterValue(
err.msg,
))
}
"PreconditionFailedException" => {
return RusotoError::Service(PublishVersionError::PreconditionFailed(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(PublishVersionError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(PublishVersionError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(PublishVersionError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PublishVersionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PublishVersionError {
fn description(&self) -> &str {
match *self {
PublishVersionError::CodeStorageExceeded(ref cause) => cause,
PublishVersionError::InvalidParameterValue(ref cause) => cause,
PublishVersionError::PreconditionFailed(ref cause) => cause,
PublishVersionError::ResourceNotFound(ref cause) => cause,
PublishVersionError::Service(ref cause) => cause,
PublishVersionError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutFunctionConcurrencyError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl PutFunctionConcurrencyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutFunctionConcurrencyError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(
PutFunctionConcurrencyError::InvalidParameterValue(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(PutFunctionConcurrencyError::ResourceNotFound(
err.msg,
))
}
"ServiceException" => {
return RusotoError::Service(PutFunctionConcurrencyError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(PutFunctionConcurrencyError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PutFunctionConcurrencyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutFunctionConcurrencyError {
fn description(&self) -> &str {
match *self {
PutFunctionConcurrencyError::InvalidParameterValue(ref cause) => cause,
PutFunctionConcurrencyError::ResourceNotFound(ref cause) => cause,
PutFunctionConcurrencyError::Service(ref cause) => cause,
PutFunctionConcurrencyError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RemoveLayerVersionPermissionError {
InvalidParameterValue(String),
PreconditionFailed(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl RemoveLayerVersionPermissionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<RemoveLayerVersionPermissionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(
RemoveLayerVersionPermissionError::InvalidParameterValue(err.msg),
)
}
"PreconditionFailedException" => {
return RusotoError::Service(
RemoveLayerVersionPermissionError::PreconditionFailed(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
RemoveLayerVersionPermissionError::ResourceNotFound(err.msg),
)
}
"ServiceException" => {
return RusotoError::Service(RemoveLayerVersionPermissionError::Service(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(
RemoveLayerVersionPermissionError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for RemoveLayerVersionPermissionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RemoveLayerVersionPermissionError {
fn description(&self) -> &str {
match *self {
RemoveLayerVersionPermissionError::InvalidParameterValue(ref cause) => cause,
RemoveLayerVersionPermissionError::PreconditionFailed(ref cause) => cause,
RemoveLayerVersionPermissionError::ResourceNotFound(ref cause) => cause,
RemoveLayerVersionPermissionError::Service(ref cause) => cause,
RemoveLayerVersionPermissionError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RemovePermissionError {
InvalidParameterValue(String),
PreconditionFailed(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl RemovePermissionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RemovePermissionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(RemovePermissionError::InvalidParameterValue(
err.msg,
))
}
"PreconditionFailedException" => {
return RusotoError::Service(RemovePermissionError::PreconditionFailed(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(RemovePermissionError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(RemovePermissionError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(RemovePermissionError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for RemovePermissionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RemovePermissionError {
fn description(&self) -> &str {
match *self {
RemovePermissionError::InvalidParameterValue(ref cause) => cause,
RemovePermissionError::PreconditionFailed(ref cause) => cause,
RemovePermissionError::ResourceNotFound(ref cause) => cause,
RemovePermissionError::Service(ref cause) => cause,
RemovePermissionError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
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() {
"InvalidParameterValueException" => {
return RusotoError::Service(TagResourceError::InvalidParameterValue(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(TagResourceError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(TagResourceError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(TagResourceError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for TagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagResourceError {
fn description(&self) -> &str {
match *self {
TagResourceError::InvalidParameterValue(ref cause) => cause,
TagResourceError::ResourceNotFound(ref cause) => cause,
TagResourceError::Service(ref cause) => cause,
TagResourceError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
InvalidParameterValue(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
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() {
"InvalidParameterValueException" => {
return RusotoError::Service(UntagResourceError::InvalidParameterValue(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UntagResourceError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(UntagResourceError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(UntagResourceError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagResourceError {
fn description(&self) -> &str {
match *self {
UntagResourceError::InvalidParameterValue(ref cause) => cause,
UntagResourceError::ResourceNotFound(ref cause) => cause,
UntagResourceError::Service(ref cause) => cause,
UntagResourceError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateAliasError {
InvalidParameterValue(String),
PreconditionFailed(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl UpdateAliasError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateAliasError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(UpdateAliasError::InvalidParameterValue(err.msg))
}
"PreconditionFailedException" => {
return RusotoError::Service(UpdateAliasError::PreconditionFailed(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateAliasError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(UpdateAliasError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(UpdateAliasError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateAliasError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateAliasError {
fn description(&self) -> &str {
match *self {
UpdateAliasError::InvalidParameterValue(ref cause) => cause,
UpdateAliasError::PreconditionFailed(ref cause) => cause,
UpdateAliasError::ResourceNotFound(ref cause) => cause,
UpdateAliasError::Service(ref cause) => cause,
UpdateAliasError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateEventSourceMappingError {
InvalidParameterValue(String),
ResourceConflict(String),
ResourceInUse(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl UpdateEventSourceMappingError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateEventSourceMappingError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(
UpdateEventSourceMappingError::InvalidParameterValue(err.msg),
)
}
"ResourceConflictException" => {
return RusotoError::Service(UpdateEventSourceMappingError::ResourceConflict(
err.msg,
))
}
"ResourceInUseException" => {
return RusotoError::Service(UpdateEventSourceMappingError::ResourceInUse(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateEventSourceMappingError::ResourceNotFound(
err.msg,
))
}
"ServiceException" => {
return RusotoError::Service(UpdateEventSourceMappingError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(UpdateEventSourceMappingError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateEventSourceMappingError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateEventSourceMappingError {
fn description(&self) -> &str {
match *self {
UpdateEventSourceMappingError::InvalidParameterValue(ref cause) => cause,
UpdateEventSourceMappingError::ResourceConflict(ref cause) => cause,
UpdateEventSourceMappingError::ResourceInUse(ref cause) => cause,
UpdateEventSourceMappingError::ResourceNotFound(ref cause) => cause,
UpdateEventSourceMappingError::Service(ref cause) => cause,
UpdateEventSourceMappingError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateFunctionCodeError {
CodeStorageExceeded(String),
InvalidParameterValue(String),
PreconditionFailed(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl UpdateFunctionCodeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateFunctionCodeError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"CodeStorageExceededException" => {
return RusotoError::Service(UpdateFunctionCodeError::CodeStorageExceeded(
err.msg,
))
}
"InvalidParameterValueException" => {
return RusotoError::Service(UpdateFunctionCodeError::InvalidParameterValue(
err.msg,
))
}
"PreconditionFailedException" => {
return RusotoError::Service(UpdateFunctionCodeError::PreconditionFailed(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateFunctionCodeError::ResourceNotFound(err.msg))
}
"ServiceException" => {
return RusotoError::Service(UpdateFunctionCodeError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(UpdateFunctionCodeError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateFunctionCodeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateFunctionCodeError {
fn description(&self) -> &str {
match *self {
UpdateFunctionCodeError::CodeStorageExceeded(ref cause) => cause,
UpdateFunctionCodeError::InvalidParameterValue(ref cause) => cause,
UpdateFunctionCodeError::PreconditionFailed(ref cause) => cause,
UpdateFunctionCodeError::ResourceNotFound(ref cause) => cause,
UpdateFunctionCodeError::Service(ref cause) => cause,
UpdateFunctionCodeError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateFunctionConfigurationError {
InvalidParameterValue(String),
PreconditionFailed(String),
ResourceConflict(String),
ResourceNotFound(String),
Service(String),
TooManyRequests(String),
}
impl UpdateFunctionConfigurationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateFunctionConfigurationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InvalidParameterValueException" => {
return RusotoError::Service(
UpdateFunctionConfigurationError::InvalidParameterValue(err.msg),
)
}
"PreconditionFailedException" => {
return RusotoError::Service(
UpdateFunctionConfigurationError::PreconditionFailed(err.msg),
)
}
"ResourceConflictException" => {
return RusotoError::Service(
UpdateFunctionConfigurationError::ResourceConflict(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
UpdateFunctionConfigurationError::ResourceNotFound(err.msg),
)
}
"ServiceException" => {
return RusotoError::Service(UpdateFunctionConfigurationError::Service(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(UpdateFunctionConfigurationError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateFunctionConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateFunctionConfigurationError {
fn description(&self) -> &str {
match *self {
UpdateFunctionConfigurationError::InvalidParameterValue(ref cause) => cause,
UpdateFunctionConfigurationError::PreconditionFailed(ref cause) => cause,
UpdateFunctionConfigurationError::ResourceConflict(ref cause) => cause,
UpdateFunctionConfigurationError::ResourceNotFound(ref cause) => cause,
UpdateFunctionConfigurationError::Service(ref cause) => cause,
UpdateFunctionConfigurationError::TooManyRequests(ref cause) => cause,
}
}
}
pub trait Lambda {
fn add_layer_version_permission(
&self,
input: AddLayerVersionPermissionRequest,
) -> RusotoFuture<AddLayerVersionPermissionResponse, AddLayerVersionPermissionError>;
fn add_permission(
&self,
input: AddPermissionRequest,
) -> RusotoFuture<AddPermissionResponse, AddPermissionError>;
fn create_alias(
&self,
input: CreateAliasRequest,
) -> RusotoFuture<AliasConfiguration, CreateAliasError>;
fn create_event_source_mapping(
&self,
input: CreateEventSourceMappingRequest,
) -> RusotoFuture<EventSourceMappingConfiguration, CreateEventSourceMappingError>;
fn create_function(
&self,
input: CreateFunctionRequest,
) -> RusotoFuture<FunctionConfiguration, CreateFunctionError>;
fn delete_alias(&self, input: DeleteAliasRequest) -> RusotoFuture<(), DeleteAliasError>;
fn delete_event_source_mapping(
&self,
input: DeleteEventSourceMappingRequest,
) -> RusotoFuture<EventSourceMappingConfiguration, DeleteEventSourceMappingError>;
fn delete_function(
&self,
input: DeleteFunctionRequest,
) -> RusotoFuture<(), DeleteFunctionError>;
fn delete_function_concurrency(
&self,
input: DeleteFunctionConcurrencyRequest,
) -> RusotoFuture<(), DeleteFunctionConcurrencyError>;
fn delete_layer_version(
&self,
input: DeleteLayerVersionRequest,
) -> RusotoFuture<(), DeleteLayerVersionError>;
fn get_account_settings(
&self,
) -> RusotoFuture<GetAccountSettingsResponse, GetAccountSettingsError>;
fn get_alias(&self, input: GetAliasRequest) -> RusotoFuture<AliasConfiguration, GetAliasError>;
fn get_event_source_mapping(
&self,
input: GetEventSourceMappingRequest,
) -> RusotoFuture<EventSourceMappingConfiguration, GetEventSourceMappingError>;
fn get_function(
&self,
input: GetFunctionRequest,
) -> RusotoFuture<GetFunctionResponse, GetFunctionError>;
fn get_function_configuration(
&self,
input: GetFunctionConfigurationRequest,
) -> RusotoFuture<FunctionConfiguration, GetFunctionConfigurationError>;
fn get_layer_version(
&self,
input: GetLayerVersionRequest,
) -> RusotoFuture<GetLayerVersionResponse, GetLayerVersionError>;
fn get_layer_version_by_arn(
&self,
input: GetLayerVersionByArnRequest,
) -> RusotoFuture<GetLayerVersionResponse, GetLayerVersionByArnError>;
fn get_layer_version_policy(
&self,
input: GetLayerVersionPolicyRequest,
) -> RusotoFuture<GetLayerVersionPolicyResponse, GetLayerVersionPolicyError>;
fn get_policy(
&self,
input: GetPolicyRequest,
) -> RusotoFuture<GetPolicyResponse, GetPolicyError>;
fn invoke(&self, input: InvocationRequest) -> RusotoFuture<InvocationResponse, InvokeError>;
fn invoke_async(
&self,
input: InvokeAsyncRequest,
) -> RusotoFuture<InvokeAsyncResponse, InvokeAsyncError>;
fn list_aliases(
&self,
input: ListAliasesRequest,
) -> RusotoFuture<ListAliasesResponse, ListAliasesError>;
fn list_event_source_mappings(
&self,
input: ListEventSourceMappingsRequest,
) -> RusotoFuture<ListEventSourceMappingsResponse, ListEventSourceMappingsError>;
fn list_functions(
&self,
input: ListFunctionsRequest,
) -> RusotoFuture<ListFunctionsResponse, ListFunctionsError>;
fn list_layer_versions(
&self,
input: ListLayerVersionsRequest,
) -> RusotoFuture<ListLayerVersionsResponse, ListLayerVersionsError>;
fn list_layers(
&self,
input: ListLayersRequest,
) -> RusotoFuture<ListLayersResponse, ListLayersError>;
fn list_tags(&self, input: ListTagsRequest) -> RusotoFuture<ListTagsResponse, ListTagsError>;
fn list_versions_by_function(
&self,
input: ListVersionsByFunctionRequest,
) -> RusotoFuture<ListVersionsByFunctionResponse, ListVersionsByFunctionError>;
fn publish_layer_version(
&self,
input: PublishLayerVersionRequest,
) -> RusotoFuture<PublishLayerVersionResponse, PublishLayerVersionError>;
fn publish_version(
&self,
input: PublishVersionRequest,
) -> RusotoFuture<FunctionConfiguration, PublishVersionError>;
fn put_function_concurrency(
&self,
input: PutFunctionConcurrencyRequest,
) -> RusotoFuture<Concurrency, PutFunctionConcurrencyError>;
fn remove_layer_version_permission(
&self,
input: RemoveLayerVersionPermissionRequest,
) -> RusotoFuture<(), RemoveLayerVersionPermissionError>;
fn remove_permission(
&self,
input: RemovePermissionRequest,
) -> RusotoFuture<(), RemovePermissionError>;
fn tag_resource(&self, input: TagResourceRequest) -> RusotoFuture<(), TagResourceError>;
fn untag_resource(&self, input: UntagResourceRequest) -> RusotoFuture<(), UntagResourceError>;
fn update_alias(
&self,
input: UpdateAliasRequest,
) -> RusotoFuture<AliasConfiguration, UpdateAliasError>;
fn update_event_source_mapping(
&self,
input: UpdateEventSourceMappingRequest,
) -> RusotoFuture<EventSourceMappingConfiguration, UpdateEventSourceMappingError>;
fn update_function_code(
&self,
input: UpdateFunctionCodeRequest,
) -> RusotoFuture<FunctionConfiguration, UpdateFunctionCodeError>;
fn update_function_configuration(
&self,
input: UpdateFunctionConfigurationRequest,
) -> RusotoFuture<FunctionConfiguration, UpdateFunctionConfigurationError>;
}
#[derive(Clone)]
pub struct LambdaClient {
client: Client,
region: region::Region,
}
impl LambdaClient {
pub fn new(region: region::Region) -> LambdaClient {
LambdaClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> LambdaClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
LambdaClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl Lambda for LambdaClient {
fn add_layer_version_permission(
&self,
input: AddLayerVersionPermissionRequest,
) -> RusotoFuture<AddLayerVersionPermissionResponse, AddLayerVersionPermissionError> {
let request_uri = format!(
"/2018-10-31/layers/{layer_name}/versions/{version_number}/policy",
layer_name = input.layer_name,
version_number = input.version_number
);
let mut request = SignedRequest::new("POST", "lambda", &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 params = Params::new();
if let Some(ref x) = input.revision_id {
params.put("RevisionId", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 201 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<AddLayerVersionPermissionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(AddLayerVersionPermissionError::from_response(response))
}))
}
})
}
fn add_permission(
&self,
input: AddPermissionRequest,
) -> RusotoFuture<AddPermissionResponse, AddPermissionError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}/policy",
function_name = input.function_name
);
let mut request = SignedRequest::new("POST", "lambda", &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 params = Params::new();
if let Some(ref x) = input.qualifier {
params.put("Qualifier", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 201 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<AddPermissionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AddPermissionError::from_response(response))),
)
}
})
}
fn create_alias(
&self,
input: CreateAliasRequest,
) -> RusotoFuture<AliasConfiguration, CreateAliasError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}/aliases",
function_name = input.function_name
);
let mut request = SignedRequest::new("POST", "lambda", &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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 201 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<AliasConfiguration, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateAliasError::from_response(response))),
)
}
})
}
fn create_event_source_mapping(
&self,
input: CreateEventSourceMappingRequest,
) -> RusotoFuture<EventSourceMappingConfiguration, CreateEventSourceMappingError> {
let request_uri = "/2015-03-31/event-source-mappings/";
let mut request = SignedRequest::new("POST", "lambda", &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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 202 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<EventSourceMappingConfiguration, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateEventSourceMappingError::from_response(response))
}))
}
})
}
fn create_function(
&self,
input: CreateFunctionRequest,
) -> RusotoFuture<FunctionConfiguration, CreateFunctionError> {
let request_uri = "/2015-03-31/functions";
let mut request = SignedRequest::new("POST", "lambda", &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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 201 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<FunctionConfiguration, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateFunctionError::from_response(response))),
)
}
})
}
fn delete_alias(&self, input: DeleteAliasRequest) -> RusotoFuture<(), DeleteAliasError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}/aliases/{name}",
function_name = input.function_name,
name = input.name
);
let mut request = SignedRequest::new("DELETE", "lambda", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteAliasError::from_response(response))),
)
}
})
}
fn delete_event_source_mapping(
&self,
input: DeleteEventSourceMappingRequest,
) -> RusotoFuture<EventSourceMappingConfiguration, DeleteEventSourceMappingError> {
let request_uri = format!(
"/2015-03-31/event-source-mappings/{uuid}",
uuid = input.uuid
);
let mut request = SignedRequest::new("DELETE", "lambda", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 202 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<EventSourceMappingConfiguration, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteEventSourceMappingError::from_response(response))
}))
}
})
}
fn delete_function(
&self,
input: DeleteFunctionRequest,
) -> RusotoFuture<(), DeleteFunctionError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}",
function_name = input.function_name
);
let mut request = SignedRequest::new("DELETE", "lambda", &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.qualifier {
params.put("Qualifier", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteFunctionError::from_response(response))),
)
}
})
}
fn delete_function_concurrency(
&self,
input: DeleteFunctionConcurrencyRequest,
) -> RusotoFuture<(), DeleteFunctionConcurrencyError> {
let request_uri = format!(
"/2017-10-31/functions/{function_name}/concurrency",
function_name = input.function_name
);
let mut request = SignedRequest::new("DELETE", "lambda", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteFunctionConcurrencyError::from_response(response))
}))
}
})
}
fn delete_layer_version(
&self,
input: DeleteLayerVersionRequest,
) -> RusotoFuture<(), DeleteLayerVersionError> {
let request_uri = format!(
"/2018-10-31/layers/{layer_name}/versions/{version_number}",
layer_name = input.layer_name,
version_number = input.version_number
);
let mut request = SignedRequest::new("DELETE", "lambda", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteLayerVersionError::from_response(response))),
)
}
})
}
fn get_account_settings(
&self,
) -> RusotoFuture<GetAccountSettingsResponse, GetAccountSettingsError> {
let request_uri = "/2016-08-19/account-settings/";
let mut request = SignedRequest::new("GET", "lambda", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetAccountSettingsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetAccountSettingsError::from_response(response))),
)
}
})
}
fn get_alias(&self, input: GetAliasRequest) -> RusotoFuture<AliasConfiguration, GetAliasError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}/aliases/{name}",
function_name = input.function_name,
name = input.name
);
let mut request = SignedRequest::new("GET", "lambda", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<AliasConfiguration, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetAliasError::from_response(response))),
)
}
})
}
fn get_event_source_mapping(
&self,
input: GetEventSourceMappingRequest,
) -> RusotoFuture<EventSourceMappingConfiguration, GetEventSourceMappingError> {
let request_uri = format!(
"/2015-03-31/event-source-mappings/{uuid}",
uuid = input.uuid
);
let mut request = SignedRequest::new("GET", "lambda", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<EventSourceMappingConfiguration, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetEventSourceMappingError::from_response(response))
}),
)
}
})
}
fn get_function(
&self,
input: GetFunctionRequest,
) -> RusotoFuture<GetFunctionResponse, GetFunctionError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}",
function_name = input.function_name
);
let mut request = SignedRequest::new("GET", "lambda", &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.qualifier {
params.put("Qualifier", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetFunctionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetFunctionError::from_response(response))),
)
}
})
}
fn get_function_configuration(
&self,
input: GetFunctionConfigurationRequest,
) -> RusotoFuture<FunctionConfiguration, GetFunctionConfigurationError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}/configuration",
function_name = input.function_name
);
let mut request = SignedRequest::new("GET", "lambda", &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.qualifier {
params.put("Qualifier", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<FunctionConfiguration, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetFunctionConfigurationError::from_response(response))
}))
}
})
}
fn get_layer_version(
&self,
input: GetLayerVersionRequest,
) -> RusotoFuture<GetLayerVersionResponse, GetLayerVersionError> {
let request_uri = format!(
"/2018-10-31/layers/{layer_name}/versions/{version_number}",
layer_name = input.layer_name,
version_number = input.version_number
);
let mut request = SignedRequest::new("GET", "lambda", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetLayerVersionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetLayerVersionError::from_response(response))),
)
}
})
}
fn get_layer_version_by_arn(
&self,
input: GetLayerVersionByArnRequest,
) -> RusotoFuture<GetLayerVersionResponse, GetLayerVersionByArnError> {
let request_uri = "/2018-10-31/layers";
let mut request = SignedRequest::new("GET", "lambda", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
params.put("Arn", &input.arn);
params.put("find", "LayerVersion");
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetLayerVersionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetLayerVersionByArnError::from_response(response))
}),
)
}
})
}
fn get_layer_version_policy(
&self,
input: GetLayerVersionPolicyRequest,
) -> RusotoFuture<GetLayerVersionPolicyResponse, GetLayerVersionPolicyError> {
let request_uri = format!(
"/2018-10-31/layers/{layer_name}/versions/{version_number}/policy",
layer_name = input.layer_name,
version_number = input.version_number
);
let mut request = SignedRequest::new("GET", "lambda", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetLayerVersionPolicyResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetLayerVersionPolicyError::from_response(response))
}),
)
}
})
}
fn get_policy(
&self,
input: GetPolicyRequest,
) -> RusotoFuture<GetPolicyResponse, GetPolicyError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}/policy",
function_name = input.function_name
);
let mut request = SignedRequest::new("GET", "lambda", &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.qualifier {
params.put("Qualifier", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetPolicyResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetPolicyError::from_response(response))),
)
}
})
}
fn invoke(&self, input: InvocationRequest) -> RusotoFuture<InvocationResponse, InvokeError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}/invocations",
function_name = input.function_name
);
let mut request = SignedRequest::new("POST", "lambda", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = if let Some(ref payload) = input.payload {
Some(payload.to_owned())
} else {
None
};
request.set_payload(encoded);
if let Some(ref client_context) = input.client_context {
request.add_header("X-Amz-Client-Context", &client_context.to_string());
}
if let Some(ref invocation_type) = input.invocation_type {
request.add_header("X-Amz-Invocation-Type", &invocation_type.to_string());
}
if let Some(ref log_type) = input.log_type {
request.add_header("X-Amz-Log-Type", &log_type.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.qualifier {
params.put("Qualifier", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let mut result = InvocationResponse::default();
result.payload = Some(response.body);
if let Some(executed_version) = response.headers.get("X-Amz-Executed-Version") {
let value = executed_version.to_owned();
result.executed_version = Some(value)
};
if let Some(function_error) = response.headers.get("X-Amz-Function-Error") {
let value = function_error.to_owned();
result.function_error = Some(value)
};
if let Some(log_result) = response.headers.get("X-Amz-Log-Result") {
let value = log_result.to_owned();
result.log_result = Some(value)
};
result.status_code = Some(response.status.as_u16() as i64);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(InvokeError::from_response(response))),
)
}
})
}
fn invoke_async(
&self,
input: InvokeAsyncRequest,
) -> RusotoFuture<InvokeAsyncResponse, InvokeAsyncError> {
let request_uri = format!(
"/2014-11-13/functions/{function_name}/invoke-async/",
function_name = input.function_name
);
let mut request = SignedRequest::new("POST", "lambda", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(input.invoke_args.to_owned());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 202 {
Box::new(response.buffer().from_err().and_then(|response| {
let mut result = proto::json::ResponsePayload::new(&response)
.deserialize::<InvokeAsyncResponse, _>()?;
result.status = Some(response.status.as_u16() as i64);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(InvokeAsyncError::from_response(response))),
)
}
})
}
fn list_aliases(
&self,
input: ListAliasesRequest,
) -> RusotoFuture<ListAliasesResponse, ListAliasesError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}/aliases",
function_name = input.function_name
);
let mut request = SignedRequest::new("GET", "lambda", &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.function_version {
params.put("FunctionVersion", x);
}
if let Some(ref x) = input.marker {
params.put("Marker", x);
}
if let Some(ref x) = input.max_items {
params.put("MaxItems", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListAliasesResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListAliasesError::from_response(response))),
)
}
})
}
fn list_event_source_mappings(
&self,
input: ListEventSourceMappingsRequest,
) -> RusotoFuture<ListEventSourceMappingsResponse, ListEventSourceMappingsError> {
let request_uri = "/2015-03-31/event-source-mappings/";
let mut request = SignedRequest::new("GET", "lambda", &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.event_source_arn {
params.put("EventSourceArn", x);
}
if let Some(ref x) = input.function_name {
params.put("FunctionName", x);
}
if let Some(ref x) = input.marker {
params.put("Marker", x);
}
if let Some(ref x) = input.max_items {
params.put("MaxItems", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListEventSourceMappingsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListEventSourceMappingsError::from_response(response))
}))
}
})
}
fn list_functions(
&self,
input: ListFunctionsRequest,
) -> RusotoFuture<ListFunctionsResponse, ListFunctionsError> {
let request_uri = "/2015-03-31/functions/";
let mut request = SignedRequest::new("GET", "lambda", &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.function_version {
params.put("FunctionVersion", x);
}
if let Some(ref x) = input.marker {
params.put("Marker", x);
}
if let Some(ref x) = input.master_region {
params.put("MasterRegion", x);
}
if let Some(ref x) = input.max_items {
params.put("MaxItems", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListFunctionsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListFunctionsError::from_response(response))),
)
}
})
}
fn list_layer_versions(
&self,
input: ListLayerVersionsRequest,
) -> RusotoFuture<ListLayerVersionsResponse, ListLayerVersionsError> {
let request_uri = format!(
"/2018-10-31/layers/{layer_name}/versions",
layer_name = input.layer_name
);
let mut request = SignedRequest::new("GET", "lambda", &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.compatible_runtime {
params.put("CompatibleRuntime", x);
}
if let Some(ref x) = input.marker {
params.put("Marker", x);
}
if let Some(ref x) = input.max_items {
params.put("MaxItems", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListLayerVersionsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListLayerVersionsError::from_response(response))),
)
}
})
}
fn list_layers(
&self,
input: ListLayersRequest,
) -> RusotoFuture<ListLayersResponse, ListLayersError> {
let request_uri = "/2018-10-31/layers";
let mut request = SignedRequest::new("GET", "lambda", &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.compatible_runtime {
params.put("CompatibleRuntime", x);
}
if let Some(ref x) = input.marker {
params.put("Marker", x);
}
if let Some(ref x) = input.max_items {
params.put("MaxItems", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListLayersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListLayersError::from_response(response))),
)
}
})
}
fn list_tags(&self, input: ListTagsRequest) -> RusotoFuture<ListTagsResponse, ListTagsError> {
let request_uri = format!("/2017-03-31/tags/{arn}", arn = input.resource);
let mut request = SignedRequest::new("GET", "lambda", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListTagsError::from_response(response))),
)
}
})
}
fn list_versions_by_function(
&self,
input: ListVersionsByFunctionRequest,
) -> RusotoFuture<ListVersionsByFunctionResponse, ListVersionsByFunctionError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}/versions",
function_name = input.function_name
);
let mut request = SignedRequest::new("GET", "lambda", &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.marker {
params.put("Marker", x);
}
if let Some(ref x) = input.max_items {
params.put("MaxItems", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListVersionsByFunctionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListVersionsByFunctionError::from_response(response))
}),
)
}
})
}
fn publish_layer_version(
&self,
input: PublishLayerVersionRequest,
) -> RusotoFuture<PublishLayerVersionResponse, PublishLayerVersionError> {
let request_uri = format!(
"/2018-10-31/layers/{layer_name}/versions",
layer_name = input.layer_name
);
let mut request = SignedRequest::new("POST", "lambda", &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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 201 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<PublishLayerVersionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(PublishLayerVersionError::from_response(response))
}),
)
}
})
}
fn publish_version(
&self,
input: PublishVersionRequest,
) -> RusotoFuture<FunctionConfiguration, PublishVersionError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}/versions",
function_name = input.function_name
);
let mut request = SignedRequest::new("POST", "lambda", &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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 201 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<FunctionConfiguration, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(PublishVersionError::from_response(response))),
)
}
})
}
fn put_function_concurrency(
&self,
input: PutFunctionConcurrencyRequest,
) -> RusotoFuture<Concurrency, PutFunctionConcurrencyError> {
let request_uri = format!(
"/2017-10-31/functions/{function_name}/concurrency",
function_name = input.function_name
);
let mut request = SignedRequest::new("PUT", "lambda", &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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<Concurrency, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(PutFunctionConcurrencyError::from_response(response))
}),
)
}
})
}
fn remove_layer_version_permission(
&self,
input: RemoveLayerVersionPermissionRequest,
) -> RusotoFuture<(), RemoveLayerVersionPermissionError> {
let request_uri = format!(
"/2018-10-31/layers/{layer_name}/versions/{version_number}/policy/{statement_id}",
layer_name = input.layer_name,
statement_id = input.statement_id,
version_number = input.version_number
);
let mut request = SignedRequest::new("DELETE", "lambda", &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.revision_id {
params.put("RevisionId", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(RemoveLayerVersionPermissionError::from_response(response))
}))
}
})
}
fn remove_permission(
&self,
input: RemovePermissionRequest,
) -> RusotoFuture<(), RemovePermissionError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}/policy/{statement_id}",
function_name = input.function_name,
statement_id = input.statement_id
);
let mut request = SignedRequest::new("DELETE", "lambda", &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.qualifier {
params.put("Qualifier", x);
}
if let Some(ref x) = input.revision_id {
params.put("RevisionId", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(RemovePermissionError::from_response(response))),
)
}
})
}
fn tag_resource(&self, input: TagResourceRequest) -> RusotoFuture<(), TagResourceError> {
let request_uri = format!("/2017-03-31/tags/{arn}", arn = input.resource);
let mut request = SignedRequest::new("POST", "lambda", &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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TagResourceError::from_response(response))),
)
}
})
}
fn untag_resource(&self, input: UntagResourceRequest) -> RusotoFuture<(), UntagResourceError> {
let request_uri = format!("/2017-03-31/tags/{arn}", arn = input.resource);
let mut request = SignedRequest::new("DELETE", "lambda", &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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UntagResourceError::from_response(response))),
)
}
})
}
fn update_alias(
&self,
input: UpdateAliasRequest,
) -> RusotoFuture<AliasConfiguration, UpdateAliasError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}/aliases/{name}",
function_name = input.function_name,
name = input.name
);
let mut request = SignedRequest::new("PUT", "lambda", &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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<AliasConfiguration, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateAliasError::from_response(response))),
)
}
})
}
fn update_event_source_mapping(
&self,
input: UpdateEventSourceMappingRequest,
) -> RusotoFuture<EventSourceMappingConfiguration, UpdateEventSourceMappingError> {
let request_uri = format!(
"/2015-03-31/event-source-mappings/{uuid}",
uuid = input.uuid
);
let mut request = SignedRequest::new("PUT", "lambda", &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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 202 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<EventSourceMappingConfiguration, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateEventSourceMappingError::from_response(response))
}))
}
})
}
fn update_function_code(
&self,
input: UpdateFunctionCodeRequest,
) -> RusotoFuture<FunctionConfiguration, UpdateFunctionCodeError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}/code",
function_name = input.function_name
);
let mut request = SignedRequest::new("PUT", "lambda", &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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<FunctionConfiguration, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateFunctionCodeError::from_response(response))),
)
}
})
}
fn update_function_configuration(
&self,
input: UpdateFunctionConfigurationRequest,
) -> RusotoFuture<FunctionConfiguration, UpdateFunctionConfigurationError> {
let request_uri = format!(
"/2015-03-31/functions/{function_name}/configuration",
function_name = input.function_name
);
let mut request = SignedRequest::new("PUT", "lambda", &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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<FunctionConfiguration, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateFunctionConfigurationError::from_response(response))
}))
}
})
}
}