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 App {
#[serde(rename = "appArn")]
pub app_arn: String,
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "basicAuthCredentials")]
#[serde(skip_serializing_if = "Option::is_none")]
pub basic_auth_credentials: Option<String>,
#[serde(rename = "buildSpec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub build_spec: Option<String>,
#[serde(rename = "createTime")]
pub create_time: f64,
#[serde(rename = "customRules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_rules: Option<Vec<CustomRule>>,
#[serde(rename = "defaultDomain")]
pub default_domain: String,
#[serde(rename = "description")]
pub description: String,
#[serde(rename = "enableBasicAuth")]
pub enable_basic_auth: bool,
#[serde(rename = "enableBranchAutoBuild")]
pub enable_branch_auto_build: bool,
#[serde(rename = "environmentVariables")]
pub environment_variables: ::std::collections::HashMap<String, String>,
#[serde(rename = "iamServiceRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub iam_service_role_arn: Option<String>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "platform")]
pub platform: String,
#[serde(rename = "productionBranch")]
#[serde(skip_serializing_if = "Option::is_none")]
pub production_branch: Option<ProductionBranch>,
#[serde(rename = "repository")]
pub repository: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "updateTime")]
pub update_time: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Branch {
#[serde(rename = "activeJobId")]
pub active_job_id: String,
#[serde(rename = "basicAuthCredentials")]
#[serde(skip_serializing_if = "Option::is_none")]
pub basic_auth_credentials: Option<String>,
#[serde(rename = "branchArn")]
pub branch_arn: String,
#[serde(rename = "branchName")]
pub branch_name: String,
#[serde(rename = "buildSpec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub build_spec: Option<String>,
#[serde(rename = "createTime")]
pub create_time: f64,
#[serde(rename = "customDomains")]
pub custom_domains: Vec<String>,
#[serde(rename = "description")]
pub description: String,
#[serde(rename = "displayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[serde(rename = "enableAutoBuild")]
pub enable_auto_build: bool,
#[serde(rename = "enableBasicAuth")]
pub enable_basic_auth: bool,
#[serde(rename = "enableNotification")]
pub enable_notification: bool,
#[serde(rename = "environmentVariables")]
pub environment_variables: ::std::collections::HashMap<String, String>,
#[serde(rename = "framework")]
pub framework: String,
#[serde(rename = "stage")]
pub stage: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "thumbnailUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub thumbnail_url: Option<String>,
#[serde(rename = "totalNumberOfJobs")]
pub total_number_of_jobs: String,
#[serde(rename = "ttl")]
pub ttl: String,
#[serde(rename = "updateTime")]
pub update_time: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateAppRequest {
#[serde(rename = "basicAuthCredentials")]
#[serde(skip_serializing_if = "Option::is_none")]
pub basic_auth_credentials: Option<String>,
#[serde(rename = "buildSpec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub build_spec: Option<String>,
#[serde(rename = "customRules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_rules: Option<Vec<CustomRule>>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "enableBasicAuth")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_basic_auth: Option<bool>,
#[serde(rename = "enableBranchAutoBuild")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_branch_auto_build: Option<bool>,
#[serde(rename = "environmentVariables")]
#[serde(skip_serializing_if = "Option::is_none")]
pub environment_variables: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "iamServiceRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub iam_service_role_arn: Option<String>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "oauthToken")]
pub oauth_token: String,
#[serde(rename = "platform")]
pub platform: String,
#[serde(rename = "repository")]
pub repository: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateAppResult {
#[serde(rename = "app")]
pub app: App,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateBranchRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "basicAuthCredentials")]
#[serde(skip_serializing_if = "Option::is_none")]
pub basic_auth_credentials: Option<String>,
#[serde(rename = "branchName")]
pub branch_name: String,
#[serde(rename = "buildSpec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub build_spec: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "enableAutoBuild")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_auto_build: Option<bool>,
#[serde(rename = "enableBasicAuth")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_basic_auth: Option<bool>,
#[serde(rename = "enableNotification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_notification: Option<bool>,
#[serde(rename = "environmentVariables")]
#[serde(skip_serializing_if = "Option::is_none")]
pub environment_variables: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "framework")]
#[serde(skip_serializing_if = "Option::is_none")]
pub framework: Option<String>,
#[serde(rename = "stage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stage: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "ttl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ttl: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateBranchResult {
#[serde(rename = "branch")]
pub branch: Branch,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateDomainAssociationRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "domainName")]
pub domain_name: String,
#[serde(rename = "enableAutoSubDomain")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_auto_sub_domain: Option<bool>,
#[serde(rename = "subDomainSettings")]
pub sub_domain_settings: Vec<SubDomainSetting>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateDomainAssociationResult {
#[serde(rename = "domainAssociation")]
pub domain_association: DomainAssociation,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CustomRule {
#[serde(rename = "condition")]
#[serde(skip_serializing_if = "Option::is_none")]
pub condition: Option<String>,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "target")]
pub target: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteAppRequest {
#[serde(rename = "appId")]
pub app_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteAppResult {
#[serde(rename = "app")]
pub app: App,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteBranchRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "branchName")]
pub branch_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteBranchResult {
#[serde(rename = "branch")]
pub branch: Branch,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteDomainAssociationRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "domainName")]
pub domain_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteDomainAssociationResult {
#[serde(rename = "domainAssociation")]
pub domain_association: DomainAssociation,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteJobRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "branchName")]
pub branch_name: String,
#[serde(rename = "jobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteJobResult {
#[serde(rename = "jobSummary")]
pub job_summary: JobSummary,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DomainAssociation {
#[serde(rename = "certificateVerificationDNSRecord")]
pub certificate_verification_dns_record: String,
#[serde(rename = "domainAssociationArn")]
pub domain_association_arn: String,
#[serde(rename = "domainName")]
pub domain_name: String,
#[serde(rename = "domainStatus")]
pub domain_status: String,
#[serde(rename = "enableAutoSubDomain")]
pub enable_auto_sub_domain: bool,
#[serde(rename = "statusReason")]
pub status_reason: String,
#[serde(rename = "subDomains")]
pub sub_domains: Vec<SubDomain>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetAppRequest {
#[serde(rename = "appId")]
pub app_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetAppResult {
#[serde(rename = "app")]
pub app: App,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetBranchRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "branchName")]
pub branch_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetBranchResult {
#[serde(rename = "branch")]
pub branch: Branch,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDomainAssociationRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "domainName")]
pub domain_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDomainAssociationResult {
#[serde(rename = "domainAssociation")]
pub domain_association: DomainAssociation,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetJobRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "branchName")]
pub branch_name: String,
#[serde(rename = "jobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetJobResult {
#[serde(rename = "job")]
pub job: Job,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Job {
#[serde(rename = "steps")]
pub steps: Vec<Step>,
#[serde(rename = "summary")]
pub summary: JobSummary,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct JobSummary {
#[serde(rename = "commitId")]
pub commit_id: String,
#[serde(rename = "commitMessage")]
pub commit_message: String,
#[serde(rename = "commitTime")]
pub commit_time: f64,
#[serde(rename = "endTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "jobArn")]
pub job_arn: String,
#[serde(rename = "jobId")]
pub job_id: String,
#[serde(rename = "jobType")]
pub job_type: String,
#[serde(rename = "startTime")]
pub start_time: f64,
#[serde(rename = "status")]
pub status: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListAppsRequest {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListAppsResult {
#[serde(rename = "apps")]
pub apps: Vec<App>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListBranchesRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListBranchesResult {
#[serde(rename = "branches")]
pub branches: Vec<Branch>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListDomainAssociationsRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListDomainAssociationsResult {
#[serde(rename = "domainAssociations")]
pub domain_associations: Vec<DomainAssociation>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListJobsRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "branchName")]
pub branch_name: String,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListJobsResult {
#[serde(rename = "jobSummaries")]
pub job_summaries: Vec<JobSummary>,
#[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 ProductionBranch {
#[serde(rename = "branchName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub branch_name: Option<String>,
#[serde(rename = "lastDeployTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_deploy_time: Option<f64>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "thumbnailUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub thumbnail_url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartJobRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "branchName")]
pub branch_name: String,
#[serde(rename = "commitId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub commit_id: Option<String>,
#[serde(rename = "commitMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub commit_message: Option<String>,
#[serde(rename = "commitTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub commit_time: Option<f64>,
#[serde(rename = "jobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "jobReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_reason: Option<String>,
#[serde(rename = "jobType")]
pub job_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StartJobResult {
#[serde(rename = "jobSummary")]
pub job_summary: JobSummary,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Step {
#[serde(rename = "artifactsUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub artifacts_url: Option<String>,
#[serde(rename = "endTime")]
pub end_time: f64,
#[serde(rename = "logUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_url: Option<String>,
#[serde(rename = "screenshots")]
#[serde(skip_serializing_if = "Option::is_none")]
pub screenshots: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "startTime")]
pub start_time: f64,
#[serde(rename = "status")]
pub status: String,
#[serde(rename = "stepName")]
pub step_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopJobRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "branchName")]
pub branch_name: String,
#[serde(rename = "jobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StopJobResult {
#[serde(rename = "jobSummary")]
pub job_summary: JobSummary,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SubDomain {
#[serde(rename = "dnsRecord")]
pub dns_record: String,
#[serde(rename = "subDomainSetting")]
pub sub_domain_setting: SubDomainSetting,
#[serde(rename = "verified")]
pub verified: bool,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SubDomainSetting {
#[serde(rename = "branchName")]
pub branch_name: String,
#[serde(rename = "prefix")]
pub prefix: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateAppRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "basicAuthCredentials")]
#[serde(skip_serializing_if = "Option::is_none")]
pub basic_auth_credentials: Option<String>,
#[serde(rename = "buildSpec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub build_spec: Option<String>,
#[serde(rename = "customRules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_rules: Option<Vec<CustomRule>>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "enableBasicAuth")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_basic_auth: Option<bool>,
#[serde(rename = "enableBranchAutoBuild")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_branch_auto_build: Option<bool>,
#[serde(rename = "environmentVariables")]
#[serde(skip_serializing_if = "Option::is_none")]
pub environment_variables: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "iamServiceRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub iam_service_role_arn: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "platform")]
#[serde(skip_serializing_if = "Option::is_none")]
pub platform: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateAppResult {
#[serde(rename = "app")]
pub app: App,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateBranchRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "basicAuthCredentials")]
#[serde(skip_serializing_if = "Option::is_none")]
pub basic_auth_credentials: Option<String>,
#[serde(rename = "branchName")]
pub branch_name: String,
#[serde(rename = "buildSpec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub build_spec: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "enableAutoBuild")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_auto_build: Option<bool>,
#[serde(rename = "enableBasicAuth")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_basic_auth: Option<bool>,
#[serde(rename = "enableNotification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_notification: Option<bool>,
#[serde(rename = "environmentVariables")]
#[serde(skip_serializing_if = "Option::is_none")]
pub environment_variables: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "framework")]
#[serde(skip_serializing_if = "Option::is_none")]
pub framework: Option<String>,
#[serde(rename = "stage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stage: Option<String>,
#[serde(rename = "ttl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ttl: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateBranchResult {
#[serde(rename = "branch")]
pub branch: Branch,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateDomainAssociationRequest {
#[serde(rename = "appId")]
pub app_id: String,
#[serde(rename = "domainName")]
pub domain_name: String,
#[serde(rename = "enableAutoSubDomain")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_auto_sub_domain: Option<bool>,
#[serde(rename = "subDomainSettings")]
pub sub_domain_settings: Vec<SubDomainSetting>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateDomainAssociationResult {
#[serde(rename = "domainAssociation")]
pub domain_association: DomainAssociation,
}
#[derive(Debug, PartialEq)]
pub enum CreateAppError {
BadRequest(String),
DependentServiceFailure(String),
InternalFailure(String),
LimitExceeded(String),
Unauthorized(String),
}
impl CreateAppError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateAppError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateAppError::BadRequest(err.msg))
}
"DependentServiceFailureException" => {
return RusotoError::Service(CreateAppError::DependentServiceFailure(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(CreateAppError::InternalFailure(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateAppError::LimitExceeded(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(CreateAppError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateAppError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateAppError {
fn description(&self) -> &str {
match *self {
CreateAppError::BadRequest(ref cause) => cause,
CreateAppError::DependentServiceFailure(ref cause) => cause,
CreateAppError::InternalFailure(ref cause) => cause,
CreateAppError::LimitExceeded(ref cause) => cause,
CreateAppError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateBranchError {
BadRequest(String),
DependentServiceFailure(String),
InternalFailure(String),
LimitExceeded(String),
NotFound(String),
Unauthorized(String),
}
impl CreateBranchError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateBranchError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateBranchError::BadRequest(err.msg))
}
"DependentServiceFailureException" => {
return RusotoError::Service(CreateBranchError::DependentServiceFailure(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(CreateBranchError::InternalFailure(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateBranchError::LimitExceeded(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(CreateBranchError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(CreateBranchError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateBranchError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateBranchError {
fn description(&self) -> &str {
match *self {
CreateBranchError::BadRequest(ref cause) => cause,
CreateBranchError::DependentServiceFailure(ref cause) => cause,
CreateBranchError::InternalFailure(ref cause) => cause,
CreateBranchError::LimitExceeded(ref cause) => cause,
CreateBranchError::NotFound(ref cause) => cause,
CreateBranchError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateDomainAssociationError {
BadRequest(String),
DependentServiceFailure(String),
InternalFailure(String),
LimitExceeded(String),
NotFound(String),
Unauthorized(String),
}
impl CreateDomainAssociationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateDomainAssociationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateDomainAssociationError::BadRequest(err.msg))
}
"DependentServiceFailureException" => {
return RusotoError::Service(
CreateDomainAssociationError::DependentServiceFailure(err.msg),
)
}
"InternalFailureException" => {
return RusotoError::Service(CreateDomainAssociationError::InternalFailure(
err.msg,
))
}
"LimitExceededException" => {
return RusotoError::Service(CreateDomainAssociationError::LimitExceeded(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(CreateDomainAssociationError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(CreateDomainAssociationError::Unauthorized(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateDomainAssociationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateDomainAssociationError {
fn description(&self) -> &str {
match *self {
CreateDomainAssociationError::BadRequest(ref cause) => cause,
CreateDomainAssociationError::DependentServiceFailure(ref cause) => cause,
CreateDomainAssociationError::InternalFailure(ref cause) => cause,
CreateDomainAssociationError::LimitExceeded(ref cause) => cause,
CreateDomainAssociationError::NotFound(ref cause) => cause,
CreateDomainAssociationError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteAppError {
BadRequest(String),
DependentServiceFailure(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl DeleteAppError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteAppError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteAppError::BadRequest(err.msg))
}
"DependentServiceFailureException" => {
return RusotoError::Service(DeleteAppError::DependentServiceFailure(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(DeleteAppError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DeleteAppError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(DeleteAppError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteAppError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteAppError {
fn description(&self) -> &str {
match *self {
DeleteAppError::BadRequest(ref cause) => cause,
DeleteAppError::DependentServiceFailure(ref cause) => cause,
DeleteAppError::InternalFailure(ref cause) => cause,
DeleteAppError::NotFound(ref cause) => cause,
DeleteAppError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteBranchError {
BadRequest(String),
DependentServiceFailure(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl DeleteBranchError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteBranchError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteBranchError::BadRequest(err.msg))
}
"DependentServiceFailureException" => {
return RusotoError::Service(DeleteBranchError::DependentServiceFailure(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(DeleteBranchError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DeleteBranchError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(DeleteBranchError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteBranchError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteBranchError {
fn description(&self) -> &str {
match *self {
DeleteBranchError::BadRequest(ref cause) => cause,
DeleteBranchError::DependentServiceFailure(ref cause) => cause,
DeleteBranchError::InternalFailure(ref cause) => cause,
DeleteBranchError::NotFound(ref cause) => cause,
DeleteBranchError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteDomainAssociationError {
BadRequest(String),
DependentServiceFailure(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl DeleteDomainAssociationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDomainAssociationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteDomainAssociationError::BadRequest(err.msg))
}
"DependentServiceFailureException" => {
return RusotoError::Service(
DeleteDomainAssociationError::DependentServiceFailure(err.msg),
)
}
"InternalFailureException" => {
return RusotoError::Service(DeleteDomainAssociationError::InternalFailure(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(DeleteDomainAssociationError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(DeleteDomainAssociationError::Unauthorized(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteDomainAssociationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteDomainAssociationError {
fn description(&self) -> &str {
match *self {
DeleteDomainAssociationError::BadRequest(ref cause) => cause,
DeleteDomainAssociationError::DependentServiceFailure(ref cause) => cause,
DeleteDomainAssociationError::InternalFailure(ref cause) => cause,
DeleteDomainAssociationError::NotFound(ref cause) => cause,
DeleteDomainAssociationError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteJobError {
BadRequest(String),
InternalFailure(String),
LimitExceeded(String),
NotFound(String),
Unauthorized(String),
}
impl DeleteJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteJobError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteJobError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(DeleteJobError::InternalFailure(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(DeleteJobError::LimitExceeded(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DeleteJobError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(DeleteJobError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteJobError {
fn description(&self) -> &str {
match *self {
DeleteJobError::BadRequest(ref cause) => cause,
DeleteJobError::InternalFailure(ref cause) => cause,
DeleteJobError::LimitExceeded(ref cause) => cause,
DeleteJobError::NotFound(ref cause) => cause,
DeleteJobError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetAppError {
BadRequest(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl GetAppError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetAppError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetAppError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(GetAppError::InternalFailure(err.msg))
}
"NotFoundException" => return RusotoError::Service(GetAppError::NotFound(err.msg)),
"UnauthorizedException" => {
return RusotoError::Service(GetAppError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetAppError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetAppError {
fn description(&self) -> &str {
match *self {
GetAppError::BadRequest(ref cause) => cause,
GetAppError::InternalFailure(ref cause) => cause,
GetAppError::NotFound(ref cause) => cause,
GetAppError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetBranchError {
BadRequest(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl GetBranchError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetBranchError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetBranchError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(GetBranchError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(GetBranchError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(GetBranchError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetBranchError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetBranchError {
fn description(&self) -> &str {
match *self {
GetBranchError::BadRequest(ref cause) => cause,
GetBranchError::InternalFailure(ref cause) => cause,
GetBranchError::NotFound(ref cause) => cause,
GetBranchError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDomainAssociationError {
BadRequest(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl GetDomainAssociationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDomainAssociationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetDomainAssociationError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(GetDomainAssociationError::InternalFailure(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(GetDomainAssociationError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(GetDomainAssociationError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetDomainAssociationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDomainAssociationError {
fn description(&self) -> &str {
match *self {
GetDomainAssociationError::BadRequest(ref cause) => cause,
GetDomainAssociationError::InternalFailure(ref cause) => cause,
GetDomainAssociationError::NotFound(ref cause) => cause,
GetDomainAssociationError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetJobError {
BadRequest(String),
InternalFailure(String),
LimitExceeded(String),
NotFound(String),
Unauthorized(String),
}
impl GetJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetJobError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetJobError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(GetJobError::InternalFailure(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(GetJobError::LimitExceeded(err.msg))
}
"NotFoundException" => return RusotoError::Service(GetJobError::NotFound(err.msg)),
"UnauthorizedException" => {
return RusotoError::Service(GetJobError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetJobError {
fn description(&self) -> &str {
match *self {
GetJobError::BadRequest(ref cause) => cause,
GetJobError::InternalFailure(ref cause) => cause,
GetJobError::LimitExceeded(ref cause) => cause,
GetJobError::NotFound(ref cause) => cause,
GetJobError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListAppsError {
BadRequest(String),
InternalFailure(String),
Unauthorized(String),
}
impl ListAppsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListAppsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListAppsError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(ListAppsError::InternalFailure(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(ListAppsError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListAppsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListAppsError {
fn description(&self) -> &str {
match *self {
ListAppsError::BadRequest(ref cause) => cause,
ListAppsError::InternalFailure(ref cause) => cause,
ListAppsError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListBranchesError {
BadRequest(String),
InternalFailure(String),
Unauthorized(String),
}
impl ListBranchesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListBranchesError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListBranchesError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(ListBranchesError::InternalFailure(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(ListBranchesError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListBranchesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListBranchesError {
fn description(&self) -> &str {
match *self {
ListBranchesError::BadRequest(ref cause) => cause,
ListBranchesError::InternalFailure(ref cause) => cause,
ListBranchesError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListDomainAssociationsError {
BadRequest(String),
InternalFailure(String),
Unauthorized(String),
}
impl ListDomainAssociationsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListDomainAssociationsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListDomainAssociationsError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(ListDomainAssociationsError::InternalFailure(
err.msg,
))
}
"UnauthorizedException" => {
return RusotoError::Service(ListDomainAssociationsError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListDomainAssociationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListDomainAssociationsError {
fn description(&self) -> &str {
match *self {
ListDomainAssociationsError::BadRequest(ref cause) => cause,
ListDomainAssociationsError::InternalFailure(ref cause) => cause,
ListDomainAssociationsError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListJobsError {
BadRequest(String),
InternalFailure(String),
LimitExceeded(String),
Unauthorized(String),
}
impl ListJobsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListJobsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListJobsError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(ListJobsError::InternalFailure(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(ListJobsError::LimitExceeded(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(ListJobsError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListJobsError {
fn description(&self) -> &str {
match *self {
ListJobsError::BadRequest(ref cause) => cause,
ListJobsError::InternalFailure(ref cause) => cause,
ListJobsError::LimitExceeded(ref cause) => cause,
ListJobsError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartJobError {
BadRequest(String),
InternalFailure(String),
LimitExceeded(String),
NotFound(String),
Unauthorized(String),
}
impl StartJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartJobError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(StartJobError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(StartJobError::InternalFailure(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(StartJobError::LimitExceeded(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(StartJobError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(StartJobError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartJobError {
fn description(&self) -> &str {
match *self {
StartJobError::BadRequest(ref cause) => cause,
StartJobError::InternalFailure(ref cause) => cause,
StartJobError::LimitExceeded(ref cause) => cause,
StartJobError::NotFound(ref cause) => cause,
StartJobError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopJobError {
BadRequest(String),
InternalFailure(String),
LimitExceeded(String),
NotFound(String),
Unauthorized(String),
}
impl StopJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StopJobError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(StopJobError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(StopJobError::InternalFailure(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(StopJobError::LimitExceeded(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(StopJobError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(StopJobError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StopJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopJobError {
fn description(&self) -> &str {
match *self {
StopJobError::BadRequest(ref cause) => cause,
StopJobError::InternalFailure(ref cause) => cause,
StopJobError::LimitExceeded(ref cause) => cause,
StopJobError::NotFound(ref cause) => cause,
StopJobError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateAppError {
BadRequest(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl UpdateAppError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateAppError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateAppError::BadRequest(err.msg))
}
"InternalFailureException" => {
return RusotoError::Service(UpdateAppError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(UpdateAppError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(UpdateAppError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateAppError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateAppError {
fn description(&self) -> &str {
match *self {
UpdateAppError::BadRequest(ref cause) => cause,
UpdateAppError::InternalFailure(ref cause) => cause,
UpdateAppError::NotFound(ref cause) => cause,
UpdateAppError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateBranchError {
BadRequest(String),
DependentServiceFailure(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl UpdateBranchError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateBranchError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateBranchError::BadRequest(err.msg))
}
"DependentServiceFailureException" => {
return RusotoError::Service(UpdateBranchError::DependentServiceFailure(
err.msg,
))
}
"InternalFailureException" => {
return RusotoError::Service(UpdateBranchError::InternalFailure(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(UpdateBranchError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(UpdateBranchError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateBranchError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateBranchError {
fn description(&self) -> &str {
match *self {
UpdateBranchError::BadRequest(ref cause) => cause,
UpdateBranchError::DependentServiceFailure(ref cause) => cause,
UpdateBranchError::InternalFailure(ref cause) => cause,
UpdateBranchError::NotFound(ref cause) => cause,
UpdateBranchError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateDomainAssociationError {
BadRequest(String),
DependentServiceFailure(String),
InternalFailure(String),
NotFound(String),
Unauthorized(String),
}
impl UpdateDomainAssociationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateDomainAssociationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateDomainAssociationError::BadRequest(err.msg))
}
"DependentServiceFailureException" => {
return RusotoError::Service(
UpdateDomainAssociationError::DependentServiceFailure(err.msg),
)
}
"InternalFailureException" => {
return RusotoError::Service(UpdateDomainAssociationError::InternalFailure(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(UpdateDomainAssociationError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(UpdateDomainAssociationError::Unauthorized(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateDomainAssociationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateDomainAssociationError {
fn description(&self) -> &str {
match *self {
UpdateDomainAssociationError::BadRequest(ref cause) => cause,
UpdateDomainAssociationError::DependentServiceFailure(ref cause) => cause,
UpdateDomainAssociationError::InternalFailure(ref cause) => cause,
UpdateDomainAssociationError::NotFound(ref cause) => cause,
UpdateDomainAssociationError::Unauthorized(ref cause) => cause,
}
}
}
pub trait Amplify {
fn create_app(&self, input: CreateAppRequest) -> RusotoFuture<CreateAppResult, CreateAppError>;
fn create_branch(
&self,
input: CreateBranchRequest,
) -> RusotoFuture<CreateBranchResult, CreateBranchError>;
fn create_domain_association(
&self,
input: CreateDomainAssociationRequest,
) -> RusotoFuture<CreateDomainAssociationResult, CreateDomainAssociationError>;
fn delete_app(&self, input: DeleteAppRequest) -> RusotoFuture<DeleteAppResult, DeleteAppError>;
fn delete_branch(
&self,
input: DeleteBranchRequest,
) -> RusotoFuture<DeleteBranchResult, DeleteBranchError>;
fn delete_domain_association(
&self,
input: DeleteDomainAssociationRequest,
) -> RusotoFuture<DeleteDomainAssociationResult, DeleteDomainAssociationError>;
fn delete_job(&self, input: DeleteJobRequest) -> RusotoFuture<DeleteJobResult, DeleteJobError>;
fn get_app(&self, input: GetAppRequest) -> RusotoFuture<GetAppResult, GetAppError>;
fn get_branch(&self, input: GetBranchRequest) -> RusotoFuture<GetBranchResult, GetBranchError>;
fn get_domain_association(
&self,
input: GetDomainAssociationRequest,
) -> RusotoFuture<GetDomainAssociationResult, GetDomainAssociationError>;
fn get_job(&self, input: GetJobRequest) -> RusotoFuture<GetJobResult, GetJobError>;
fn list_apps(&self, input: ListAppsRequest) -> RusotoFuture<ListAppsResult, ListAppsError>;
fn list_branches(
&self,
input: ListBranchesRequest,
) -> RusotoFuture<ListBranchesResult, ListBranchesError>;
fn list_domain_associations(
&self,
input: ListDomainAssociationsRequest,
) -> RusotoFuture<ListDomainAssociationsResult, ListDomainAssociationsError>;
fn list_jobs(&self, input: ListJobsRequest) -> RusotoFuture<ListJobsResult, ListJobsError>;
fn start_job(&self, input: StartJobRequest) -> RusotoFuture<StartJobResult, StartJobError>;
fn stop_job(&self, input: StopJobRequest) -> RusotoFuture<StopJobResult, StopJobError>;
fn update_app(&self, input: UpdateAppRequest) -> RusotoFuture<UpdateAppResult, UpdateAppError>;
fn update_branch(
&self,
input: UpdateBranchRequest,
) -> RusotoFuture<UpdateBranchResult, UpdateBranchError>;
fn update_domain_association(
&self,
input: UpdateDomainAssociationRequest,
) -> RusotoFuture<UpdateDomainAssociationResult, UpdateDomainAssociationError>;
}
#[derive(Clone)]
pub struct AmplifyClient {
client: Client,
region: region::Region,
}
impl AmplifyClient {
pub fn new(region: region::Region) -> AmplifyClient {
AmplifyClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> AmplifyClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
AmplifyClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl Amplify for AmplifyClient {
fn create_app(&self, input: CreateAppRequest) -> RusotoFuture<CreateAppResult, CreateAppError> {
let request_uri = "/apps";
let mut request = SignedRequest::new("POST", "amplify", &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.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateAppResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateAppError::from_response(response))),
)
}
})
}
fn create_branch(
&self,
input: CreateBranchRequest,
) -> RusotoFuture<CreateBranchResult, CreateBranchError> {
let request_uri = format!("/apps/{app_id}/branches", app_id = input.app_id);
let mut request = SignedRequest::new("POST", "amplify", &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.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateBranchResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateBranchError::from_response(response))),
)
}
})
}
fn create_domain_association(
&self,
input: CreateDomainAssociationRequest,
) -> RusotoFuture<CreateDomainAssociationResult, CreateDomainAssociationError> {
let request_uri = format!("/apps/{app_id}/domains", app_id = input.app_id);
let mut request = SignedRequest::new("POST", "amplify", &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.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateDomainAssociationResult, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateDomainAssociationError::from_response(response))
}))
}
})
}
fn delete_app(&self, input: DeleteAppRequest) -> RusotoFuture<DeleteAppResult, DeleteAppError> {
let request_uri = format!("/apps/{app_id}", app_id = input.app_id);
let mut request = SignedRequest::new("DELETE", "amplify", &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::<DeleteAppResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteAppError::from_response(response))),
)
}
})
}
fn delete_branch(
&self,
input: DeleteBranchRequest,
) -> RusotoFuture<DeleteBranchResult, DeleteBranchError> {
let request_uri = format!(
"/apps/{app_id}/branches/{branch_name}",
app_id = input.app_id,
branch_name = input.branch_name
);
let mut request = SignedRequest::new("DELETE", "amplify", &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::<DeleteBranchResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteBranchError::from_response(response))),
)
}
})
}
fn delete_domain_association(
&self,
input: DeleteDomainAssociationRequest,
) -> RusotoFuture<DeleteDomainAssociationResult, DeleteDomainAssociationError> {
let request_uri = format!(
"/apps/{app_id}/domains/{domain_name}",
app_id = input.app_id,
domain_name = input.domain_name
);
let mut request = SignedRequest::new("DELETE", "amplify", &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::<DeleteDomainAssociationResult, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteDomainAssociationError::from_response(response))
}))
}
})
}
fn delete_job(&self, input: DeleteJobRequest) -> RusotoFuture<DeleteJobResult, DeleteJobError> {
let request_uri = format!(
"/apps/{app_id}/branches/{branch_name}/jobs/{job_id}",
app_id = input.app_id,
branch_name = input.branch_name,
job_id = input.job_id
);
let mut request = SignedRequest::new("DELETE", "amplify", &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::<DeleteJobResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteJobError::from_response(response))),
)
}
})
}
fn get_app(&self, input: GetAppRequest) -> RusotoFuture<GetAppResult, GetAppError> {
let request_uri = format!("/apps/{app_id}", app_id = input.app_id);
let mut request = SignedRequest::new("GET", "amplify", &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::<GetAppResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetAppError::from_response(response))),
)
}
})
}
fn get_branch(&self, input: GetBranchRequest) -> RusotoFuture<GetBranchResult, GetBranchError> {
let request_uri = format!(
"/apps/{app_id}/branches/{branch_name}",
app_id = input.app_id,
branch_name = input.branch_name
);
let mut request = SignedRequest::new("GET", "amplify", &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::<GetBranchResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetBranchError::from_response(response))),
)
}
})
}
fn get_domain_association(
&self,
input: GetDomainAssociationRequest,
) -> RusotoFuture<GetDomainAssociationResult, GetDomainAssociationError> {
let request_uri = format!(
"/apps/{app_id}/domains/{domain_name}",
app_id = input.app_id,
domain_name = input.domain_name
);
let mut request = SignedRequest::new("GET", "amplify", &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::<GetDomainAssociationResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetDomainAssociationError::from_response(response))
}),
)
}
})
}
fn get_job(&self, input: GetJobRequest) -> RusotoFuture<GetJobResult, GetJobError> {
let request_uri = format!(
"/apps/{app_id}/branches/{branch_name}/jobs/{job_id}",
app_id = input.app_id,
branch_name = input.branch_name,
job_id = input.job_id
);
let mut request = SignedRequest::new("GET", "amplify", &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::<GetJobResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetJobError::from_response(response))),
)
}
})
}
fn list_apps(&self, input: ListAppsRequest) -> RusotoFuture<ListAppsResult, ListAppsError> {
let request_uri = "/apps";
let mut request = SignedRequest::new("GET", "amplify", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
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::<ListAppsResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListAppsError::from_response(response))),
)
}
})
}
fn list_branches(
&self,
input: ListBranchesRequest,
) -> RusotoFuture<ListBranchesResult, ListBranchesError> {
let request_uri = format!("/apps/{app_id}/branches", app_id = input.app_id);
let mut request = SignedRequest::new("GET", "amplify", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
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::<ListBranchesResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListBranchesError::from_response(response))),
)
}
})
}
fn list_domain_associations(
&self,
input: ListDomainAssociationsRequest,
) -> RusotoFuture<ListDomainAssociationsResult, ListDomainAssociationsError> {
let request_uri = format!("/apps/{app_id}/domains", app_id = input.app_id);
let mut request = SignedRequest::new("GET", "amplify", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
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::<ListDomainAssociationsResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListDomainAssociationsError::from_response(response))
}),
)
}
})
}
fn list_jobs(&self, input: ListJobsRequest) -> RusotoFuture<ListJobsResult, ListJobsError> {
let request_uri = format!(
"/apps/{app_id}/branches/{branch_name}/jobs",
app_id = input.app_id,
branch_name = input.branch_name
);
let mut request = SignedRequest::new("GET", "amplify", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
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::<ListJobsResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListJobsError::from_response(response))),
)
}
})
}
fn start_job(&self, input: StartJobRequest) -> RusotoFuture<StartJobResult, StartJobError> {
let request_uri = format!(
"/apps/{app_id}/branches/{branch_name}/jobs",
app_id = input.app_id,
branch_name = input.branch_name
);
let mut request = SignedRequest::new("POST", "amplify", &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.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<StartJobResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StartJobError::from_response(response))),
)
}
})
}
fn stop_job(&self, input: StopJobRequest) -> RusotoFuture<StopJobResult, StopJobError> {
let request_uri = format!(
"/apps/{app_id}/branches/{branch_name}/jobs/{job_id}/stop",
app_id = input.app_id,
branch_name = input.branch_name,
job_id = input.job_id
);
let mut request = SignedRequest::new("DELETE", "amplify", &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::<StopJobResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StopJobError::from_response(response))),
)
}
})
}
fn update_app(&self, input: UpdateAppRequest) -> RusotoFuture<UpdateAppResult, UpdateAppError> {
let request_uri = format!("/apps/{app_id}", app_id = input.app_id);
let mut request = SignedRequest::new("POST", "amplify", &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.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateAppResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateAppError::from_response(response))),
)
}
})
}
fn update_branch(
&self,
input: UpdateBranchRequest,
) -> RusotoFuture<UpdateBranchResult, UpdateBranchError> {
let request_uri = format!(
"/apps/{app_id}/branches/{branch_name}",
app_id = input.app_id,
branch_name = input.branch_name
);
let mut request = SignedRequest::new("POST", "amplify", &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.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateBranchResult, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateBranchError::from_response(response))),
)
}
})
}
fn update_domain_association(
&self,
input: UpdateDomainAssociationRequest,
) -> RusotoFuture<UpdateDomainAssociationResult, UpdateDomainAssociationError> {
let request_uri = format!(
"/apps/{app_id}/domains/{domain_name}",
app_id = input.app_id,
domain_name = input.domain_name
);
let mut request = SignedRequest::new("POST", "amplify", &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.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateDomainAssociationResult, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateDomainAssociationError::from_response(response))
}))
}
})
}
}