use std::error::Error;
use std::fmt;
use async_trait::async_trait;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError};
use rusoto_core::proto;
use rusoto_core::request::HttpResponse;
use rusoto_core::signature::SignedRequest;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
impl CodeStarClient {
fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
let mut request = SignedRequest::new(http_method, "codestar", &self.region, request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
request
}
async fn sign_and_dispatch<E>(
&self,
request: SignedRequest,
from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
) -> Result<HttpResponse, RusotoError<E>> {
let mut response = self.client.sign_and_dispatch(request).await?;
if !response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
return Err(from_response(response));
}
Ok(response)
}
}
use serde_json;
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AssociateTeamMemberResult {
#[serde(rename = "clientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct Code {
#[serde(rename = "destination")]
pub destination: CodeDestination,
#[serde(rename = "source")]
pub source: CodeSource,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CodeCommitCodeDestination {
#[serde(rename = "name")]
pub name: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CodeSource {
#[serde(rename = "s3")]
pub s_3: S3Location,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteUserProfileRequest {
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteUserProfileResult {
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeProjectRequest {
#[serde(rename = "id")]
pub id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeUserProfileRequest {
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DisassociateTeamMemberRequest {
#[serde(rename = "projectId")]
pub project_id: String,
#[serde(rename = "userArn")]
pub user_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DisassociateTeamMemberResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Resource {
#[serde(rename = "id")]
pub id: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct TagProjectRequest {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "tags")]
pub tags: ::std::collections::HashMap<String, String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct TagProjectResult {
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct 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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ToolchainSource {
#[serde(rename = "s3")]
pub s_3: S3Location,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UntagProjectRequest {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "tags")]
pub tags: Vec<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UntagProjectResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateProjectResult {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), 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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for AssociateTeamMemberError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
AssociateTeamMemberError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
AssociateTeamMemberError::InvalidServiceRole(ref cause) => write!(f, "{}", cause),
AssociateTeamMemberError::LimitExceeded(ref cause) => write!(f, "{}", cause),
AssociateTeamMemberError::ProjectConfiguration(ref cause) => write!(f, "{}", cause),
AssociateTeamMemberError::ProjectNotFound(ref cause) => write!(f, "{}", cause),
AssociateTeamMemberError::TeamMemberAlreadyAssociated(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for AssociateTeamMemberError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateProjectError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateProjectError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
CreateProjectError::InvalidServiceRole(ref cause) => write!(f, "{}", cause),
CreateProjectError::LimitExceeded(ref cause) => write!(f, "{}", cause),
CreateProjectError::ProjectAlreadyExists(ref cause) => write!(f, "{}", cause),
CreateProjectError::ProjectConfiguration(ref cause) => write!(f, "{}", cause),
CreateProjectError::ProjectCreationFailed(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateProjectError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateUserProfileError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateUserProfileError::UserProfileAlreadyExists(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateUserProfileError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteProjectError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteProjectError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
DeleteProjectError::InvalidServiceRole(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteProjectError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteUserProfileError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {}
}
}
impl Error for DeleteUserProfileError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeProjectError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeProjectError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
DescribeProjectError::InvalidServiceRole(ref cause) => write!(f, "{}", cause),
DescribeProjectError::ProjectConfiguration(ref cause) => write!(f, "{}", cause),
DescribeProjectError::ProjectNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeProjectError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeUserProfileError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeUserProfileError::UserProfileNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeUserProfileError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DisassociateTeamMemberError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DisassociateTeamMemberError::ConcurrentModification(ref cause) => {
write!(f, "{}", cause)
}
DisassociateTeamMemberError::InvalidServiceRole(ref cause) => write!(f, "{}", cause),
DisassociateTeamMemberError::ProjectNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DisassociateTeamMemberError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListProjectsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListProjectsError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListProjectsError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListResourcesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListResourcesError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
ListResourcesError::ProjectNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListResourcesError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListTagsForProjectError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListTagsForProjectError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
ListTagsForProjectError::ProjectNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListTagsForProjectError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListTeamMembersError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListTeamMembersError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
ListTeamMembersError::ProjectNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListTeamMembersError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListUserProfilesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListUserProfilesError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListUserProfilesError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for TagProjectError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
TagProjectError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
TagProjectError::LimitExceeded(ref cause) => write!(f, "{}", cause),
TagProjectError::ProjectNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for TagProjectError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UntagProjectError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UntagProjectError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
UntagProjectError::LimitExceeded(ref cause) => write!(f, "{}", cause),
UntagProjectError::ProjectNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UntagProjectError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateProjectError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateProjectError::ProjectNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateProjectError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateTeamMemberError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateTeamMemberError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
UpdateTeamMemberError::InvalidServiceRole(ref cause) => write!(f, "{}", cause),
UpdateTeamMemberError::LimitExceeded(ref cause) => write!(f, "{}", cause),
UpdateTeamMemberError::ProjectConfiguration(ref cause) => write!(f, "{}", cause),
UpdateTeamMemberError::ProjectNotFound(ref cause) => write!(f, "{}", cause),
UpdateTeamMemberError::TeamMemberNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateTeamMemberError {}
#[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),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateUserProfileError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateUserProfileError::UserProfileNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateUserProfileError {}
#[async_trait]
pub trait CodeStar {
async fn associate_team_member(
&self,
input: AssociateTeamMemberRequest,
) -> Result<AssociateTeamMemberResult, RusotoError<AssociateTeamMemberError>>;
async fn create_project(
&self,
input: CreateProjectRequest,
) -> Result<CreateProjectResult, RusotoError<CreateProjectError>>;
async fn create_user_profile(
&self,
input: CreateUserProfileRequest,
) -> Result<CreateUserProfileResult, RusotoError<CreateUserProfileError>>;
async fn delete_project(
&self,
input: DeleteProjectRequest,
) -> Result<DeleteProjectResult, RusotoError<DeleteProjectError>>;
async fn delete_user_profile(
&self,
input: DeleteUserProfileRequest,
) -> Result<DeleteUserProfileResult, RusotoError<DeleteUserProfileError>>;
async fn describe_project(
&self,
input: DescribeProjectRequest,
) -> Result<DescribeProjectResult, RusotoError<DescribeProjectError>>;
async fn describe_user_profile(
&self,
input: DescribeUserProfileRequest,
) -> Result<DescribeUserProfileResult, RusotoError<DescribeUserProfileError>>;
async fn disassociate_team_member(
&self,
input: DisassociateTeamMemberRequest,
) -> Result<DisassociateTeamMemberResult, RusotoError<DisassociateTeamMemberError>>;
async fn list_projects(
&self,
input: ListProjectsRequest,
) -> Result<ListProjectsResult, RusotoError<ListProjectsError>>;
async fn list_resources(
&self,
input: ListResourcesRequest,
) -> Result<ListResourcesResult, RusotoError<ListResourcesError>>;
async fn list_tags_for_project(
&self,
input: ListTagsForProjectRequest,
) -> Result<ListTagsForProjectResult, RusotoError<ListTagsForProjectError>>;
async fn list_team_members(
&self,
input: ListTeamMembersRequest,
) -> Result<ListTeamMembersResult, RusotoError<ListTeamMembersError>>;
async fn list_user_profiles(
&self,
input: ListUserProfilesRequest,
) -> Result<ListUserProfilesResult, RusotoError<ListUserProfilesError>>;
async fn tag_project(
&self,
input: TagProjectRequest,
) -> Result<TagProjectResult, RusotoError<TagProjectError>>;
async fn untag_project(
&self,
input: UntagProjectRequest,
) -> Result<UntagProjectResult, RusotoError<UntagProjectError>>;
async fn update_project(
&self,
input: UpdateProjectRequest,
) -> Result<UpdateProjectResult, RusotoError<UpdateProjectError>>;
async fn update_team_member(
&self,
input: UpdateTeamMemberRequest,
) -> Result<UpdateTeamMemberResult, RusotoError<UpdateTeamMemberError>>;
async fn update_user_profile(
&self,
input: UpdateUserProfileRequest,
) -> Result<UpdateUserProfileResult, RusotoError<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,
D: DispatchSignedRequest + Send + Sync + 'static,
{
CodeStarClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
pub fn new_with_client(client: Client, region: region::Region) -> CodeStarClient {
CodeStarClient { client, region }
}
}
#[async_trait]
impl CodeStar for CodeStarClient {
async fn associate_team_member(
&self,
input: AssociateTeamMemberRequest,
) -> Result<AssociateTeamMemberResult, RusotoError<AssociateTeamMemberError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.AssociateTeamMember");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, AssociateTeamMemberError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<AssociateTeamMemberResult, _>()
}
async fn create_project(
&self,
input: CreateProjectRequest,
) -> Result<CreateProjectResult, RusotoError<CreateProjectError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.CreateProject");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateProjectError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<CreateProjectResult, _>()
}
async fn create_user_profile(
&self,
input: CreateUserProfileRequest,
) -> Result<CreateUserProfileResult, RusotoError<CreateUserProfileError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.CreateUserProfile");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateUserProfileError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<CreateUserProfileResult, _>()
}
async fn delete_project(
&self,
input: DeleteProjectRequest,
) -> Result<DeleteProjectResult, RusotoError<DeleteProjectError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.DeleteProject");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteProjectError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DeleteProjectResult, _>()
}
async fn delete_user_profile(
&self,
input: DeleteUserProfileRequest,
) -> Result<DeleteUserProfileResult, RusotoError<DeleteUserProfileError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.DeleteUserProfile");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteUserProfileError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DeleteUserProfileResult, _>()
}
async fn describe_project(
&self,
input: DescribeProjectRequest,
) -> Result<DescribeProjectResult, RusotoError<DescribeProjectError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.DescribeProject");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeProjectError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DescribeProjectResult, _>()
}
async fn describe_user_profile(
&self,
input: DescribeUserProfileRequest,
) -> Result<DescribeUserProfileResult, RusotoError<DescribeUserProfileError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.DescribeUserProfile");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeUserProfileError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DescribeUserProfileResult, _>()
}
async fn disassociate_team_member(
&self,
input: DisassociateTeamMemberRequest,
) -> Result<DisassociateTeamMemberResult, RusotoError<DisassociateTeamMemberError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.DisassociateTeamMember");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DisassociateTeamMemberError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DisassociateTeamMemberResult, _>()
}
async fn list_projects(
&self,
input: ListProjectsRequest,
) -> Result<ListProjectsResult, RusotoError<ListProjectsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.ListProjects");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListProjectsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListProjectsResult, _>()
}
async fn list_resources(
&self,
input: ListResourcesRequest,
) -> Result<ListResourcesResult, RusotoError<ListResourcesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.ListResources");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListResourcesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListResourcesResult, _>()
}
async fn list_tags_for_project(
&self,
input: ListTagsForProjectRequest,
) -> Result<ListTagsForProjectResult, RusotoError<ListTagsForProjectError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.ListTagsForProject");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListTagsForProjectError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListTagsForProjectResult, _>()
}
async fn list_team_members(
&self,
input: ListTeamMembersRequest,
) -> Result<ListTeamMembersResult, RusotoError<ListTeamMembersError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.ListTeamMembers");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListTeamMembersError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListTeamMembersResult, _>()
}
async fn list_user_profiles(
&self,
input: ListUserProfilesRequest,
) -> Result<ListUserProfilesResult, RusotoError<ListUserProfilesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.ListUserProfiles");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListUserProfilesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListUserProfilesResult, _>()
}
async fn tag_project(
&self,
input: TagProjectRequest,
) -> Result<TagProjectResult, RusotoError<TagProjectError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.TagProject");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, TagProjectError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<TagProjectResult, _>()
}
async fn untag_project(
&self,
input: UntagProjectRequest,
) -> Result<UntagProjectResult, RusotoError<UntagProjectError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.UntagProject");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UntagProjectError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UntagProjectResult, _>()
}
async fn update_project(
&self,
input: UpdateProjectRequest,
) -> Result<UpdateProjectResult, RusotoError<UpdateProjectError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.UpdateProject");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateProjectError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UpdateProjectResult, _>()
}
async fn update_team_member(
&self,
input: UpdateTeamMemberRequest,
) -> Result<UpdateTeamMemberResult, RusotoError<UpdateTeamMemberError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.UpdateTeamMember");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateTeamMemberError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UpdateTeamMemberResult, _>()
}
async fn update_user_profile(
&self,
input: UpdateUserProfileRequest,
) -> Result<UpdateUserProfileResult, RusotoError<UpdateUserProfileError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "CodeStar_20170419.UpdateUserProfile");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateUserProfileError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UpdateUserProfileResult, _>()
}
}