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 CognitoIdentityClient {
fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
let mut request =
SignedRequest::new(http_method, "cognito-identity", &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, Deserialize, PartialEq, Serialize)]
pub struct CognitoIdentityProvider {
#[serde(rename = "ClientId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_id: Option<String>,
#[serde(rename = "ProviderName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provider_name: Option<String>,
#[serde(rename = "ServerSideTokenCheck")]
#[serde(skip_serializing_if = "Option::is_none")]
pub server_side_token_check: Option<bool>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateIdentityPoolInput {
#[serde(rename = "AllowClassicFlow")]
#[serde(skip_serializing_if = "Option::is_none")]
pub allow_classic_flow: Option<bool>,
#[serde(rename = "AllowUnauthenticatedIdentities")]
pub allow_unauthenticated_identities: bool,
#[serde(rename = "CognitoIdentityProviders")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cognito_identity_providers: Option<Vec<CognitoIdentityProvider>>,
#[serde(rename = "DeveloperProviderName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub developer_provider_name: Option<String>,
#[serde(rename = "IdentityPoolName")]
pub identity_pool_name: String,
#[serde(rename = "IdentityPoolTags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_pool_tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "OpenIdConnectProviderARNs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub open_id_connect_provider_ar_ns: Option<Vec<String>>,
#[serde(rename = "SamlProviderARNs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub saml_provider_ar_ns: Option<Vec<String>>,
#[serde(rename = "SupportedLoginProviders")]
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_login_providers: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Credentials {
#[serde(rename = "AccessKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_key_id: Option<String>,
#[serde(rename = "Expiration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expiration: Option<f64>,
#[serde(rename = "SecretKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secret_key: Option<String>,
#[serde(rename = "SessionToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub session_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteIdentitiesInput {
#[serde(rename = "IdentityIdsToDelete")]
pub identity_ids_to_delete: Vec<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteIdentitiesResponse {
#[serde(rename = "UnprocessedIdentityIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unprocessed_identity_ids: Option<Vec<UnprocessedIdentityId>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteIdentityPoolInput {
#[serde(rename = "IdentityPoolId")]
pub identity_pool_id: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeIdentityInput {
#[serde(rename = "IdentityId")]
pub identity_id: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeIdentityPoolInput {
#[serde(rename = "IdentityPoolId")]
pub identity_pool_id: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetCredentialsForIdentityInput {
#[serde(rename = "CustomRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_role_arn: Option<String>,
#[serde(rename = "IdentityId")]
pub identity_id: String,
#[serde(rename = "Logins")]
#[serde(skip_serializing_if = "Option::is_none")]
pub logins: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetCredentialsForIdentityResponse {
#[serde(rename = "Credentials")]
#[serde(skip_serializing_if = "Option::is_none")]
pub credentials: Option<Credentials>,
#[serde(rename = "IdentityId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_id: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetIdInput {
#[serde(rename = "AccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "IdentityPoolId")]
pub identity_pool_id: String,
#[serde(rename = "Logins")]
#[serde(skip_serializing_if = "Option::is_none")]
pub logins: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetIdResponse {
#[serde(rename = "IdentityId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_id: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetIdentityPoolRolesInput {
#[serde(rename = "IdentityPoolId")]
pub identity_pool_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetIdentityPoolRolesResponse {
#[serde(rename = "IdentityPoolId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_pool_id: Option<String>,
#[serde(rename = "RoleMappings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_mappings: Option<::std::collections::HashMap<String, RoleMapping>>,
#[serde(rename = "Roles")]
#[serde(skip_serializing_if = "Option::is_none")]
pub roles: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetOpenIdTokenForDeveloperIdentityInput {
#[serde(rename = "IdentityId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_id: Option<String>,
#[serde(rename = "IdentityPoolId")]
pub identity_pool_id: String,
#[serde(rename = "Logins")]
pub logins: ::std::collections::HashMap<String, String>,
#[serde(rename = "TokenDuration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub token_duration: Option<i64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetOpenIdTokenForDeveloperIdentityResponse {
#[serde(rename = "IdentityId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_id: Option<String>,
#[serde(rename = "Token")]
#[serde(skip_serializing_if = "Option::is_none")]
pub token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetOpenIdTokenInput {
#[serde(rename = "IdentityId")]
pub identity_id: String,
#[serde(rename = "Logins")]
#[serde(skip_serializing_if = "Option::is_none")]
pub logins: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetOpenIdTokenResponse {
#[serde(rename = "IdentityId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_id: Option<String>,
#[serde(rename = "Token")]
#[serde(skip_serializing_if = "Option::is_none")]
pub token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct IdentityDescription {
#[serde(rename = "CreationDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_date: Option<f64>,
#[serde(rename = "IdentityId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_id: Option<String>,
#[serde(rename = "LastModifiedDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_date: Option<f64>,
#[serde(rename = "Logins")]
#[serde(skip_serializing_if = "Option::is_none")]
pub logins: Option<Vec<String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct IdentityPool {
#[serde(rename = "AllowClassicFlow")]
#[serde(skip_serializing_if = "Option::is_none")]
pub allow_classic_flow: Option<bool>,
#[serde(rename = "AllowUnauthenticatedIdentities")]
pub allow_unauthenticated_identities: bool,
#[serde(rename = "CognitoIdentityProviders")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cognito_identity_providers: Option<Vec<CognitoIdentityProvider>>,
#[serde(rename = "DeveloperProviderName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub developer_provider_name: Option<String>,
#[serde(rename = "IdentityPoolId")]
pub identity_pool_id: String,
#[serde(rename = "IdentityPoolName")]
pub identity_pool_name: String,
#[serde(rename = "IdentityPoolTags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_pool_tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "OpenIdConnectProviderARNs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub open_id_connect_provider_ar_ns: Option<Vec<String>>,
#[serde(rename = "SamlProviderARNs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub saml_provider_ar_ns: Option<Vec<String>>,
#[serde(rename = "SupportedLoginProviders")]
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_login_providers: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct IdentityPoolShortDescription {
#[serde(rename = "IdentityPoolId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_pool_id: Option<String>,
#[serde(rename = "IdentityPoolName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_pool_name: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListIdentitiesInput {
#[serde(rename = "HideDisabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hide_disabled: Option<bool>,
#[serde(rename = "IdentityPoolId")]
pub identity_pool_id: String,
#[serde(rename = "MaxResults")]
pub max_results: 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 ListIdentitiesResponse {
#[serde(rename = "Identities")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identities: Option<Vec<IdentityDescription>>,
#[serde(rename = "IdentityPoolId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_pool_id: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListIdentityPoolsInput {
#[serde(rename = "MaxResults")]
pub max_results: 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 ListIdentityPoolsResponse {
#[serde(rename = "IdentityPools")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_pools: Option<Vec<IdentityPoolShortDescription>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListTagsForResourceInput {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListTagsForResourceResponse {
#[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 LookupDeveloperIdentityInput {
#[serde(rename = "DeveloperUserIdentifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub developer_user_identifier: Option<String>,
#[serde(rename = "IdentityId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_id: Option<String>,
#[serde(rename = "IdentityPoolId")]
pub identity_pool_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 LookupDeveloperIdentityResponse {
#[serde(rename = "DeveloperUserIdentifierList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub developer_user_identifier_list: Option<Vec<String>>,
#[serde(rename = "IdentityId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_id: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct MappingRule {
#[serde(rename = "Claim")]
pub claim: String,
#[serde(rename = "MatchType")]
pub match_type: String,
#[serde(rename = "RoleARN")]
pub role_arn: String,
#[serde(rename = "Value")]
pub value: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct MergeDeveloperIdentitiesInput {
#[serde(rename = "DestinationUserIdentifier")]
pub destination_user_identifier: String,
#[serde(rename = "DeveloperProviderName")]
pub developer_provider_name: String,
#[serde(rename = "IdentityPoolId")]
pub identity_pool_id: String,
#[serde(rename = "SourceUserIdentifier")]
pub source_user_identifier: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct MergeDeveloperIdentitiesResponse {
#[serde(rename = "IdentityId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_id: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct RoleMapping {
#[serde(rename = "AmbiguousRoleResolution")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ambiguous_role_resolution: Option<String>,
#[serde(rename = "RulesConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rules_configuration: Option<RulesConfigurationType>,
#[serde(rename = "Type")]
pub type_: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct RulesConfigurationType {
#[serde(rename = "Rules")]
pub rules: Vec<MappingRule>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct SetIdentityPoolRolesInput {
#[serde(rename = "IdentityPoolId")]
pub identity_pool_id: String,
#[serde(rename = "RoleMappings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_mappings: Option<::std::collections::HashMap<String, RoleMapping>>,
#[serde(rename = "Roles")]
pub roles: ::std::collections::HashMap<String, String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct TagResourceInput {
#[serde(rename = "ResourceArn")]
pub resource_arn: 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 TagResourceResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UnlinkDeveloperIdentityInput {
#[serde(rename = "DeveloperProviderName")]
pub developer_provider_name: String,
#[serde(rename = "DeveloperUserIdentifier")]
pub developer_user_identifier: String,
#[serde(rename = "IdentityId")]
pub identity_id: String,
#[serde(rename = "IdentityPoolId")]
pub identity_pool_id: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UnlinkIdentityInput {
#[serde(rename = "IdentityId")]
pub identity_id: String,
#[serde(rename = "Logins")]
pub logins: ::std::collections::HashMap<String, String>,
#[serde(rename = "LoginsToRemove")]
pub logins_to_remove: Vec<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UnprocessedIdentityId {
#[serde(rename = "ErrorCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_code: Option<String>,
#[serde(rename = "IdentityId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_id: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UntagResourceInput {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UntagResourceResponse {}
#[derive(Debug, PartialEq)]
pub enum CreateIdentityPoolError {
InternalError(String),
InvalidParameter(String),
LimitExceeded(String),
NotAuthorized(String),
ResourceConflict(String),
TooManyRequests(String),
}
impl CreateIdentityPoolError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateIdentityPoolError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(CreateIdentityPoolError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(CreateIdentityPoolError::InvalidParameter(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateIdentityPoolError::LimitExceeded(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(CreateIdentityPoolError::NotAuthorized(err.msg))
}
"ResourceConflictException" => {
return RusotoError::Service(CreateIdentityPoolError::ResourceConflict(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(CreateIdentityPoolError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateIdentityPoolError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateIdentityPoolError::InternalError(ref cause) => write!(f, "{}", cause),
CreateIdentityPoolError::InvalidParameter(ref cause) => write!(f, "{}", cause),
CreateIdentityPoolError::LimitExceeded(ref cause) => write!(f, "{}", cause),
CreateIdentityPoolError::NotAuthorized(ref cause) => write!(f, "{}", cause),
CreateIdentityPoolError::ResourceConflict(ref cause) => write!(f, "{}", cause),
CreateIdentityPoolError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateIdentityPoolError {}
#[derive(Debug, PartialEq)]
pub enum DeleteIdentitiesError {
InternalError(String),
InvalidParameter(String),
TooManyRequests(String),
}
impl DeleteIdentitiesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteIdentitiesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(DeleteIdentitiesError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DeleteIdentitiesError::InvalidParameter(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(DeleteIdentitiesError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteIdentitiesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteIdentitiesError::InternalError(ref cause) => write!(f, "{}", cause),
DeleteIdentitiesError::InvalidParameter(ref cause) => write!(f, "{}", cause),
DeleteIdentitiesError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteIdentitiesError {}
#[derive(Debug, PartialEq)]
pub enum DeleteIdentityPoolError {
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl DeleteIdentityPoolError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteIdentityPoolError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(DeleteIdentityPoolError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DeleteIdentityPoolError::InvalidParameter(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(DeleteIdentityPoolError::NotAuthorized(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteIdentityPoolError::ResourceNotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(DeleteIdentityPoolError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteIdentityPoolError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteIdentityPoolError::InternalError(ref cause) => write!(f, "{}", cause),
DeleteIdentityPoolError::InvalidParameter(ref cause) => write!(f, "{}", cause),
DeleteIdentityPoolError::NotAuthorized(ref cause) => write!(f, "{}", cause),
DeleteIdentityPoolError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DeleteIdentityPoolError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteIdentityPoolError {}
#[derive(Debug, PartialEq)]
pub enum DescribeIdentityError {
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl DescribeIdentityError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeIdentityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(DescribeIdentityError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DescribeIdentityError::InvalidParameter(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(DescribeIdentityError::NotAuthorized(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeIdentityError::ResourceNotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(DescribeIdentityError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeIdentityError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeIdentityError::InternalError(ref cause) => write!(f, "{}", cause),
DescribeIdentityError::InvalidParameter(ref cause) => write!(f, "{}", cause),
DescribeIdentityError::NotAuthorized(ref cause) => write!(f, "{}", cause),
DescribeIdentityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DescribeIdentityError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeIdentityError {}
#[derive(Debug, PartialEq)]
pub enum DescribeIdentityPoolError {
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl DescribeIdentityPoolError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeIdentityPoolError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(DescribeIdentityPoolError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DescribeIdentityPoolError::InvalidParameter(
err.msg,
))
}
"NotAuthorizedException" => {
return RusotoError::Service(DescribeIdentityPoolError::NotAuthorized(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeIdentityPoolError::ResourceNotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(DescribeIdentityPoolError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeIdentityPoolError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeIdentityPoolError::InternalError(ref cause) => write!(f, "{}", cause),
DescribeIdentityPoolError::InvalidParameter(ref cause) => write!(f, "{}", cause),
DescribeIdentityPoolError::NotAuthorized(ref cause) => write!(f, "{}", cause),
DescribeIdentityPoolError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DescribeIdentityPoolError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeIdentityPoolError {}
#[derive(Debug, PartialEq)]
pub enum GetCredentialsForIdentityError {
ExternalService(String),
InternalError(String),
InvalidIdentityPoolConfiguration(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceConflict(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl GetCredentialsForIdentityError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetCredentialsForIdentityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ExternalServiceException" => {
return RusotoError::Service(GetCredentialsForIdentityError::ExternalService(
err.msg,
))
}
"InternalErrorException" => {
return RusotoError::Service(GetCredentialsForIdentityError::InternalError(
err.msg,
))
}
"InvalidIdentityPoolConfigurationException" => {
return RusotoError::Service(
GetCredentialsForIdentityError::InvalidIdentityPoolConfiguration(err.msg),
)
}
"InvalidParameterException" => {
return RusotoError::Service(GetCredentialsForIdentityError::InvalidParameter(
err.msg,
))
}
"NotAuthorizedException" => {
return RusotoError::Service(GetCredentialsForIdentityError::NotAuthorized(
err.msg,
))
}
"ResourceConflictException" => {
return RusotoError::Service(GetCredentialsForIdentityError::ResourceConflict(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetCredentialsForIdentityError::ResourceNotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetCredentialsForIdentityError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetCredentialsForIdentityError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetCredentialsForIdentityError::ExternalService(ref cause) => write!(f, "{}", cause),
GetCredentialsForIdentityError::InternalError(ref cause) => write!(f, "{}", cause),
GetCredentialsForIdentityError::InvalidIdentityPoolConfiguration(ref cause) => {
write!(f, "{}", cause)
}
GetCredentialsForIdentityError::InvalidParameter(ref cause) => write!(f, "{}", cause),
GetCredentialsForIdentityError::NotAuthorized(ref cause) => write!(f, "{}", cause),
GetCredentialsForIdentityError::ResourceConflict(ref cause) => write!(f, "{}", cause),
GetCredentialsForIdentityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetCredentialsForIdentityError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetCredentialsForIdentityError {}
#[derive(Debug, PartialEq)]
pub enum GetIdError {
ExternalService(String),
InternalError(String),
InvalidParameter(String),
LimitExceeded(String),
NotAuthorized(String),
ResourceConflict(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl GetIdError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetIdError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ExternalServiceException" => {
return RusotoError::Service(GetIdError::ExternalService(err.msg))
}
"InternalErrorException" => {
return RusotoError::Service(GetIdError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(GetIdError::InvalidParameter(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(GetIdError::LimitExceeded(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(GetIdError::NotAuthorized(err.msg))
}
"ResourceConflictException" => {
return RusotoError::Service(GetIdError::ResourceConflict(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetIdError::ResourceNotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetIdError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetIdError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetIdError::ExternalService(ref cause) => write!(f, "{}", cause),
GetIdError::InternalError(ref cause) => write!(f, "{}", cause),
GetIdError::InvalidParameter(ref cause) => write!(f, "{}", cause),
GetIdError::LimitExceeded(ref cause) => write!(f, "{}", cause),
GetIdError::NotAuthorized(ref cause) => write!(f, "{}", cause),
GetIdError::ResourceConflict(ref cause) => write!(f, "{}", cause),
GetIdError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetIdError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetIdError {}
#[derive(Debug, PartialEq)]
pub enum GetIdentityPoolRolesError {
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceConflict(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl GetIdentityPoolRolesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetIdentityPoolRolesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(GetIdentityPoolRolesError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(GetIdentityPoolRolesError::InvalidParameter(
err.msg,
))
}
"NotAuthorizedException" => {
return RusotoError::Service(GetIdentityPoolRolesError::NotAuthorized(err.msg))
}
"ResourceConflictException" => {
return RusotoError::Service(GetIdentityPoolRolesError::ResourceConflict(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetIdentityPoolRolesError::ResourceNotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetIdentityPoolRolesError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetIdentityPoolRolesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetIdentityPoolRolesError::InternalError(ref cause) => write!(f, "{}", cause),
GetIdentityPoolRolesError::InvalidParameter(ref cause) => write!(f, "{}", cause),
GetIdentityPoolRolesError::NotAuthorized(ref cause) => write!(f, "{}", cause),
GetIdentityPoolRolesError::ResourceConflict(ref cause) => write!(f, "{}", cause),
GetIdentityPoolRolesError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetIdentityPoolRolesError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetIdentityPoolRolesError {}
#[derive(Debug, PartialEq)]
pub enum GetOpenIdTokenError {
ExternalService(String),
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceConflict(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl GetOpenIdTokenError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetOpenIdTokenError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ExternalServiceException" => {
return RusotoError::Service(GetOpenIdTokenError::ExternalService(err.msg))
}
"InternalErrorException" => {
return RusotoError::Service(GetOpenIdTokenError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(GetOpenIdTokenError::InvalidParameter(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(GetOpenIdTokenError::NotAuthorized(err.msg))
}
"ResourceConflictException" => {
return RusotoError::Service(GetOpenIdTokenError::ResourceConflict(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetOpenIdTokenError::ResourceNotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(GetOpenIdTokenError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetOpenIdTokenError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetOpenIdTokenError::ExternalService(ref cause) => write!(f, "{}", cause),
GetOpenIdTokenError::InternalError(ref cause) => write!(f, "{}", cause),
GetOpenIdTokenError::InvalidParameter(ref cause) => write!(f, "{}", cause),
GetOpenIdTokenError::NotAuthorized(ref cause) => write!(f, "{}", cause),
GetOpenIdTokenError::ResourceConflict(ref cause) => write!(f, "{}", cause),
GetOpenIdTokenError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
GetOpenIdTokenError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetOpenIdTokenError {}
#[derive(Debug, PartialEq)]
pub enum GetOpenIdTokenForDeveloperIdentityError {
DeveloperUserAlreadyRegistered(String),
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceConflict(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl GetOpenIdTokenForDeveloperIdentityError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetOpenIdTokenForDeveloperIdentityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DeveloperUserAlreadyRegisteredException" => {
return RusotoError::Service(
GetOpenIdTokenForDeveloperIdentityError::DeveloperUserAlreadyRegistered(
err.msg,
),
)
}
"InternalErrorException" => {
return RusotoError::Service(
GetOpenIdTokenForDeveloperIdentityError::InternalError(err.msg),
)
}
"InvalidParameterException" => {
return RusotoError::Service(
GetOpenIdTokenForDeveloperIdentityError::InvalidParameter(err.msg),
)
}
"NotAuthorizedException" => {
return RusotoError::Service(
GetOpenIdTokenForDeveloperIdentityError::NotAuthorized(err.msg),
)
}
"ResourceConflictException" => {
return RusotoError::Service(
GetOpenIdTokenForDeveloperIdentityError::ResourceConflict(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
GetOpenIdTokenForDeveloperIdentityError::ResourceNotFound(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(
GetOpenIdTokenForDeveloperIdentityError::TooManyRequests(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetOpenIdTokenForDeveloperIdentityError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetOpenIdTokenForDeveloperIdentityError::DeveloperUserAlreadyRegistered(ref cause) => {
write!(f, "{}", cause)
}
GetOpenIdTokenForDeveloperIdentityError::InternalError(ref cause) => {
write!(f, "{}", cause)
}
GetOpenIdTokenForDeveloperIdentityError::InvalidParameter(ref cause) => {
write!(f, "{}", cause)
}
GetOpenIdTokenForDeveloperIdentityError::NotAuthorized(ref cause) => {
write!(f, "{}", cause)
}
GetOpenIdTokenForDeveloperIdentityError::ResourceConflict(ref cause) => {
write!(f, "{}", cause)
}
GetOpenIdTokenForDeveloperIdentityError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
GetOpenIdTokenForDeveloperIdentityError::TooManyRequests(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for GetOpenIdTokenForDeveloperIdentityError {}
#[derive(Debug, PartialEq)]
pub enum ListIdentitiesError {
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl ListIdentitiesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListIdentitiesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(ListIdentitiesError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(ListIdentitiesError::InvalidParameter(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(ListIdentitiesError::NotAuthorized(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListIdentitiesError::ResourceNotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListIdentitiesError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListIdentitiesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListIdentitiesError::InternalError(ref cause) => write!(f, "{}", cause),
ListIdentitiesError::InvalidParameter(ref cause) => write!(f, "{}", cause),
ListIdentitiesError::NotAuthorized(ref cause) => write!(f, "{}", cause),
ListIdentitiesError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
ListIdentitiesError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListIdentitiesError {}
#[derive(Debug, PartialEq)]
pub enum ListIdentityPoolsError {
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl ListIdentityPoolsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListIdentityPoolsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(ListIdentityPoolsError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(ListIdentityPoolsError::InvalidParameter(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(ListIdentityPoolsError::NotAuthorized(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListIdentityPoolsError::ResourceNotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListIdentityPoolsError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListIdentityPoolsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListIdentityPoolsError::InternalError(ref cause) => write!(f, "{}", cause),
ListIdentityPoolsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
ListIdentityPoolsError::NotAuthorized(ref cause) => write!(f, "{}", cause),
ListIdentityPoolsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
ListIdentityPoolsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListIdentityPoolsError {}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(ListTagsForResourceError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(ListTagsForResourceError::InvalidParameter(
err.msg,
))
}
"NotAuthorizedException" => {
return RusotoError::Service(ListTagsForResourceError::NotAuthorized(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListTagsForResourceError::ResourceNotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListTagsForResourceError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListTagsForResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListTagsForResourceError::InternalError(ref cause) => write!(f, "{}", cause),
ListTagsForResourceError::InvalidParameter(ref cause) => write!(f, "{}", cause),
ListTagsForResourceError::NotAuthorized(ref cause) => write!(f, "{}", cause),
ListTagsForResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
ListTagsForResourceError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListTagsForResourceError {}
#[derive(Debug, PartialEq)]
pub enum LookupDeveloperIdentityError {
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceConflict(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl LookupDeveloperIdentityError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<LookupDeveloperIdentityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(LookupDeveloperIdentityError::InternalError(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(LookupDeveloperIdentityError::InvalidParameter(
err.msg,
))
}
"NotAuthorizedException" => {
return RusotoError::Service(LookupDeveloperIdentityError::NotAuthorized(
err.msg,
))
}
"ResourceConflictException" => {
return RusotoError::Service(LookupDeveloperIdentityError::ResourceConflict(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(LookupDeveloperIdentityError::ResourceNotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(LookupDeveloperIdentityError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for LookupDeveloperIdentityError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
LookupDeveloperIdentityError::InternalError(ref cause) => write!(f, "{}", cause),
LookupDeveloperIdentityError::InvalidParameter(ref cause) => write!(f, "{}", cause),
LookupDeveloperIdentityError::NotAuthorized(ref cause) => write!(f, "{}", cause),
LookupDeveloperIdentityError::ResourceConflict(ref cause) => write!(f, "{}", cause),
LookupDeveloperIdentityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
LookupDeveloperIdentityError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for LookupDeveloperIdentityError {}
#[derive(Debug, PartialEq)]
pub enum MergeDeveloperIdentitiesError {
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceConflict(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl MergeDeveloperIdentitiesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<MergeDeveloperIdentitiesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(MergeDeveloperIdentitiesError::InternalError(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(MergeDeveloperIdentitiesError::InvalidParameter(
err.msg,
))
}
"NotAuthorizedException" => {
return RusotoError::Service(MergeDeveloperIdentitiesError::NotAuthorized(
err.msg,
))
}
"ResourceConflictException" => {
return RusotoError::Service(MergeDeveloperIdentitiesError::ResourceConflict(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(MergeDeveloperIdentitiesError::ResourceNotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(MergeDeveloperIdentitiesError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for MergeDeveloperIdentitiesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
MergeDeveloperIdentitiesError::InternalError(ref cause) => write!(f, "{}", cause),
MergeDeveloperIdentitiesError::InvalidParameter(ref cause) => write!(f, "{}", cause),
MergeDeveloperIdentitiesError::NotAuthorized(ref cause) => write!(f, "{}", cause),
MergeDeveloperIdentitiesError::ResourceConflict(ref cause) => write!(f, "{}", cause),
MergeDeveloperIdentitiesError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
MergeDeveloperIdentitiesError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for MergeDeveloperIdentitiesError {}
#[derive(Debug, PartialEq)]
pub enum SetIdentityPoolRolesError {
ConcurrentModification(String),
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceConflict(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl SetIdentityPoolRolesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SetIdentityPoolRolesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(SetIdentityPoolRolesError::ConcurrentModification(
err.msg,
))
}
"InternalErrorException" => {
return RusotoError::Service(SetIdentityPoolRolesError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(SetIdentityPoolRolesError::InvalidParameter(
err.msg,
))
}
"NotAuthorizedException" => {
return RusotoError::Service(SetIdentityPoolRolesError::NotAuthorized(err.msg))
}
"ResourceConflictException" => {
return RusotoError::Service(SetIdentityPoolRolesError::ResourceConflict(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(SetIdentityPoolRolesError::ResourceNotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(SetIdentityPoolRolesError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for SetIdentityPoolRolesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
SetIdentityPoolRolesError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
SetIdentityPoolRolesError::InternalError(ref cause) => write!(f, "{}", cause),
SetIdentityPoolRolesError::InvalidParameter(ref cause) => write!(f, "{}", cause),
SetIdentityPoolRolesError::NotAuthorized(ref cause) => write!(f, "{}", cause),
SetIdentityPoolRolesError::ResourceConflict(ref cause) => write!(f, "{}", cause),
SetIdentityPoolRolesError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
SetIdentityPoolRolesError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for SetIdentityPoolRolesError {}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl TagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(TagResourceError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(TagResourceError::InvalidParameter(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(TagResourceError::NotAuthorized(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(TagResourceError::ResourceNotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(TagResourceError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for TagResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
TagResourceError::InternalError(ref cause) => write!(f, "{}", cause),
TagResourceError::InvalidParameter(ref cause) => write!(f, "{}", cause),
TagResourceError::NotAuthorized(ref cause) => write!(f, "{}", cause),
TagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
TagResourceError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for TagResourceError {}
#[derive(Debug, PartialEq)]
pub enum UnlinkDeveloperIdentityError {
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceConflict(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl UnlinkDeveloperIdentityError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UnlinkDeveloperIdentityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(UnlinkDeveloperIdentityError::InternalError(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(UnlinkDeveloperIdentityError::InvalidParameter(
err.msg,
))
}
"NotAuthorizedException" => {
return RusotoError::Service(UnlinkDeveloperIdentityError::NotAuthorized(
err.msg,
))
}
"ResourceConflictException" => {
return RusotoError::Service(UnlinkDeveloperIdentityError::ResourceConflict(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UnlinkDeveloperIdentityError::ResourceNotFound(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(UnlinkDeveloperIdentityError::TooManyRequests(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UnlinkDeveloperIdentityError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UnlinkDeveloperIdentityError::InternalError(ref cause) => write!(f, "{}", cause),
UnlinkDeveloperIdentityError::InvalidParameter(ref cause) => write!(f, "{}", cause),
UnlinkDeveloperIdentityError::NotAuthorized(ref cause) => write!(f, "{}", cause),
UnlinkDeveloperIdentityError::ResourceConflict(ref cause) => write!(f, "{}", cause),
UnlinkDeveloperIdentityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UnlinkDeveloperIdentityError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UnlinkDeveloperIdentityError {}
#[derive(Debug, PartialEq)]
pub enum UnlinkIdentityError {
ExternalService(String),
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceConflict(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl UnlinkIdentityError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UnlinkIdentityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ExternalServiceException" => {
return RusotoError::Service(UnlinkIdentityError::ExternalService(err.msg))
}
"InternalErrorException" => {
return RusotoError::Service(UnlinkIdentityError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(UnlinkIdentityError::InvalidParameter(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(UnlinkIdentityError::NotAuthorized(err.msg))
}
"ResourceConflictException" => {
return RusotoError::Service(UnlinkIdentityError::ResourceConflict(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UnlinkIdentityError::ResourceNotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(UnlinkIdentityError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UnlinkIdentityError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UnlinkIdentityError::ExternalService(ref cause) => write!(f, "{}", cause),
UnlinkIdentityError::InternalError(ref cause) => write!(f, "{}", cause),
UnlinkIdentityError::InvalidParameter(ref cause) => write!(f, "{}", cause),
UnlinkIdentityError::NotAuthorized(ref cause) => write!(f, "{}", cause),
UnlinkIdentityError::ResourceConflict(ref cause) => write!(f, "{}", cause),
UnlinkIdentityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UnlinkIdentityError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UnlinkIdentityError {}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
InternalError(String),
InvalidParameter(String),
NotAuthorized(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl UntagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(UntagResourceError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(UntagResourceError::InvalidParameter(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(UntagResourceError::NotAuthorized(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UntagResourceError::ResourceNotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(UntagResourceError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UntagResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UntagResourceError::InternalError(ref cause) => write!(f, "{}", cause),
UntagResourceError::InvalidParameter(ref cause) => write!(f, "{}", cause),
UntagResourceError::NotAuthorized(ref cause) => write!(f, "{}", cause),
UntagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UntagResourceError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UntagResourceError {}
#[derive(Debug, PartialEq)]
pub enum UpdateIdentityPoolError {
ConcurrentModification(String),
InternalError(String),
InvalidParameter(String),
LimitExceeded(String),
NotAuthorized(String),
ResourceConflict(String),
ResourceNotFound(String),
TooManyRequests(String),
}
impl UpdateIdentityPoolError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateIdentityPoolError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(UpdateIdentityPoolError::ConcurrentModification(
err.msg,
))
}
"InternalErrorException" => {
return RusotoError::Service(UpdateIdentityPoolError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(UpdateIdentityPoolError::InvalidParameter(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(UpdateIdentityPoolError::LimitExceeded(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(UpdateIdentityPoolError::NotAuthorized(err.msg))
}
"ResourceConflictException" => {
return RusotoError::Service(UpdateIdentityPoolError::ResourceConflict(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateIdentityPoolError::ResourceNotFound(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(UpdateIdentityPoolError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateIdentityPoolError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateIdentityPoolError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
UpdateIdentityPoolError::InternalError(ref cause) => write!(f, "{}", cause),
UpdateIdentityPoolError::InvalidParameter(ref cause) => write!(f, "{}", cause),
UpdateIdentityPoolError::LimitExceeded(ref cause) => write!(f, "{}", cause),
UpdateIdentityPoolError::NotAuthorized(ref cause) => write!(f, "{}", cause),
UpdateIdentityPoolError::ResourceConflict(ref cause) => write!(f, "{}", cause),
UpdateIdentityPoolError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UpdateIdentityPoolError::TooManyRequests(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateIdentityPoolError {}
#[async_trait]
pub trait CognitoIdentity {
async fn create_identity_pool(
&self,
input: CreateIdentityPoolInput,
) -> Result<IdentityPool, RusotoError<CreateIdentityPoolError>>;
async fn delete_identities(
&self,
input: DeleteIdentitiesInput,
) -> Result<DeleteIdentitiesResponse, RusotoError<DeleteIdentitiesError>>;
async fn delete_identity_pool(
&self,
input: DeleteIdentityPoolInput,
) -> Result<(), RusotoError<DeleteIdentityPoolError>>;
async fn describe_identity(
&self,
input: DescribeIdentityInput,
) -> Result<IdentityDescription, RusotoError<DescribeIdentityError>>;
async fn describe_identity_pool(
&self,
input: DescribeIdentityPoolInput,
) -> Result<IdentityPool, RusotoError<DescribeIdentityPoolError>>;
async fn get_credentials_for_identity(
&self,
input: GetCredentialsForIdentityInput,
) -> Result<GetCredentialsForIdentityResponse, RusotoError<GetCredentialsForIdentityError>>;
async fn get_id(&self, input: GetIdInput) -> Result<GetIdResponse, RusotoError<GetIdError>>;
async fn get_identity_pool_roles(
&self,
input: GetIdentityPoolRolesInput,
) -> Result<GetIdentityPoolRolesResponse, RusotoError<GetIdentityPoolRolesError>>;
async fn get_open_id_token(
&self,
input: GetOpenIdTokenInput,
) -> Result<GetOpenIdTokenResponse, RusotoError<GetOpenIdTokenError>>;
async fn get_open_id_token_for_developer_identity(
&self,
input: GetOpenIdTokenForDeveloperIdentityInput,
) -> Result<
GetOpenIdTokenForDeveloperIdentityResponse,
RusotoError<GetOpenIdTokenForDeveloperIdentityError>,
>;
async fn list_identities(
&self,
input: ListIdentitiesInput,
) -> Result<ListIdentitiesResponse, RusotoError<ListIdentitiesError>>;
async fn list_identity_pools(
&self,
input: ListIdentityPoolsInput,
) -> Result<ListIdentityPoolsResponse, RusotoError<ListIdentityPoolsError>>;
async fn list_tags_for_resource(
&self,
input: ListTagsForResourceInput,
) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>>;
async fn lookup_developer_identity(
&self,
input: LookupDeveloperIdentityInput,
) -> Result<LookupDeveloperIdentityResponse, RusotoError<LookupDeveloperIdentityError>>;
async fn merge_developer_identities(
&self,
input: MergeDeveloperIdentitiesInput,
) -> Result<MergeDeveloperIdentitiesResponse, RusotoError<MergeDeveloperIdentitiesError>>;
async fn set_identity_pool_roles(
&self,
input: SetIdentityPoolRolesInput,
) -> Result<(), RusotoError<SetIdentityPoolRolesError>>;
async fn tag_resource(
&self,
input: TagResourceInput,
) -> Result<TagResourceResponse, RusotoError<TagResourceError>>;
async fn unlink_developer_identity(
&self,
input: UnlinkDeveloperIdentityInput,
) -> Result<(), RusotoError<UnlinkDeveloperIdentityError>>;
async fn unlink_identity(
&self,
input: UnlinkIdentityInput,
) -> Result<(), RusotoError<UnlinkIdentityError>>;
async fn untag_resource(
&self,
input: UntagResourceInput,
) -> Result<UntagResourceResponse, RusotoError<UntagResourceError>>;
async fn update_identity_pool(
&self,
input: IdentityPool,
) -> Result<IdentityPool, RusotoError<UpdateIdentityPoolError>>;
}
#[derive(Clone)]
pub struct CognitoIdentityClient {
client: Client,
region: region::Region,
}
impl CognitoIdentityClient {
pub fn new(region: region::Region) -> CognitoIdentityClient {
CognitoIdentityClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> CognitoIdentityClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
D: DispatchSignedRequest + Send + Sync + 'static,
{
CognitoIdentityClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
pub fn new_with_client(client: Client, region: region::Region) -> CognitoIdentityClient {
CognitoIdentityClient { client, region }
}
}
#[async_trait]
impl CognitoIdentity for CognitoIdentityClient {
async fn create_identity_pool(
&self,
input: CreateIdentityPoolInput,
) -> Result<IdentityPool, RusotoError<CreateIdentityPoolError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.CreateIdentityPool",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateIdentityPoolError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<IdentityPool, _>()
}
async fn delete_identities(
&self,
input: DeleteIdentitiesInput,
) -> Result<DeleteIdentitiesResponse, RusotoError<DeleteIdentitiesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSCognitoIdentityService.DeleteIdentities");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteIdentitiesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DeleteIdentitiesResponse, _>()
}
async fn delete_identity_pool(
&self,
input: DeleteIdentityPoolInput,
) -> Result<(), RusotoError<DeleteIdentityPoolError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.DeleteIdentityPool",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteIdentityPoolError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
async fn describe_identity(
&self,
input: DescribeIdentityInput,
) -> Result<IdentityDescription, RusotoError<DescribeIdentityError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSCognitoIdentityService.DescribeIdentity");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeIdentityError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<IdentityDescription, _>()
}
async fn describe_identity_pool(
&self,
input: DescribeIdentityPoolInput,
) -> Result<IdentityPool, RusotoError<DescribeIdentityPoolError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.DescribeIdentityPool",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeIdentityPoolError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<IdentityPool, _>()
}
async fn get_credentials_for_identity(
&self,
input: GetCredentialsForIdentityInput,
) -> Result<GetCredentialsForIdentityResponse, RusotoError<GetCredentialsForIdentityError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.GetCredentialsForIdentity",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetCredentialsForIdentityError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetCredentialsForIdentityResponse, _>()
}
async fn get_id(&self, input: GetIdInput) -> Result<GetIdResponse, RusotoError<GetIdError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSCognitoIdentityService.GetId");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetIdError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetIdResponse, _>()
}
async fn get_identity_pool_roles(
&self,
input: GetIdentityPoolRolesInput,
) -> Result<GetIdentityPoolRolesResponse, RusotoError<GetIdentityPoolRolesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.GetIdentityPoolRoles",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetIdentityPoolRolesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetIdentityPoolRolesResponse, _>()
}
async fn get_open_id_token(
&self,
input: GetOpenIdTokenInput,
) -> Result<GetOpenIdTokenResponse, RusotoError<GetOpenIdTokenError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSCognitoIdentityService.GetOpenIdToken");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetOpenIdTokenError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetOpenIdTokenResponse, _>()
}
async fn get_open_id_token_for_developer_identity(
&self,
input: GetOpenIdTokenForDeveloperIdentityInput,
) -> Result<
GetOpenIdTokenForDeveloperIdentityResponse,
RusotoError<GetOpenIdTokenForDeveloperIdentityError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.GetOpenIdTokenForDeveloperIdentity",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(
request,
GetOpenIdTokenForDeveloperIdentityError::from_response,
)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetOpenIdTokenForDeveloperIdentityResponse, _>()
}
async fn list_identities(
&self,
input: ListIdentitiesInput,
) -> Result<ListIdentitiesResponse, RusotoError<ListIdentitiesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSCognitoIdentityService.ListIdentities");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListIdentitiesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListIdentitiesResponse, _>()
}
async fn list_identity_pools(
&self,
input: ListIdentityPoolsInput,
) -> Result<ListIdentityPoolsResponse, RusotoError<ListIdentityPoolsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.ListIdentityPools",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListIdentityPoolsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListIdentityPoolsResponse, _>()
}
async fn list_tags_for_resource(
&self,
input: ListTagsForResourceInput,
) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.ListTagsForResource",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListTagsForResourceError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListTagsForResourceResponse, _>()
}
async fn lookup_developer_identity(
&self,
input: LookupDeveloperIdentityInput,
) -> Result<LookupDeveloperIdentityResponse, RusotoError<LookupDeveloperIdentityError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.LookupDeveloperIdentity",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, LookupDeveloperIdentityError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<LookupDeveloperIdentityResponse, _>()
}
async fn merge_developer_identities(
&self,
input: MergeDeveloperIdentitiesInput,
) -> Result<MergeDeveloperIdentitiesResponse, RusotoError<MergeDeveloperIdentitiesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.MergeDeveloperIdentities",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, MergeDeveloperIdentitiesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<MergeDeveloperIdentitiesResponse, _>()
}
async fn set_identity_pool_roles(
&self,
input: SetIdentityPoolRolesInput,
) -> Result<(), RusotoError<SetIdentityPoolRolesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.SetIdentityPoolRoles",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, SetIdentityPoolRolesError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
async fn tag_resource(
&self,
input: TagResourceInput,
) -> Result<TagResourceResponse, RusotoError<TagResourceError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSCognitoIdentityService.TagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, TagResourceError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<TagResourceResponse, _>()
}
async fn unlink_developer_identity(
&self,
input: UnlinkDeveloperIdentityInput,
) -> Result<(), RusotoError<UnlinkDeveloperIdentityError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.UnlinkDeveloperIdentity",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UnlinkDeveloperIdentityError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
async fn unlink_identity(
&self,
input: UnlinkIdentityInput,
) -> Result<(), RusotoError<UnlinkIdentityError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSCognitoIdentityService.UnlinkIdentity");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UnlinkIdentityError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
async fn untag_resource(
&self,
input: UntagResourceInput,
) -> Result<UntagResourceResponse, RusotoError<UntagResourceError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSCognitoIdentityService.UntagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UntagResourceError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UntagResourceResponse, _>()
}
async fn update_identity_pool(
&self,
input: IdentityPool,
) -> Result<IdentityPool, RusotoError<UpdateIdentityPoolError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.UpdateIdentityPool",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateIdentityPoolError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<IdentityPool, _>()
}
}