{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.CognitoIdentity.Types
(
cognitoIdentity
, _InvalidIdentityPoolConfigurationException
, _InvalidParameterException
, _NotAuthorizedException
, _InternalErrorException
, _ExternalServiceException
, _TooManyRequestsException
, _ConcurrentModificationException
, _ResourceConflictException
, _DeveloperUserAlreadyRegisteredException
, _ResourceNotFoundException
, _LimitExceededException
, CognitoErrorCode (..)
, CognitoIdentityProvider
, cognitoIdentityProvider
, cipClientId
, cipProviderName
, Credentials
, credentials
, cSessionToken
, cExpiration
, cSecretKey
, cAccessKeyId
, IdentityDescription
, identityDescription
, idLastModifiedDate
, idCreationDate
, idLogins
, idIdentityId
, IdentityPool
, identityPool
, ipSamlProviderARNs
, ipSupportedLoginProviders
, ipDeveloperProviderName
, ipOpenIdConnectProviderARNs
, ipCognitoIdentityProviders
, ipIdentityPoolId
, ipIdentityPoolName
, ipAllowUnauthenticatedIdentities
, IdentityPoolShortDescription
, identityPoolShortDescription
, ipsdIdentityPoolId
, ipsdIdentityPoolName
, UnprocessedIdentityId
, unprocessedIdentityId
, uiiErrorCode
, uiiIdentityId
) where
import Network.AWS.CognitoIdentity.Types.Product
import Network.AWS.CognitoIdentity.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
cognitoIdentity :: Service
cognitoIdentity =
Service
{ _svcAbbrev = "CognitoIdentity"
, _svcSigner = v4
, _svcPrefix = "cognito-identity"
, _svcVersion = "2014-06-30"
, _svcEndpoint = defaultEndpoint cognitoIdentity
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "CognitoIdentity"
, _svcRetry = retry
}
where
retry =
Exponential
{ _retryBase = 5.0e-2
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check e
| has (hasStatus 429) e = Just "too_many_requests"
| has (hasCode "ThrottlingException" . hasStatus 400) e =
Just "throttling_exception"
| has (hasCode "Throttling" . hasStatus 400) e = Just "throttling"
| has (hasStatus 504) e = Just "gateway_timeout"
| has (hasStatus 502) e = Just "bad_gateway"
| has (hasStatus 503) e = Just "service_unavailable"
| has (hasStatus 500) e = Just "general_server_error"
| has (hasStatus 509) e = Just "limit_exceeded"
| otherwise = Nothing
_InvalidIdentityPoolConfigurationException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidIdentityPoolConfigurationException =
_ServiceError . hasCode "InvalidIdentityPoolConfigurationException"
_InvalidParameterException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidParameterException =
_ServiceError . hasCode "InvalidParameterException"
_NotAuthorizedException :: AsError a => Getting (First ServiceError) a ServiceError
_NotAuthorizedException = _ServiceError . hasCode "NotAuthorizedException"
_InternalErrorException :: AsError a => Getting (First ServiceError) a ServiceError
_InternalErrorException = _ServiceError . hasCode "InternalErrorException"
_ExternalServiceException :: AsError a => Getting (First ServiceError) a ServiceError
_ExternalServiceException = _ServiceError . hasCode "ExternalServiceException"
_TooManyRequestsException :: AsError a => Getting (First ServiceError) a ServiceError
_TooManyRequestsException = _ServiceError . hasCode "TooManyRequestsException"
_ConcurrentModificationException :: AsError a => Getting (First ServiceError) a ServiceError
_ConcurrentModificationException =
_ServiceError . hasCode "ConcurrentModificationException"
_ResourceConflictException :: AsError a => Getting (First ServiceError) a ServiceError
_ResourceConflictException =
_ServiceError . hasCode "ResourceConflictException"
_DeveloperUserAlreadyRegisteredException :: AsError a => Getting (First ServiceError) a ServiceError
_DeveloperUserAlreadyRegisteredException =
_ServiceError . hasCode "DeveloperUserAlreadyRegisteredException"
_ResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_ResourceNotFoundException =
_ServiceError . hasCode "ResourceNotFoundException"
_LimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_LimitExceededException = _ServiceError . hasCode "LimitExceededException"