use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AssociateTeamMemberRequest {
#[serde(rename = "clientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "projectId")]
pub project_id: String,
#[serde(rename = "projectRole")]
pub project_role: String,
#[serde(rename = "remoteAccessAllowed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_access_allowed: Option<bool>,
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssociateTeamMemberResult {
#[serde(rename = "clientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct Code {
#[serde(rename = "destination")]
pub destination: CodeDestination,
#[serde(rename = "source")]
pub source: CodeSource,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CodeCommitCodeDestination {
#[serde(rename = "name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CodeDestination {
#[serde(rename = "codeCommit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code_commit: Option<CodeCommitCodeDestination>,
#[serde(rename = "gitHub")]
#[serde(skip_serializing_if = "Option::is_none")]
pub git_hub: Option<GitHubCodeDestination>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CodeSource {
#[serde(rename = "s3")]
pub s_3: S3Location,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateProjectRequest {
#[serde(rename = "clientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "sourceCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_code: Option<Vec<Code>>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "toolchain")]
#[serde(skip_serializing_if = "Option::is_none")]
pub toolchain: Option<Toolchain>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateProjectResult {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "clientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "projectTemplateId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub project_template_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateUserProfileRequest {
#[serde(rename = "displayName")]
pub display_name: String,
#[serde(rename = "emailAddress")]
pub email_address: String,
#[serde(rename = "sshPublicKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ssh_public_key: Option<String>,
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateUserProfileResult {
#[serde(rename = "createdTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_timestamp: Option<f64>,
#[serde(rename = "displayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[serde(rename = "emailAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email_address: Option<String>,
#[serde(rename = "lastModifiedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_timestamp: Option<f64>,
#[serde(rename = "sshPublicKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ssh_public_key: Option<String>,
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteProjectRequest {
#[serde(rename = "clientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "deleteStack")]
#[serde(skip_serializing_if = "Option::is_none")]
pub delete_stack: Option<bool>,
#[serde(rename = "id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteProjectResult {
#[serde(rename = "projectArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub project_arn: 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 DeleteUserProfileRequest {
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteUserProfileResult {
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeProjectRequest {
#[serde(rename = "id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeProjectResult {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "clientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "createdTimeStamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time_stamp: Option<f64>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "projectTemplateId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub project_template_id: Option<String>,
#[serde(rename = "stackId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stack_id: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<ProjectStatus>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeUserProfileRequest {
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeUserProfileResult {
#[serde(rename = "createdTimestamp")]
pub created_timestamp: f64,
#[serde(rename = "displayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[serde(rename = "emailAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email_address: Option<String>,
#[serde(rename = "lastModifiedTimestamp")]
pub last_modified_timestamp: f64,
#[serde(rename = "sshPublicKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ssh_public_key: Option<String>,
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DisassociateTeamMemberRequest {
#[serde(rename = "projectId")]
pub project_id: String,
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DisassociateTeamMemberResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GitHubCodeDestination {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "issuesEnabled")]
pub issues_enabled: bool,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "owner")]
pub owner: String,
#[serde(rename = "privateRepository")]
pub private_repository: bool,
#[serde(rename = "token")]
pub token: String,
#[serde(rename = "type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListProjectsRequest {
#[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 ListProjectsResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "projects")]
pub projects: Vec<ProjectSummary>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListResourcesRequest {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "projectId")]
pub project_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListResourcesResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "resources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resources: Option<Vec<Resource>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsForProjectRequest {
#[serde(rename = "id")]
pub 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 ListTagsForProjectResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTeamMembersRequest {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "projectId")]
pub project_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTeamMembersResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "teamMembers")]
pub team_members: Vec<TeamMember>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListUserProfilesRequest {
#[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 ListUserProfilesResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "userProfiles")]
pub user_profiles: Vec<UserProfileSummary>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProjectStatus {
#[serde(rename = "reason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reason: Option<String>,
#[serde(rename = "state")]
pub state: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProjectSummary {
#[serde(rename = "projectArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub project_arn: Option<String>,
#[serde(rename = "projectId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub project_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Resource {
#[serde(rename = "id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct S3Location {
#[serde(rename = "bucketKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bucket_key: Option<String>,
#[serde(rename = "bucketName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bucket_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TagProjectRequest {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "tags")]
pub tags: ::std::collections::HashMap<String, String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TagProjectResult {
#[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 TeamMember {
#[serde(rename = "projectRole")]
pub project_role: String,
#[serde(rename = "remoteAccessAllowed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_access_allowed: Option<bool>,
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct Toolchain {
#[serde(rename = "roleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
#[serde(rename = "source")]
pub source: ToolchainSource,
#[serde(rename = "stackParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stack_parameters: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ToolchainSource {
#[serde(rename = "s3")]
pub s_3: S3Location,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UntagProjectRequest {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "tags")]
pub tags: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UntagProjectResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateProjectRequest {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateProjectResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateTeamMemberRequest {
#[serde(rename = "projectId")]
pub project_id: String,
#[serde(rename = "projectRole")]
#[serde(skip_serializing_if = "Option::is_none")]
pub project_role: Option<String>,
#[serde(rename = "remoteAccessAllowed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_access_allowed: Option<bool>,
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateTeamMemberResult {
#[serde(rename = "projectRole")]
#[serde(skip_serializing_if = "Option::is_none")]
pub project_role: Option<String>,
#[serde(rename = "remoteAccessAllowed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_access_allowed: Option<bool>,
#[serde(rename = "userArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateUserProfileRequest {
#[serde(rename = "displayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[serde(rename = "emailAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email_address: Option<String>,
#[serde(rename = "sshPublicKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ssh_public_key: Option<String>,
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateUserProfileResult {
#[serde(rename = "createdTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_timestamp: Option<f64>,
#[serde(rename = "displayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[serde(rename = "emailAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email_address: Option<String>,
#[serde(rename = "lastModifiedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_timestamp: Option<f64>,
#[serde(rename = "sshPublicKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ssh_public_key: Option<String>,
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UserProfileSummary {
#[serde(rename = "displayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[serde(rename = "emailAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email_address: Option<String>,
#[serde(rename = "sshPublicKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ssh_public_key: Option<String>,
#[serde(rename = "userArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_arn: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum AssociateTeamMemberError {
ConcurrentModification(String),
InvalidServiceRole(String),
LimitExceeded(String),
ProjectConfiguration(String),
ProjectNotFound(String),
TeamMemberAlreadyAssociated(String),
}
impl AssociateTeamMemberError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AssociateTeamMemberError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(AssociateTeamMemberError::ConcurrentModification(
err.msg,
))
}
"InvalidServiceRoleException" => {
return RusotoError::Service(AssociateTeamMemberError::InvalidServiceRole(
err.msg,
))
}
"LimitExceededException" => {
return RusotoError::Service(AssociateTeamMemberError::LimitExceeded(err.msg))
}
"ProjectConfigurationException" => {
return RusotoError::Service(AssociateTeamMemberError::ProjectConfiguration(
err.msg,
))
}
"ProjectNotFoundException" => {
return RusotoError::Service(AssociateTeamMemberError::ProjectNotFound(err.msg))
}
"TeamMemberAlreadyAssociatedException" => {
return RusotoError::Service(
AssociateTeamMemberError::TeamMemberAlreadyAssociated(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AssociateTeamMemberError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AssociateTeamMemberError {
fn description(&self) -> &str {
match *self {
AssociateTeamMemberError::ConcurrentModification(ref cause) => cause,
AssociateTeamMemberError::InvalidServiceRole(ref cause) => cause,
AssociateTeamMemberError::LimitExceeded(ref cause) => cause,
AssociateTeamMemberError::ProjectConfiguration(ref cause) => cause,
AssociateTeamMemberError::ProjectNotFound(ref cause) => cause,
AssociateTeamMemberError::TeamMemberAlreadyAssociated(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateProjectError {
ConcurrentModification(String),
InvalidServiceRole(String),
LimitExceeded(String),
ProjectAlreadyExists(String),
ProjectConfiguration(String),
ProjectCreationFailed(String),
}
impl CreateProjectError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateProjectError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(CreateProjectError::ConcurrentModification(
err.msg,
))
}
"InvalidServiceRoleException" => {
return RusotoError::Service(CreateProjectError::InvalidServiceRole(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateProjectError::LimitExceeded(err.msg))
}
"ProjectAlreadyExistsException" => {
return RusotoError::Service(CreateProjectError::ProjectAlreadyExists(err.msg))
}
"ProjectConfigurationException" => {
return RusotoError::Service(CreateProjectError::ProjectConfiguration(err.msg))
}
"ProjectCreationFailedException" => {
return RusotoError::Service(CreateProjectError::ProjectCreationFailed(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateProjectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateProjectError {
fn description(&self) -> &str {
match *self {
CreateProjectError::ConcurrentModification(ref cause) => cause,
CreateProjectError::InvalidServiceRole(ref cause) => cause,
CreateProjectError::LimitExceeded(ref cause) => cause,
CreateProjectError::ProjectAlreadyExists(ref cause) => cause,
CreateProjectError::ProjectConfiguration(ref cause) => cause,
CreateProjectError::ProjectCreationFailed(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateUserProfileError {
UserProfileAlreadyExists(String),
}
impl CreateUserProfileError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateUserProfileError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"UserProfileAlreadyExistsException" => {
return RusotoError::Service(CreateUserProfileError::UserProfileAlreadyExists(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateUserProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateUserProfileError {
fn description(&self) -> &str {
match *self {
CreateUserProfileError::UserProfileAlreadyExists(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteProjectError {
ConcurrentModification(String),
InvalidServiceRole(String),
}
impl DeleteProjectError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteProjectError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(DeleteProjectError::ConcurrentModification(
err.msg,
))
}
"InvalidServiceRoleException" => {
return RusotoError::Service(DeleteProjectError::InvalidServiceRole(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteProjectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteProjectError {
fn description(&self) -> &str {
match *self {
DeleteProjectError::ConcurrentModification(ref cause) => cause,
DeleteProjectError::InvalidServiceRole(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteUserProfileError {}
impl DeleteUserProfileError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteUserProfileError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteUserProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteUserProfileError {
fn description(&self) -> &str {
match *self {}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeProjectError {
ConcurrentModification(String),
InvalidServiceRole(String),
ProjectConfiguration(String),
ProjectNotFound(String),
}
impl DescribeProjectError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeProjectError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(DescribeProjectError::ConcurrentModification(
err.msg,
))
}
"InvalidServiceRoleException" => {
return RusotoError::Service(DescribeProjectError::InvalidServiceRole(err.msg))
}
"ProjectConfigurationException" => {
return RusotoError::Service(DescribeProjectError::ProjectConfiguration(
err.msg,
))
}
"ProjectNotFoundException" => {
return RusotoError::Service(DescribeProjectError::ProjectNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeProjectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeProjectError {
fn description(&self) -> &str {
match *self {
DescribeProjectError::ConcurrentModification(ref cause) => cause,
DescribeProjectError::InvalidServiceRole(ref cause) => cause,
DescribeProjectError::ProjectConfiguration(ref cause) => cause,
DescribeProjectError::ProjectNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeUserProfileError {
UserProfileNotFound(String),
}
impl DescribeUserProfileError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeUserProfileError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"UserProfileNotFoundException" => {
return RusotoError::Service(DescribeUserProfileError::UserProfileNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeUserProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeUserProfileError {
fn description(&self) -> &str {
match *self {
DescribeUserProfileError::UserProfileNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DisassociateTeamMemberError {
ConcurrentModification(String),
InvalidServiceRole(String),
ProjectNotFound(String),
}
impl DisassociateTeamMemberError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DisassociateTeamMemberError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(
DisassociateTeamMemberError::ConcurrentModification(err.msg),
)
}
"InvalidServiceRoleException" => {
return RusotoError::Service(DisassociateTeamMemberError::InvalidServiceRole(
err.msg,
))
}
"ProjectNotFoundException" => {
return RusotoError::Service(DisassociateTeamMemberError::ProjectNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DisassociateTeamMemberError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DisassociateTeamMemberError {
fn description(&self) -> &str {
match *self {
DisassociateTeamMemberError::ConcurrentModification(ref cause) => cause,
DisassociateTeamMemberError::InvalidServiceRole(ref cause) => cause,
DisassociateTeamMemberError::ProjectNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListProjectsError {
InvalidNextToken(String),
}
impl ListProjectsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListProjectsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(ListProjectsError::InvalidNextToken(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListProjectsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListProjectsError {
fn description(&self) -> &str {
match *self {
ListProjectsError::InvalidNextToken(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListResourcesError {
InvalidNextToken(String),
ProjectNotFound(String),
}
impl ListResourcesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListResourcesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(ListResourcesError::InvalidNextToken(err.msg))
}
"ProjectNotFoundException" => {
return RusotoError::Service(ListResourcesError::ProjectNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListResourcesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListResourcesError {
fn description(&self) -> &str {
match *self {
ListResourcesError::InvalidNextToken(ref cause) => cause,
ListResourcesError::ProjectNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsForProjectError {
InvalidNextToken(String),
ProjectNotFound(String),
}
impl ListTagsForProjectError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForProjectError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(ListTagsForProjectError::InvalidNextToken(err.msg))
}
"ProjectNotFoundException" => {
return RusotoError::Service(ListTagsForProjectError::ProjectNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTagsForProjectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsForProjectError {
fn description(&self) -> &str {
match *self {
ListTagsForProjectError::InvalidNextToken(ref cause) => cause,
ListTagsForProjectError::ProjectNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTeamMembersError {
InvalidNextToken(String),
ProjectNotFound(String),
}
impl ListTeamMembersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTeamMembersError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(ListTeamMembersError::InvalidNextToken(err.msg))
}
"ProjectNotFoundException" => {
return RusotoError::Service(ListTeamMembersError::ProjectNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTeamMembersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTeamMembersError {
fn description(&self) -> &str {
match *self {
ListTeamMembersError::InvalidNextToken(ref cause) => cause,
ListTeamMembersError::ProjectNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListUserProfilesError {
InvalidNextToken(String),
}
impl ListUserProfilesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListUserProfilesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(ListUserProfilesError::InvalidNextToken(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListUserProfilesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListUserProfilesError {
fn description(&self) -> &str {
match *self {
ListUserProfilesError::InvalidNextToken(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum TagProjectError {
ConcurrentModification(String),
LimitExceeded(String),
ProjectNotFound(String),
}
impl TagProjectError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagProjectError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(TagProjectError::ConcurrentModification(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(TagProjectError::LimitExceeded(err.msg))
}
"ProjectNotFoundException" => {
return RusotoError::Service(TagProjectError::ProjectNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for TagProjectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagProjectError {
fn description(&self) -> &str {
match *self {
TagProjectError::ConcurrentModification(ref cause) => cause,
TagProjectError::LimitExceeded(ref cause) => cause,
TagProjectError::ProjectNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UntagProjectError {
ConcurrentModification(String),
LimitExceeded(String),
ProjectNotFound(String),
}
impl UntagProjectError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagProjectError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(UntagProjectError::ConcurrentModification(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(UntagProjectError::LimitExceeded(err.msg))
}
"ProjectNotFoundException" => {
return RusotoError::Service(UntagProjectError::ProjectNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UntagProjectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagProjectError {
fn description(&self) -> &str {
match *self {
UntagProjectError::ConcurrentModification(ref cause) => cause,
UntagProjectError::LimitExceeded(ref cause) => cause,
UntagProjectError::ProjectNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateProjectError {
ProjectNotFound(String),
}
impl UpdateProjectError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateProjectError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ProjectNotFoundException" => {
return RusotoError::Service(UpdateProjectError::ProjectNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateProjectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateProjectError {
fn description(&self) -> &str {
match *self {
UpdateProjectError::ProjectNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateTeamMemberError {
ConcurrentModification(String),
InvalidServiceRole(String),
LimitExceeded(String),
ProjectConfiguration(String),
ProjectNotFound(String),
TeamMemberNotFound(String),
}
impl UpdateTeamMemberError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateTeamMemberError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(UpdateTeamMemberError::ConcurrentModification(
err.msg,
))
}
"InvalidServiceRoleException" => {
return RusotoError::Service(UpdateTeamMemberError::InvalidServiceRole(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(UpdateTeamMemberError::LimitExceeded(err.msg))
}
"ProjectConfigurationException" => {
return RusotoError::Service(UpdateTeamMemberError::ProjectConfiguration(
err.msg,
))
}
"ProjectNotFoundException" => {
return RusotoError::Service(UpdateTeamMemberError::ProjectNotFound(err.msg))
}
"TeamMemberNotFoundException" => {
return RusotoError::Service(UpdateTeamMemberError::TeamMemberNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateTeamMemberError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateTeamMemberError {
fn description(&self) -> &str {
match *self {
UpdateTeamMemberError::ConcurrentModification(ref cause) => cause,
UpdateTeamMemberError::InvalidServiceRole(ref cause) => cause,
UpdateTeamMemberError::LimitExceeded(ref cause) => cause,
UpdateTeamMemberError::ProjectConfiguration(ref cause) => cause,
UpdateTeamMemberError::ProjectNotFound(ref cause) => cause,
UpdateTeamMemberError::TeamMemberNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateUserProfileError {
UserProfileNotFound(String),
}
impl UpdateUserProfileError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateUserProfileError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"UserProfileNotFoundException" => {
return RusotoError::Service(UpdateUserProfileError::UserProfileNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateUserProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateUserProfileError {
fn description(&self) -> &str {
match *self {
UpdateUserProfileError::UserProfileNotFound(ref cause) => cause,
}
}
}
pub trait CodeStar {
fn associate_team_member(
&self,
input: AssociateTeamMemberRequest,
) -> RusotoFuture<AssociateTeamMemberResult, AssociateTeamMemberError>;
fn create_project(
&self,
input: CreateProjectRequest,
) -> RusotoFuture<CreateProjectResult, CreateProjectError>;
fn create_user_profile(
&self,
input: CreateUserProfileRequest,
) -> RusotoFuture<CreateUserProfileResult, CreateUserProfileError>;
fn delete_project(
&self,
input: DeleteProjectRequest,
) -> RusotoFuture<DeleteProjectResult, DeleteProjectError>;
fn delete_user_profile(
&self,
input: DeleteUserProfileRequest,
) -> RusotoFuture<DeleteUserProfileResult, DeleteUserProfileError>;
fn describe_project(
&self,
input: DescribeProjectRequest,
) -> RusotoFuture<DescribeProjectResult, DescribeProjectError>;
fn describe_user_profile(
&self,
input: DescribeUserProfileRequest,
) -> RusotoFuture<DescribeUserProfileResult, DescribeUserProfileError>;
fn disassociate_team_member(
&self,
input: DisassociateTeamMemberRequest,
) -> RusotoFuture<DisassociateTeamMemberResult, DisassociateTeamMemberError>;
fn list_projects(
&self,
input: ListProjectsRequest,
) -> RusotoFuture<ListProjectsResult, ListProjectsError>;
fn list_resources(
&self,
input: ListResourcesRequest,
) -> RusotoFuture<ListResourcesResult, ListResourcesError>;
fn list_tags_for_project(
&self,
input: ListTagsForProjectRequest,
) -> RusotoFuture<ListTagsForProjectResult, ListTagsForProjectError>;
fn list_team_members(
&self,
input: ListTeamMembersRequest,
) -> RusotoFuture<ListTeamMembersResult, ListTeamMembersError>;
fn list_user_profiles(
&self,
input: ListUserProfilesRequest,
) -> RusotoFuture<ListUserProfilesResult, ListUserProfilesError>;
fn tag_project(
&self,
input: TagProjectRequest,
) -> RusotoFuture<TagProjectResult, TagProjectError>;
fn untag_project(
&self,
input: UntagProjectRequest,
) -> RusotoFuture<UntagProjectResult, UntagProjectError>;
fn update_project(
&self,
input: UpdateProjectRequest,
) -> RusotoFuture<UpdateProjectResult, UpdateProjectError>;
fn update_team_member(
&self,
input: UpdateTeamMemberRequest,
) -> RusotoFuture<UpdateTeamMemberResult, UpdateTeamMemberError>;
fn update_user_profile(
&self,
input: UpdateUserProfileRequest,
) -> RusotoFuture<UpdateUserProfileResult, UpdateUserProfileError>;
}
#[derive(Clone)]
pub struct CodeStarClient {
client: Client,
region: region::Region,
}
impl CodeStarClient {
pub fn new(region: region::Region) -> CodeStarClient {
CodeStarClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> CodeStarClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
CodeStarClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl CodeStar for CodeStarClient {
fn associate_team_member(
&self,
input: AssociateTeamMemberRequest,
) -> RusotoFuture<AssociateTeamMemberResult, AssociateTeamMemberError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.AssociateTeamMember");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<AssociateTeamMemberResult, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(AssociateTeamMemberError::from_response(response))
}),
)
}
})
}
fn create_project(
&self,
input: CreateProjectRequest,
) -> RusotoFuture<CreateProjectResult, CreateProjectError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.CreateProject");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateProjectResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateProjectError::from_response(response))),
)
}
})
}
fn create_user_profile(
&self,
input: CreateUserProfileRequest,
) -> RusotoFuture<CreateUserProfileResult, CreateUserProfileError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.CreateUserProfile");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateUserProfileResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateUserProfileError::from_response(response))),
)
}
})
}
fn delete_project(
&self,
input: DeleteProjectRequest,
) -> RusotoFuture<DeleteProjectResult, DeleteProjectError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.DeleteProject");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteProjectResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteProjectError::from_response(response))),
)
}
})
}
fn delete_user_profile(
&self,
input: DeleteUserProfileRequest,
) -> RusotoFuture<DeleteUserProfileResult, DeleteUserProfileError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.DeleteUserProfile");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteUserProfileResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteUserProfileError::from_response(response))),
)
}
})
}
fn describe_project(
&self,
input: DescribeProjectRequest,
) -> RusotoFuture<DescribeProjectResult, DescribeProjectError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.DescribeProject");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeProjectResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeProjectError::from_response(response))),
)
}
})
}
fn describe_user_profile(
&self,
input: DescribeUserProfileRequest,
) -> RusotoFuture<DescribeUserProfileResult, DescribeUserProfileError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.DescribeUserProfile");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeUserProfileResult, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeUserProfileError::from_response(response))
}),
)
}
})
}
fn disassociate_team_member(
&self,
input: DisassociateTeamMemberRequest,
) -> RusotoFuture<DisassociateTeamMemberResult, DisassociateTeamMemberError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.DisassociateTeamMember");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DisassociateTeamMemberResult, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DisassociateTeamMemberError::from_response(response))
}),
)
}
})
}
fn list_projects(
&self,
input: ListProjectsRequest,
) -> RusotoFuture<ListProjectsResult, ListProjectsError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.ListProjects");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListProjectsResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListProjectsError::from_response(response))),
)
}
})
}
fn list_resources(
&self,
input: ListResourcesRequest,
) -> RusotoFuture<ListResourcesResult, ListResourcesError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.ListResources");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListResourcesResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListResourcesError::from_response(response))),
)
}
})
}
fn list_tags_for_project(
&self,
input: ListTagsForProjectRequest,
) -> RusotoFuture<ListTagsForProjectResult, ListTagsForProjectError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.ListTagsForProject");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsForProjectResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListTagsForProjectError::from_response(response))),
)
}
})
}
fn list_team_members(
&self,
input: ListTeamMembersRequest,
) -> RusotoFuture<ListTeamMembersResult, ListTeamMembersError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.ListTeamMembers");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListTeamMembersResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListTeamMembersError::from_response(response))),
)
}
})
}
fn list_user_profiles(
&self,
input: ListUserProfilesRequest,
) -> RusotoFuture<ListUserProfilesResult, ListUserProfilesError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.ListUserProfiles");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListUserProfilesResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListUserProfilesError::from_response(response))),
)
}
})
}
fn tag_project(
&self,
input: TagProjectRequest,
) -> RusotoFuture<TagProjectResult, TagProjectError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.TagProject");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<TagProjectResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TagProjectError::from_response(response))),
)
}
})
}
fn untag_project(
&self,
input: UntagProjectRequest,
) -> RusotoFuture<UntagProjectResult, UntagProjectError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.UntagProject");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UntagProjectResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UntagProjectError::from_response(response))),
)
}
})
}
fn update_project(
&self,
input: UpdateProjectRequest,
) -> RusotoFuture<UpdateProjectResult, UpdateProjectError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.UpdateProject");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateProjectResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateProjectError::from_response(response))),
)
}
})
}
fn update_team_member(
&self,
input: UpdateTeamMemberRequest,
) -> RusotoFuture<UpdateTeamMemberResult, UpdateTeamMemberError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.UpdateTeamMember");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateTeamMemberResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateTeamMemberError::from_response(response))),
)
}
})
}
fn update_user_profile(
&self,
input: UpdateUserProfileRequest,
) -> RusotoFuture<UpdateUserProfileResult, UpdateUserProfileError> {
let mut request = SignedRequest::new("POST", "codestar", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "CodeStar_20170419.UpdateUserProfile");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateUserProfileResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateUserProfileError::from_response(response))),
)
}
})
}
}