use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateIdentityPoolInput {
#[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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteIdentitiesInput {
#[serde(rename = "IdentityIdsToDelete")]
pub identity_ids_to_delete: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteIdentitiesResponse {
#[serde(rename = "UnprocessedIdentityIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unprocessed_identity_ids: Option<Vec<UnprocessedIdentityId>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteIdentityPoolInput {
#[serde(rename = "IdentityPoolId")]
pub identity_pool_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeIdentityInput {
#[serde(rename = "IdentityId")]
pub identity_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeIdentityPoolInput {
#[serde(rename = "IdentityPoolId")]
pub identity_pool_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetIdResponse {
#[serde(rename = "IdentityId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetIdentityPoolRolesInput {
#[serde(rename = "IdentityPoolId")]
pub identity_pool_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct IdentityPool {
#[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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsForResourceInput {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagsForResourceResponse {
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct 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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct MergeDeveloperIdentitiesResponse {
#[serde(rename = "IdentityId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
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(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RulesConfigurationType {
#[serde(rename = "Rules")]
pub rules: Vec<MappingRule>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TagResourceInput {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TagResourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Serialize)]
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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UntagResourceInput {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "TagKeys")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_keys: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateIdentityPoolError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateIdentityPoolError {
fn description(&self) -> &str {
match *self {
CreateIdentityPoolError::InternalError(ref cause) => cause,
CreateIdentityPoolError::InvalidParameter(ref cause) => cause,
CreateIdentityPoolError::LimitExceeded(ref cause) => cause,
CreateIdentityPoolError::NotAuthorized(ref cause) => cause,
CreateIdentityPoolError::ResourceConflict(ref cause) => cause,
CreateIdentityPoolError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteIdentitiesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteIdentitiesError {
fn description(&self) -> &str {
match *self {
DeleteIdentitiesError::InternalError(ref cause) => cause,
DeleteIdentitiesError::InvalidParameter(ref cause) => cause,
DeleteIdentitiesError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteIdentityPoolError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteIdentityPoolError {
fn description(&self) -> &str {
match *self {
DeleteIdentityPoolError::InternalError(ref cause) => cause,
DeleteIdentityPoolError::InvalidParameter(ref cause) => cause,
DeleteIdentityPoolError::NotAuthorized(ref cause) => cause,
DeleteIdentityPoolError::ResourceNotFound(ref cause) => cause,
DeleteIdentityPoolError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeIdentityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeIdentityError {
fn description(&self) -> &str {
match *self {
DescribeIdentityError::InternalError(ref cause) => cause,
DescribeIdentityError::InvalidParameter(ref cause) => cause,
DescribeIdentityError::NotAuthorized(ref cause) => cause,
DescribeIdentityError::ResourceNotFound(ref cause) => cause,
DescribeIdentityError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeIdentityPoolError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeIdentityPoolError {
fn description(&self) -> &str {
match *self {
DescribeIdentityPoolError::InternalError(ref cause) => cause,
DescribeIdentityPoolError::InvalidParameter(ref cause) => cause,
DescribeIdentityPoolError::NotAuthorized(ref cause) => cause,
DescribeIdentityPoolError::ResourceNotFound(ref cause) => cause,
DescribeIdentityPoolError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetCredentialsForIdentityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetCredentialsForIdentityError {
fn description(&self) -> &str {
match *self {
GetCredentialsForIdentityError::ExternalService(ref cause) => cause,
GetCredentialsForIdentityError::InternalError(ref cause) => cause,
GetCredentialsForIdentityError::InvalidIdentityPoolConfiguration(ref cause) => cause,
GetCredentialsForIdentityError::InvalidParameter(ref cause) => cause,
GetCredentialsForIdentityError::NotAuthorized(ref cause) => cause,
GetCredentialsForIdentityError::ResourceConflict(ref cause) => cause,
GetCredentialsForIdentityError::ResourceNotFound(ref cause) => cause,
GetCredentialsForIdentityError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetIdError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetIdError {
fn description(&self) -> &str {
match *self {
GetIdError::ExternalService(ref cause) => cause,
GetIdError::InternalError(ref cause) => cause,
GetIdError::InvalidParameter(ref cause) => cause,
GetIdError::LimitExceeded(ref cause) => cause,
GetIdError::NotAuthorized(ref cause) => cause,
GetIdError::ResourceConflict(ref cause) => cause,
GetIdError::ResourceNotFound(ref cause) => cause,
GetIdError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetIdentityPoolRolesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetIdentityPoolRolesError {
fn description(&self) -> &str {
match *self {
GetIdentityPoolRolesError::InternalError(ref cause) => cause,
GetIdentityPoolRolesError::InvalidParameter(ref cause) => cause,
GetIdentityPoolRolesError::NotAuthorized(ref cause) => cause,
GetIdentityPoolRolesError::ResourceConflict(ref cause) => cause,
GetIdentityPoolRolesError::ResourceNotFound(ref cause) => cause,
GetIdentityPoolRolesError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetOpenIdTokenError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetOpenIdTokenError {
fn description(&self) -> &str {
match *self {
GetOpenIdTokenError::ExternalService(ref cause) => cause,
GetOpenIdTokenError::InternalError(ref cause) => cause,
GetOpenIdTokenError::InvalidParameter(ref cause) => cause,
GetOpenIdTokenError::NotAuthorized(ref cause) => cause,
GetOpenIdTokenError::ResourceConflict(ref cause) => cause,
GetOpenIdTokenError::ResourceNotFound(ref cause) => cause,
GetOpenIdTokenError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetOpenIdTokenForDeveloperIdentityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetOpenIdTokenForDeveloperIdentityError {
fn description(&self) -> &str {
match *self {
GetOpenIdTokenForDeveloperIdentityError::DeveloperUserAlreadyRegistered(ref cause) => {
cause
}
GetOpenIdTokenForDeveloperIdentityError::InternalError(ref cause) => cause,
GetOpenIdTokenForDeveloperIdentityError::InvalidParameter(ref cause) => cause,
GetOpenIdTokenForDeveloperIdentityError::NotAuthorized(ref cause) => cause,
GetOpenIdTokenForDeveloperIdentityError::ResourceConflict(ref cause) => cause,
GetOpenIdTokenForDeveloperIdentityError::ResourceNotFound(ref cause) => cause,
GetOpenIdTokenForDeveloperIdentityError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListIdentitiesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListIdentitiesError {
fn description(&self) -> &str {
match *self {
ListIdentitiesError::InternalError(ref cause) => cause,
ListIdentitiesError::InvalidParameter(ref cause) => cause,
ListIdentitiesError::NotAuthorized(ref cause) => cause,
ListIdentitiesError::ResourceNotFound(ref cause) => cause,
ListIdentitiesError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListIdentityPoolsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListIdentityPoolsError {
fn description(&self) -> &str {
match *self {
ListIdentityPoolsError::InternalError(ref cause) => cause,
ListIdentityPoolsError::InvalidParameter(ref cause) => cause,
ListIdentityPoolsError::NotAuthorized(ref cause) => cause,
ListIdentityPoolsError::ResourceNotFound(ref cause) => cause,
ListIdentityPoolsError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTagsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsForResourceError {
fn description(&self) -> &str {
match *self {
ListTagsForResourceError::InternalError(ref cause) => cause,
ListTagsForResourceError::InvalidParameter(ref cause) => cause,
ListTagsForResourceError::NotAuthorized(ref cause) => cause,
ListTagsForResourceError::ResourceNotFound(ref cause) => cause,
ListTagsForResourceError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for LookupDeveloperIdentityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for LookupDeveloperIdentityError {
fn description(&self) -> &str {
match *self {
LookupDeveloperIdentityError::InternalError(ref cause) => cause,
LookupDeveloperIdentityError::InvalidParameter(ref cause) => cause,
LookupDeveloperIdentityError::NotAuthorized(ref cause) => cause,
LookupDeveloperIdentityError::ResourceConflict(ref cause) => cause,
LookupDeveloperIdentityError::ResourceNotFound(ref cause) => cause,
LookupDeveloperIdentityError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for MergeDeveloperIdentitiesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for MergeDeveloperIdentitiesError {
fn description(&self) -> &str {
match *self {
MergeDeveloperIdentitiesError::InternalError(ref cause) => cause,
MergeDeveloperIdentitiesError::InvalidParameter(ref cause) => cause,
MergeDeveloperIdentitiesError::NotAuthorized(ref cause) => cause,
MergeDeveloperIdentitiesError::ResourceConflict(ref cause) => cause,
MergeDeveloperIdentitiesError::ResourceNotFound(ref cause) => cause,
MergeDeveloperIdentitiesError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for SetIdentityPoolRolesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SetIdentityPoolRolesError {
fn description(&self) -> &str {
match *self {
SetIdentityPoolRolesError::ConcurrentModification(ref cause) => cause,
SetIdentityPoolRolesError::InternalError(ref cause) => cause,
SetIdentityPoolRolesError::InvalidParameter(ref cause) => cause,
SetIdentityPoolRolesError::NotAuthorized(ref cause) => cause,
SetIdentityPoolRolesError::ResourceConflict(ref cause) => cause,
SetIdentityPoolRolesError::ResourceNotFound(ref cause) => cause,
SetIdentityPoolRolesError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for TagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagResourceError {
fn description(&self) -> &str {
match *self {
TagResourceError::InternalError(ref cause) => cause,
TagResourceError::InvalidParameter(ref cause) => cause,
TagResourceError::NotAuthorized(ref cause) => cause,
TagResourceError::ResourceNotFound(ref cause) => cause,
TagResourceError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UnlinkDeveloperIdentityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UnlinkDeveloperIdentityError {
fn description(&self) -> &str {
match *self {
UnlinkDeveloperIdentityError::InternalError(ref cause) => cause,
UnlinkDeveloperIdentityError::InvalidParameter(ref cause) => cause,
UnlinkDeveloperIdentityError::NotAuthorized(ref cause) => cause,
UnlinkDeveloperIdentityError::ResourceConflict(ref cause) => cause,
UnlinkDeveloperIdentityError::ResourceNotFound(ref cause) => cause,
UnlinkDeveloperIdentityError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UnlinkIdentityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UnlinkIdentityError {
fn description(&self) -> &str {
match *self {
UnlinkIdentityError::ExternalService(ref cause) => cause,
UnlinkIdentityError::InternalError(ref cause) => cause,
UnlinkIdentityError::InvalidParameter(ref cause) => cause,
UnlinkIdentityError::NotAuthorized(ref cause) => cause,
UnlinkIdentityError::ResourceConflict(ref cause) => cause,
UnlinkIdentityError::ResourceNotFound(ref cause) => cause,
UnlinkIdentityError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagResourceError {
fn description(&self) -> &str {
match *self {
UntagResourceError::InternalError(ref cause) => cause,
UntagResourceError::InvalidParameter(ref cause) => cause,
UntagResourceError::NotAuthorized(ref cause) => cause,
UntagResourceError::ResourceNotFound(ref cause) => cause,
UntagResourceError::TooManyRequests(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateIdentityPoolError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateIdentityPoolError {
fn description(&self) -> &str {
match *self {
UpdateIdentityPoolError::ConcurrentModification(ref cause) => cause,
UpdateIdentityPoolError::InternalError(ref cause) => cause,
UpdateIdentityPoolError::InvalidParameter(ref cause) => cause,
UpdateIdentityPoolError::LimitExceeded(ref cause) => cause,
UpdateIdentityPoolError::NotAuthorized(ref cause) => cause,
UpdateIdentityPoolError::ResourceConflict(ref cause) => cause,
UpdateIdentityPoolError::ResourceNotFound(ref cause) => cause,
UpdateIdentityPoolError::TooManyRequests(ref cause) => cause,
}
}
}
pub trait CognitoIdentity {
fn create_identity_pool(
&self,
input: CreateIdentityPoolInput,
) -> RusotoFuture<IdentityPool, CreateIdentityPoolError>;
fn delete_identities(
&self,
input: DeleteIdentitiesInput,
) -> RusotoFuture<DeleteIdentitiesResponse, DeleteIdentitiesError>;
fn delete_identity_pool(
&self,
input: DeleteIdentityPoolInput,
) -> RusotoFuture<(), DeleteIdentityPoolError>;
fn describe_identity(
&self,
input: DescribeIdentityInput,
) -> RusotoFuture<IdentityDescription, DescribeIdentityError>;
fn describe_identity_pool(
&self,
input: DescribeIdentityPoolInput,
) -> RusotoFuture<IdentityPool, DescribeIdentityPoolError>;
fn get_credentials_for_identity(
&self,
input: GetCredentialsForIdentityInput,
) -> RusotoFuture<GetCredentialsForIdentityResponse, GetCredentialsForIdentityError>;
fn get_id(&self, input: GetIdInput) -> RusotoFuture<GetIdResponse, GetIdError>;
fn get_identity_pool_roles(
&self,
input: GetIdentityPoolRolesInput,
) -> RusotoFuture<GetIdentityPoolRolesResponse, GetIdentityPoolRolesError>;
fn get_open_id_token(
&self,
input: GetOpenIdTokenInput,
) -> RusotoFuture<GetOpenIdTokenResponse, GetOpenIdTokenError>;
fn get_open_id_token_for_developer_identity(
&self,
input: GetOpenIdTokenForDeveloperIdentityInput,
) -> RusotoFuture<
GetOpenIdTokenForDeveloperIdentityResponse,
GetOpenIdTokenForDeveloperIdentityError,
>;
fn list_identities(
&self,
input: ListIdentitiesInput,
) -> RusotoFuture<ListIdentitiesResponse, ListIdentitiesError>;
fn list_identity_pools(
&self,
input: ListIdentityPoolsInput,
) -> RusotoFuture<ListIdentityPoolsResponse, ListIdentityPoolsError>;
fn list_tags_for_resource(
&self,
input: ListTagsForResourceInput,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError>;
fn lookup_developer_identity(
&self,
input: LookupDeveloperIdentityInput,
) -> RusotoFuture<LookupDeveloperIdentityResponse, LookupDeveloperIdentityError>;
fn merge_developer_identities(
&self,
input: MergeDeveloperIdentitiesInput,
) -> RusotoFuture<MergeDeveloperIdentitiesResponse, MergeDeveloperIdentitiesError>;
fn set_identity_pool_roles(
&self,
input: SetIdentityPoolRolesInput,
) -> RusotoFuture<(), SetIdentityPoolRolesError>;
fn tag_resource(
&self,
input: TagResourceInput,
) -> RusotoFuture<TagResourceResponse, TagResourceError>;
fn unlink_developer_identity(
&self,
input: UnlinkDeveloperIdentityInput,
) -> RusotoFuture<(), UnlinkDeveloperIdentityError>;
fn unlink_identity(&self, input: UnlinkIdentityInput) -> RusotoFuture<(), UnlinkIdentityError>;
fn untag_resource(
&self,
input: UntagResourceInput,
) -> RusotoFuture<UntagResourceResponse, UntagResourceError>;
fn update_identity_pool(
&self,
input: IdentityPool,
) -> RusotoFuture<IdentityPool, 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,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
CognitoIdentityClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl CognitoIdentity for CognitoIdentityClient {
fn create_identity_pool(
&self,
input: CreateIdentityPoolInput,
) -> RusotoFuture<IdentityPool, CreateIdentityPoolError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.CreateIdentityPool",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response).deserialize::<IdentityPool, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateIdentityPoolError::from_response(response))),
)
}
})
}
fn delete_identities(
&self,
input: DeleteIdentitiesInput,
) -> RusotoFuture<DeleteIdentitiesResponse, DeleteIdentitiesError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSCognitoIdentityService.DeleteIdentities");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteIdentitiesResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteIdentitiesError::from_response(response))),
)
}
})
}
fn delete_identity_pool(
&self,
input: DeleteIdentityPoolInput,
) -> RusotoFuture<(), DeleteIdentityPoolError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.DeleteIdentityPool",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteIdentityPoolError::from_response(response))),
)
}
})
}
fn describe_identity(
&self,
input: DescribeIdentityInput,
) -> RusotoFuture<IdentityDescription, DescribeIdentityError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSCognitoIdentityService.DescribeIdentity");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<IdentityDescription, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeIdentityError::from_response(response))),
)
}
})
}
fn describe_identity_pool(
&self,
input: DescribeIdentityPoolInput,
) -> RusotoFuture<IdentityPool, DescribeIdentityPoolError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.DescribeIdentityPool",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response).deserialize::<IdentityPool, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeIdentityPoolError::from_response(response))
}),
)
}
})
}
fn get_credentials_for_identity(
&self,
input: GetCredentialsForIdentityInput,
) -> RusotoFuture<GetCredentialsForIdentityResponse, GetCredentialsForIdentityError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.GetCredentialsForIdentity",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetCredentialsForIdentityResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetCredentialsForIdentityError::from_response(response))
}))
}
})
}
fn get_id(&self, input: GetIdInput) -> RusotoFuture<GetIdResponse, GetIdError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSCognitoIdentityService.GetId");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response).deserialize::<GetIdResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetIdError::from_response(response))),
)
}
})
}
fn get_identity_pool_roles(
&self,
input: GetIdentityPoolRolesInput,
) -> RusotoFuture<GetIdentityPoolRolesResponse, GetIdentityPoolRolesError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.GetIdentityPoolRoles",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetIdentityPoolRolesResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetIdentityPoolRolesError::from_response(response))
}),
)
}
})
}
fn get_open_id_token(
&self,
input: GetOpenIdTokenInput,
) -> RusotoFuture<GetOpenIdTokenResponse, GetOpenIdTokenError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSCognitoIdentityService.GetOpenIdToken");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetOpenIdTokenResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetOpenIdTokenError::from_response(response))),
)
}
})
}
fn get_open_id_token_for_developer_identity(
&self,
input: GetOpenIdTokenForDeveloperIdentityInput,
) -> RusotoFuture<
GetOpenIdTokenForDeveloperIdentityResponse,
GetOpenIdTokenForDeveloperIdentityError,
> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.GetOpenIdTokenForDeveloperIdentity",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetOpenIdTokenForDeveloperIdentityResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetOpenIdTokenForDeveloperIdentityError::from_response(
response,
))
}))
}
})
}
fn list_identities(
&self,
input: ListIdentitiesInput,
) -> RusotoFuture<ListIdentitiesResponse, ListIdentitiesError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSCognitoIdentityService.ListIdentities");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListIdentitiesResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListIdentitiesError::from_response(response))),
)
}
})
}
fn list_identity_pools(
&self,
input: ListIdentityPoolsInput,
) -> RusotoFuture<ListIdentityPoolsResponse, ListIdentityPoolsError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.ListIdentityPools",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListIdentityPoolsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListIdentityPoolsError::from_response(response))),
)
}
})
}
fn list_tags_for_resource(
&self,
input: ListTagsForResourceInput,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.ListTagsForResource",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsForResourceResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListTagsForResourceError::from_response(response))
}),
)
}
})
}
fn lookup_developer_identity(
&self,
input: LookupDeveloperIdentityInput,
) -> RusotoFuture<LookupDeveloperIdentityResponse, LookupDeveloperIdentityError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.LookupDeveloperIdentity",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<LookupDeveloperIdentityResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(LookupDeveloperIdentityError::from_response(response))
}))
}
})
}
fn merge_developer_identities(
&self,
input: MergeDeveloperIdentitiesInput,
) -> RusotoFuture<MergeDeveloperIdentitiesResponse, MergeDeveloperIdentitiesError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.MergeDeveloperIdentities",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<MergeDeveloperIdentitiesResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(MergeDeveloperIdentitiesError::from_response(response))
}))
}
})
}
fn set_identity_pool_roles(
&self,
input: SetIdentityPoolRolesInput,
) -> RusotoFuture<(), SetIdentityPoolRolesError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.SetIdentityPoolRoles",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(SetIdentityPoolRolesError::from_response(response))
}),
)
}
})
}
fn tag_resource(
&self,
input: TagResourceInput,
) -> RusotoFuture<TagResourceResponse, TagResourceError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSCognitoIdentityService.TagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<TagResourceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TagResourceError::from_response(response))),
)
}
})
}
fn unlink_developer_identity(
&self,
input: UnlinkDeveloperIdentityInput,
) -> RusotoFuture<(), UnlinkDeveloperIdentityError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.UnlinkDeveloperIdentity",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UnlinkDeveloperIdentityError::from_response(response))
}))
}
})
}
fn unlink_identity(&self, input: UnlinkIdentityInput) -> RusotoFuture<(), UnlinkIdentityError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSCognitoIdentityService.UnlinkIdentity");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UnlinkIdentityError::from_response(response))),
)
}
})
}
fn untag_resource(
&self,
input: UntagResourceInput,
) -> RusotoFuture<UntagResourceResponse, UntagResourceError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSCognitoIdentityService.UntagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UntagResourceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UntagResourceError::from_response(response))),
)
}
})
}
fn update_identity_pool(
&self,
input: IdentityPool,
) -> RusotoFuture<IdentityPool, UpdateIdentityPoolError> {
let mut request = SignedRequest::new("POST", "cognito-identity", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSCognitoIdentityService.UpdateIdentityPool",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response).deserialize::<IdentityPool, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateIdentityPoolError::from_response(response))),
)
}
})
}
}