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 ApplicationDependencySummary {
#[serde(rename = "ApplicationId")]
pub application_id: String,
#[serde(rename = "SemanticVersion")]
pub semantic_version: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ApplicationPolicyStatement {
#[serde(rename = "Actions")]
pub actions: Vec<String>,
#[serde(rename = "Principals")]
pub principals: Vec<String>,
#[serde(rename = "StatementId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub statement_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ApplicationSummary {
#[serde(rename = "ApplicationId")]
pub application_id: String,
#[serde(rename = "Author")]
pub author: String,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<String>,
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "HomePageUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub home_page_url: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<String>>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "SpdxLicenseId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spdx_license_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateApplicationRequest {
#[serde(rename = "Author")]
pub author: String,
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "HomePageUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub home_page_url: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<String>>,
#[serde(rename = "LicenseBody")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_body: Option<String>,
#[serde(rename = "LicenseUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_url: Option<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "ReadmeBody")]
#[serde(skip_serializing_if = "Option::is_none")]
pub readme_body: Option<String>,
#[serde(rename = "ReadmeUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub readme_url: Option<String>,
#[serde(rename = "SemanticVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub semantic_version: Option<String>,
#[serde(rename = "SourceCodeArchiveUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_code_archive_url: Option<String>,
#[serde(rename = "SourceCodeUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_code_url: Option<String>,
#[serde(rename = "SpdxLicenseId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spdx_license_id: Option<String>,
#[serde(rename = "TemplateBody")]
#[serde(skip_serializing_if = "Option::is_none")]
pub template_body: Option<String>,
#[serde(rename = "TemplateUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub template_url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateApplicationResponse {
#[serde(rename = "ApplicationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub application_id: Option<String>,
#[serde(rename = "Author")]
#[serde(skip_serializing_if = "Option::is_none")]
pub author: Option<String>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HomePageUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub home_page_url: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<String>>,
#[serde(rename = "LicenseUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_url: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "ReadmeUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub readme_url: Option<String>,
#[serde(rename = "SpdxLicenseId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spdx_license_id: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<Version>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateApplicationVersionRequest {
#[serde(rename = "ApplicationId")]
pub application_id: String,
#[serde(rename = "SemanticVersion")]
pub semantic_version: String,
#[serde(rename = "SourceCodeArchiveUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_code_archive_url: Option<String>,
#[serde(rename = "SourceCodeUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_code_url: Option<String>,
#[serde(rename = "TemplateBody")]
#[serde(skip_serializing_if = "Option::is_none")]
pub template_body: Option<String>,
#[serde(rename = "TemplateUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub template_url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateApplicationVersionResponse {
#[serde(rename = "ApplicationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub application_id: Option<String>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<String>,
#[serde(rename = "ParameterDefinitions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_definitions: Option<Vec<ParameterDefinition>>,
#[serde(rename = "RequiredCapabilities")]
#[serde(skip_serializing_if = "Option::is_none")]
pub required_capabilities: Option<Vec<String>>,
#[serde(rename = "ResourcesSupported")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resources_supported: Option<bool>,
#[serde(rename = "SemanticVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub semantic_version: Option<String>,
#[serde(rename = "SourceCodeArchiveUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_code_archive_url: Option<String>,
#[serde(rename = "SourceCodeUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_code_url: Option<String>,
#[serde(rename = "TemplateUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub template_url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateCloudFormationChangeSetRequest {
#[serde(rename = "ApplicationId")]
pub application_id: String,
#[serde(rename = "Capabilities")]
#[serde(skip_serializing_if = "Option::is_none")]
pub capabilities: Option<Vec<String>>,
#[serde(rename = "ChangeSetName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub change_set_name: Option<String>,
#[serde(rename = "ClientToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_token: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "NotificationArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification_arns: Option<Vec<String>>,
#[serde(rename = "ParameterOverrides")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_overrides: Option<Vec<ParameterValue>>,
#[serde(rename = "ResourceTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_types: Option<Vec<String>>,
#[serde(rename = "RollbackConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rollback_configuration: Option<RollbackConfiguration>,
#[serde(rename = "SemanticVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub semantic_version: Option<String>,
#[serde(rename = "StackName")]
pub stack_name: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "TemplateId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub template_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateCloudFormationChangeSetResponse {
#[serde(rename = "ApplicationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub application_id: Option<String>,
#[serde(rename = "ChangeSetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub change_set_id: Option<String>,
#[serde(rename = "SemanticVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub semantic_version: Option<String>,
#[serde(rename = "StackId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stack_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateCloudFormationTemplateRequest {
#[serde(rename = "ApplicationId")]
pub application_id: String,
#[serde(rename = "SemanticVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub semantic_version: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateCloudFormationTemplateResponse {
#[serde(rename = "ApplicationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub application_id: Option<String>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<String>,
#[serde(rename = "ExpirationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expiration_time: Option<String>,
#[serde(rename = "SemanticVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub semantic_version: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "TemplateId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub template_id: Option<String>,
#[serde(rename = "TemplateUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub template_url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteApplicationRequest {
#[serde(rename = "ApplicationId")]
pub application_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetApplicationPolicyRequest {
#[serde(rename = "ApplicationId")]
pub application_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetApplicationPolicyResponse {
#[serde(rename = "Statements")]
#[serde(skip_serializing_if = "Option::is_none")]
pub statements: Option<Vec<ApplicationPolicyStatement>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetApplicationRequest {
#[serde(rename = "ApplicationId")]
pub application_id: String,
#[serde(rename = "SemanticVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub semantic_version: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetApplicationResponse {
#[serde(rename = "ApplicationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub application_id: Option<String>,
#[serde(rename = "Author")]
#[serde(skip_serializing_if = "Option::is_none")]
pub author: Option<String>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HomePageUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub home_page_url: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<String>>,
#[serde(rename = "LicenseUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_url: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "ReadmeUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub readme_url: Option<String>,
#[serde(rename = "SpdxLicenseId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spdx_license_id: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<Version>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetCloudFormationTemplateRequest {
#[serde(rename = "ApplicationId")]
pub application_id: String,
#[serde(rename = "TemplateId")]
pub template_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetCloudFormationTemplateResponse {
#[serde(rename = "ApplicationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub application_id: Option<String>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<String>,
#[serde(rename = "ExpirationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expiration_time: Option<String>,
#[serde(rename = "SemanticVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub semantic_version: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "TemplateId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub template_id: Option<String>,
#[serde(rename = "TemplateUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub template_url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListApplicationDependenciesRequest {
#[serde(rename = "ApplicationId")]
pub application_id: String,
#[serde(rename = "MaxItems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_items: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SemanticVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub semantic_version: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListApplicationDependenciesResponse {
#[serde(rename = "Dependencies")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dependencies: Option<Vec<ApplicationDependencySummary>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListApplicationVersionsRequest {
#[serde(rename = "ApplicationId")]
pub application_id: String,
#[serde(rename = "MaxItems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_items: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListApplicationVersionsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Versions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub versions: Option<Vec<VersionSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListApplicationsRequest {
#[serde(rename = "MaxItems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_items: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListApplicationsResponse {
#[serde(rename = "Applications")]
#[serde(skip_serializing_if = "Option::is_none")]
pub applications: Option<Vec<ApplicationSummary>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ParameterDefinition {
#[serde(rename = "AllowedPattern")]
#[serde(skip_serializing_if = "Option::is_none")]
pub allowed_pattern: Option<String>,
#[serde(rename = "AllowedValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub allowed_values: Option<Vec<String>>,
#[serde(rename = "ConstraintDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub constraint_description: Option<String>,
#[serde(rename = "DefaultValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_value: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "MaxLength")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_length: Option<i64>,
#[serde(rename = "MaxValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_value: Option<i64>,
#[serde(rename = "MinLength")]
#[serde(skip_serializing_if = "Option::is_none")]
pub min_length: Option<i64>,
#[serde(rename = "MinValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub min_value: Option<i64>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "NoEcho")]
#[serde(skip_serializing_if = "Option::is_none")]
pub no_echo: Option<bool>,
#[serde(rename = "ReferencedByResources")]
pub referenced_by_resources: Vec<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ParameterValue {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Value")]
pub value: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutApplicationPolicyRequest {
#[serde(rename = "ApplicationId")]
pub application_id: String,
#[serde(rename = "Statements")]
pub statements: Vec<ApplicationPolicyStatement>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutApplicationPolicyResponse {
#[serde(rename = "Statements")]
#[serde(skip_serializing_if = "Option::is_none")]
pub statements: Option<Vec<ApplicationPolicyStatement>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RollbackConfiguration {
#[serde(rename = "MonitoringTimeInMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub monitoring_time_in_minutes: Option<i64>,
#[serde(rename = "RollbackTriggers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rollback_triggers: Option<Vec<RollbackTrigger>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RollbackTrigger {
#[serde(rename = "Arn")]
pub arn: String,
#[serde(rename = "Type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct Tag {
#[serde(rename = "Key")]
pub key: String,
#[serde(rename = "Value")]
pub value: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateApplicationRequest {
#[serde(rename = "ApplicationId")]
pub application_id: String,
#[serde(rename = "Author")]
#[serde(skip_serializing_if = "Option::is_none")]
pub author: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HomePageUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub home_page_url: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<String>>,
#[serde(rename = "ReadmeBody")]
#[serde(skip_serializing_if = "Option::is_none")]
pub readme_body: Option<String>,
#[serde(rename = "ReadmeUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub readme_url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateApplicationResponse {
#[serde(rename = "ApplicationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub application_id: Option<String>,
#[serde(rename = "Author")]
#[serde(skip_serializing_if = "Option::is_none")]
pub author: Option<String>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HomePageUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub home_page_url: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<String>>,
#[serde(rename = "LicenseUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_url: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "ReadmeUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub readme_url: Option<String>,
#[serde(rename = "SpdxLicenseId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spdx_license_id: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<Version>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Version {
#[serde(rename = "ApplicationId")]
pub application_id: String,
#[serde(rename = "CreationTime")]
pub creation_time: String,
#[serde(rename = "ParameterDefinitions")]
pub parameter_definitions: Vec<ParameterDefinition>,
#[serde(rename = "RequiredCapabilities")]
pub required_capabilities: Vec<String>,
#[serde(rename = "ResourcesSupported")]
pub resources_supported: bool,
#[serde(rename = "SemanticVersion")]
pub semantic_version: String,
#[serde(rename = "SourceCodeArchiveUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_code_archive_url: Option<String>,
#[serde(rename = "SourceCodeUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_code_url: Option<String>,
#[serde(rename = "TemplateUrl")]
pub template_url: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct VersionSummary {
#[serde(rename = "ApplicationId")]
pub application_id: String,
#[serde(rename = "CreationTime")]
pub creation_time: String,
#[serde(rename = "SemanticVersion")]
pub semantic_version: String,
#[serde(rename = "SourceCodeUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_code_url: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum CreateApplicationError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
TooManyRequests(String),
}
impl CreateApplicationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateApplicationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateApplicationError::BadRequest(err.msg))
}
"ConflictException" => {
return RusotoError::Service(CreateApplicationError::Conflict(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(CreateApplicationError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateApplicationError::InternalServerError(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(CreateApplicationError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateApplicationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateApplicationError {
fn description(&self) -> &str {
match *self {
CreateApplicationError::BadRequest(ref cause) => cause,
CreateApplicationError::Conflict(ref cause) => cause,
CreateApplicationError::Forbidden(ref cause) => cause,
CreateApplicationError::InternalServerError(ref cause) => cause,
CreateApplicationError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateApplicationVersionError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
TooManyRequests(String),
}
impl CreateApplicationVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateApplicationVersionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateApplicationVersionError::BadRequest(err.msg))
}
"ConflictException" => {
return RusotoError::Service(CreateApplicationVersionError::Conflict(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(CreateApplicationVersionError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(
CreateApplicationVersionError::InternalServerError(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(CreateApplicationVersionError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateApplicationVersionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateApplicationVersionError {
fn description(&self) -> &str {
match *self {
CreateApplicationVersionError::BadRequest(ref cause) => cause,
CreateApplicationVersionError::Conflict(ref cause) => cause,
CreateApplicationVersionError::Forbidden(ref cause) => cause,
CreateApplicationVersionError::InternalServerError(ref cause) => cause,
CreateApplicationVersionError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateCloudFormationChangeSetError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
TooManyRequests(String),
}
impl CreateCloudFormationChangeSetError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateCloudFormationChangeSetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateCloudFormationChangeSetError::BadRequest(
err.msg,
))
}
"ForbiddenException" => {
return RusotoError::Service(CreateCloudFormationChangeSetError::Forbidden(
err.msg,
))
}
"InternalServerErrorException" => {
return RusotoError::Service(
CreateCloudFormationChangeSetError::InternalServerError(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(
CreateCloudFormationChangeSetError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateCloudFormationChangeSetError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateCloudFormationChangeSetError {
fn description(&self) -> &str {
match *self {
CreateCloudFormationChangeSetError::BadRequest(ref cause) => cause,
CreateCloudFormationChangeSetError::Forbidden(ref cause) => cause,
CreateCloudFormationChangeSetError::InternalServerError(ref cause) => cause,
CreateCloudFormationChangeSetError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateCloudFormationTemplateError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
TooManyRequests(String),
}
impl CreateCloudFormationTemplateError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateCloudFormationTemplateError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateCloudFormationTemplateError::BadRequest(
err.msg,
))
}
"ForbiddenException" => {
return RusotoError::Service(CreateCloudFormationTemplateError::Forbidden(
err.msg,
))
}
"InternalServerErrorException" => {
return RusotoError::Service(
CreateCloudFormationTemplateError::InternalServerError(err.msg),
)
}
"NotFoundException" => {
return RusotoError::Service(CreateCloudFormationTemplateError::NotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(
CreateCloudFormationTemplateError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateCloudFormationTemplateError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateCloudFormationTemplateError {
fn description(&self) -> &str {
match *self {
CreateCloudFormationTemplateError::BadRequest(ref cause) => cause,
CreateCloudFormationTemplateError::Forbidden(ref cause) => cause,
CreateCloudFormationTemplateError::InternalServerError(ref cause) => cause,
CreateCloudFormationTemplateError::NotFound(ref cause) => cause,
CreateCloudFormationTemplateError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteApplicationError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
TooManyRequests(String),
}
impl DeleteApplicationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteApplicationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteApplicationError::BadRequest(err.msg))
}
"ConflictException" => {
return RusotoError::Service(DeleteApplicationError::Conflict(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(DeleteApplicationError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DeleteApplicationError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(DeleteApplicationError::NotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(DeleteApplicationError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteApplicationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteApplicationError {
fn description(&self) -> &str {
match *self {
DeleteApplicationError::BadRequest(ref cause) => cause,
DeleteApplicationError::Conflict(ref cause) => cause,
DeleteApplicationError::Forbidden(ref cause) => cause,
DeleteApplicationError::InternalServerError(ref cause) => cause,
DeleteApplicationError::NotFound(ref cause) => cause,
DeleteApplicationError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetApplicationError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
TooManyRequests(String),
}
impl GetApplicationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetApplicationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetApplicationError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(GetApplicationError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(GetApplicationError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(GetApplicationError::NotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetApplicationError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetApplicationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetApplicationError {
fn description(&self) -> &str {
match *self {
GetApplicationError::BadRequest(ref cause) => cause,
GetApplicationError::Forbidden(ref cause) => cause,
GetApplicationError::InternalServerError(ref cause) => cause,
GetApplicationError::NotFound(ref cause) => cause,
GetApplicationError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetApplicationPolicyError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
TooManyRequests(String),
}
impl GetApplicationPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetApplicationPolicyError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetApplicationPolicyError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(GetApplicationPolicyError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(GetApplicationPolicyError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(GetApplicationPolicyError::NotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetApplicationPolicyError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetApplicationPolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetApplicationPolicyError {
fn description(&self) -> &str {
match *self {
GetApplicationPolicyError::BadRequest(ref cause) => cause,
GetApplicationPolicyError::Forbidden(ref cause) => cause,
GetApplicationPolicyError::InternalServerError(ref cause) => cause,
GetApplicationPolicyError::NotFound(ref cause) => cause,
GetApplicationPolicyError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetCloudFormationTemplateError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
TooManyRequests(String),
}
impl GetCloudFormationTemplateError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetCloudFormationTemplateError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetCloudFormationTemplateError::BadRequest(
err.msg,
))
}
"ForbiddenException" => {
return RusotoError::Service(GetCloudFormationTemplateError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(
GetCloudFormationTemplateError::InternalServerError(err.msg),
)
}
"NotFoundException" => {
return RusotoError::Service(GetCloudFormationTemplateError::NotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetCloudFormationTemplateError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetCloudFormationTemplateError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetCloudFormationTemplateError {
fn description(&self) -> &str {
match *self {
GetCloudFormationTemplateError::BadRequest(ref cause) => cause,
GetCloudFormationTemplateError::Forbidden(ref cause) => cause,
GetCloudFormationTemplateError::InternalServerError(ref cause) => cause,
GetCloudFormationTemplateError::NotFound(ref cause) => cause,
GetCloudFormationTemplateError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListApplicationDependenciesError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
TooManyRequests(String),
}
impl ListApplicationDependenciesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListApplicationDependenciesError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListApplicationDependenciesError::BadRequest(
err.msg,
))
}
"ForbiddenException" => {
return RusotoError::Service(ListApplicationDependenciesError::Forbidden(
err.msg,
))
}
"InternalServerErrorException" => {
return RusotoError::Service(
ListApplicationDependenciesError::InternalServerError(err.msg),
)
}
"NotFoundException" => {
return RusotoError::Service(ListApplicationDependenciesError::NotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListApplicationDependenciesError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListApplicationDependenciesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListApplicationDependenciesError {
fn description(&self) -> &str {
match *self {
ListApplicationDependenciesError::BadRequest(ref cause) => cause,
ListApplicationDependenciesError::Forbidden(ref cause) => cause,
ListApplicationDependenciesError::InternalServerError(ref cause) => cause,
ListApplicationDependenciesError::NotFound(ref cause) => cause,
ListApplicationDependenciesError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListApplicationVersionsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
TooManyRequests(String),
}
impl ListApplicationVersionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListApplicationVersionsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListApplicationVersionsError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(ListApplicationVersionsError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListApplicationVersionsError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(ListApplicationVersionsError::NotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListApplicationVersionsError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListApplicationVersionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListApplicationVersionsError {
fn description(&self) -> &str {
match *self {
ListApplicationVersionsError::BadRequest(ref cause) => cause,
ListApplicationVersionsError::Forbidden(ref cause) => cause,
ListApplicationVersionsError::InternalServerError(ref cause) => cause,
ListApplicationVersionsError::NotFound(ref cause) => cause,
ListApplicationVersionsError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListApplicationsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl ListApplicationsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListApplicationsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListApplicationsError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(ListApplicationsError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListApplicationsError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(ListApplicationsError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListApplicationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListApplicationsError {
fn description(&self) -> &str {
match *self {
ListApplicationsError::BadRequest(ref cause) => cause,
ListApplicationsError::Forbidden(ref cause) => cause,
ListApplicationsError::InternalServerError(ref cause) => cause,
ListApplicationsError::NotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutApplicationPolicyError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
TooManyRequests(String),
}
impl PutApplicationPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutApplicationPolicyError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(PutApplicationPolicyError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(PutApplicationPolicyError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(PutApplicationPolicyError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(PutApplicationPolicyError::NotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(PutApplicationPolicyError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PutApplicationPolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutApplicationPolicyError {
fn description(&self) -> &str {
match *self {
PutApplicationPolicyError::BadRequest(ref cause) => cause,
PutApplicationPolicyError::Forbidden(ref cause) => cause,
PutApplicationPolicyError::InternalServerError(ref cause) => cause,
PutApplicationPolicyError::NotFound(ref cause) => cause,
PutApplicationPolicyError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateApplicationError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
TooManyRequests(String),
}
impl UpdateApplicationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateApplicationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateApplicationError::BadRequest(err.msg))
}
"ConflictException" => {
return RusotoError::Service(UpdateApplicationError::Conflict(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(UpdateApplicationError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(UpdateApplicationError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(UpdateApplicationError::NotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(UpdateApplicationError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateApplicationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateApplicationError {
fn description(&self) -> &str {
match *self {
UpdateApplicationError::BadRequest(ref cause) => cause,
UpdateApplicationError::Conflict(ref cause) => cause,
UpdateApplicationError::Forbidden(ref cause) => cause,
UpdateApplicationError::InternalServerError(ref cause) => cause,
UpdateApplicationError::NotFound(ref cause) => cause,
UpdateApplicationError::TooManyRequests(ref cause) => cause,
}
}
}
pub trait ServerlessRepo {
fn create_application(
&self,
input: CreateApplicationRequest,
) -> RusotoFuture<CreateApplicationResponse, CreateApplicationError>;
fn create_application_version(
&self,
input: CreateApplicationVersionRequest,
) -> RusotoFuture<CreateApplicationVersionResponse, CreateApplicationVersionError>;
fn create_cloud_formation_change_set(
&self,
input: CreateCloudFormationChangeSetRequest,
) -> RusotoFuture<CreateCloudFormationChangeSetResponse, CreateCloudFormationChangeSetError>;
fn create_cloud_formation_template(
&self,
input: CreateCloudFormationTemplateRequest,
) -> RusotoFuture<CreateCloudFormationTemplateResponse, CreateCloudFormationTemplateError>;
fn delete_application(
&self,
input: DeleteApplicationRequest,
) -> RusotoFuture<(), DeleteApplicationError>;
fn get_application(
&self,
input: GetApplicationRequest,
) -> RusotoFuture<GetApplicationResponse, GetApplicationError>;
fn get_application_policy(
&self,
input: GetApplicationPolicyRequest,
) -> RusotoFuture<GetApplicationPolicyResponse, GetApplicationPolicyError>;
fn get_cloud_formation_template(
&self,
input: GetCloudFormationTemplateRequest,
) -> RusotoFuture<GetCloudFormationTemplateResponse, GetCloudFormationTemplateError>;
fn list_application_dependencies(
&self,
input: ListApplicationDependenciesRequest,
) -> RusotoFuture<ListApplicationDependenciesResponse, ListApplicationDependenciesError>;
fn list_application_versions(
&self,
input: ListApplicationVersionsRequest,
) -> RusotoFuture<ListApplicationVersionsResponse, ListApplicationVersionsError>;
fn list_applications(
&self,
input: ListApplicationsRequest,
) -> RusotoFuture<ListApplicationsResponse, ListApplicationsError>;
fn put_application_policy(
&self,
input: PutApplicationPolicyRequest,
) -> RusotoFuture<PutApplicationPolicyResponse, PutApplicationPolicyError>;
fn update_application(
&self,
input: UpdateApplicationRequest,
) -> RusotoFuture<UpdateApplicationResponse, UpdateApplicationError>;
}
#[derive(Clone)]
pub struct ServerlessRepoClient {
client: Client,
region: region::Region,
}
impl ServerlessRepoClient {
pub fn new(region: region::Region) -> ServerlessRepoClient {
ServerlessRepoClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> ServerlessRepoClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
ServerlessRepoClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl ServerlessRepo for ServerlessRepoClient {
fn create_application(
&self,
input: CreateApplicationRequest,
) -> RusotoFuture<CreateApplicationResponse, CreateApplicationError> {
let request_uri = "/applications";
let mut request = SignedRequest::new("POST", "serverlessrepo", &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::<CreateApplicationResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateApplicationError::from_response(response))),
)
}
})
}
fn create_application_version(
&self,
input: CreateApplicationVersionRequest,
) -> RusotoFuture<CreateApplicationVersionResponse, CreateApplicationVersionError> {
let request_uri = format!(
"/applications/{application_id}/versions/{semantic_version}",
application_id = input.application_id,
semantic_version = input.semantic_version
);
let mut request = SignedRequest::new("PUT", "serverlessrepo", &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::<CreateApplicationVersionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateApplicationVersionError::from_response(response))
}))
}
})
}
fn create_cloud_formation_change_set(
&self,
input: CreateCloudFormationChangeSetRequest,
) -> RusotoFuture<CreateCloudFormationChangeSetResponse, CreateCloudFormationChangeSetError>
{
let request_uri = format!(
"/applications/{application_id}/changesets",
application_id = input.application_id
);
let mut request = SignedRequest::new("POST", "serverlessrepo", &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::<CreateCloudFormationChangeSetResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateCloudFormationChangeSetError::from_response(response))
}))
}
})
}
fn create_cloud_formation_template(
&self,
input: CreateCloudFormationTemplateRequest,
) -> RusotoFuture<CreateCloudFormationTemplateResponse, CreateCloudFormationTemplateError> {
let request_uri = format!(
"/applications/{application_id}/templates",
application_id = input.application_id
);
let mut request = SignedRequest::new("POST", "serverlessrepo", &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::<CreateCloudFormationTemplateResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateCloudFormationTemplateError::from_response(response))
}))
}
})
}
fn delete_application(
&self,
input: DeleteApplicationRequest,
) -> RusotoFuture<(), DeleteApplicationError> {
let request_uri = format!(
"/applications/{application_id}",
application_id = input.application_id
);
let mut request =
SignedRequest::new("DELETE", "serverlessrepo", &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(DeleteApplicationError::from_response(response))),
)
}
})
}
fn get_application(
&self,
input: GetApplicationRequest,
) -> RusotoFuture<GetApplicationResponse, GetApplicationError> {
let request_uri = format!(
"/applications/{application_id}",
application_id = input.application_id
);
let mut request = SignedRequest::new("GET", "serverlessrepo", &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.semantic_version {
params.put("semanticVersion", 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::<GetApplicationResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetApplicationError::from_response(response))),
)
}
})
}
fn get_application_policy(
&self,
input: GetApplicationPolicyRequest,
) -> RusotoFuture<GetApplicationPolicyResponse, GetApplicationPolicyError> {
let request_uri = format!(
"/applications/{application_id}/policy",
application_id = input.application_id
);
let mut request = SignedRequest::new("GET", "serverlessrepo", &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::<GetApplicationPolicyResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetApplicationPolicyError::from_response(response))
}),
)
}
})
}
fn get_cloud_formation_template(
&self,
input: GetCloudFormationTemplateRequest,
) -> RusotoFuture<GetCloudFormationTemplateResponse, GetCloudFormationTemplateError> {
let request_uri = format!(
"/applications/{application_id}/templates/{template_id}",
application_id = input.application_id,
template_id = input.template_id
);
let mut request = SignedRequest::new("GET", "serverlessrepo", &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::<GetCloudFormationTemplateResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetCloudFormationTemplateError::from_response(response))
}))
}
})
}
fn list_application_dependencies(
&self,
input: ListApplicationDependenciesRequest,
) -> RusotoFuture<ListApplicationDependenciesResponse, ListApplicationDependenciesError> {
let request_uri = format!(
"/applications/{application_id}/dependencies",
application_id = input.application_id
);
let mut request = SignedRequest::new("GET", "serverlessrepo", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_items {
params.put("maxItems", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
if let Some(ref x) = input.semantic_version {
params.put("semanticVersion", 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::<ListApplicationDependenciesResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListApplicationDependenciesError::from_response(response))
}))
}
})
}
fn list_application_versions(
&self,
input: ListApplicationVersionsRequest,
) -> RusotoFuture<ListApplicationVersionsResponse, ListApplicationVersionsError> {
let request_uri = format!(
"/applications/{application_id}/versions",
application_id = input.application_id
);
let mut request = SignedRequest::new("GET", "serverlessrepo", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_items {
params.put("maxItems", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", 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::<ListApplicationVersionsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListApplicationVersionsError::from_response(response))
}))
}
})
}
fn list_applications(
&self,
input: ListApplicationsRequest,
) -> RusotoFuture<ListApplicationsResponse, ListApplicationsError> {
let request_uri = "/applications";
let mut request = SignedRequest::new("GET", "serverlessrepo", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_items {
params.put("maxItems", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", 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::<ListApplicationsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListApplicationsError::from_response(response))),
)
}
})
}
fn put_application_policy(
&self,
input: PutApplicationPolicyRequest,
) -> RusotoFuture<PutApplicationPolicyResponse, PutApplicationPolicyError> {
let request_uri = format!(
"/applications/{application_id}/policy",
application_id = input.application_id
);
let mut request = SignedRequest::new("PUT", "serverlessrepo", &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::<PutApplicationPolicyResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(PutApplicationPolicyError::from_response(response))
}),
)
}
})
}
fn update_application(
&self,
input: UpdateApplicationRequest,
) -> RusotoFuture<UpdateApplicationResponse, UpdateApplicationError> {
let request_uri = format!(
"/applications/{application_id}",
application_id = input.application_id
);
let mut request = SignedRequest::new("PATCH", "serverlessrepo", &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::<UpdateApplicationResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateApplicationError::from_response(response))),
)
}
})
}
}