module Network.AWS.STS.Types
(
sts
, _MalformedPolicyDocumentException
, _InvalidAuthorizationMessageException
, _PackedPolicyTooLargeException
, _RegionDisabledException
, _IdPCommunicationErrorException
, _InvalidIdentityTokenException
, _ExpiredTokenException
, _IdPRejectedClaimException
, AssumedRoleUser
, assumedRoleUser
, aruAssumedRoleId
, aruARN
, Credentials
, credentials
, cAccessKeyId
, cSecretAccessKey
, cSessionToken
, cExpiration
, FederatedUser
, federatedUser
, fuFederatedUserId
, fuARN
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
import Network.AWS.STS.Types.Product
import Network.AWS.STS.Types.Sum
sts :: Service
sts =
Service
{ _svcAbbrev = "STS"
, _svcSigner = v4
, _svcPrefix = "sts"
, _svcVersion = "2011-06-15"
, _svcEndpoint = defaultEndpoint sts
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseXMLError
, _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 503) e = Just "service_unavailable"
| has (hasStatus 500) e = Just "general_server_error"
| has (hasStatus 509) e = Just "limit_exceeded"
| otherwise = Nothing
_MalformedPolicyDocumentException :: AsError a => Getting (First ServiceError) a ServiceError
_MalformedPolicyDocumentException =
_ServiceError . hasStatus 400 . hasCode "MalformedPolicyDocument"
_InvalidAuthorizationMessageException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidAuthorizationMessageException =
_ServiceError .
hasStatus 400 . hasCode "InvalidAuthorizationMessageException"
_PackedPolicyTooLargeException :: AsError a => Getting (First ServiceError) a ServiceError
_PackedPolicyTooLargeException =
_ServiceError . hasStatus 400 . hasCode "PackedPolicyTooLarge"
_RegionDisabledException :: AsError a => Getting (First ServiceError) a ServiceError
_RegionDisabledException =
_ServiceError . hasStatus 403 . hasCode "RegionDisabledException"
_IdPCommunicationErrorException :: AsError a => Getting (First ServiceError) a ServiceError
_IdPCommunicationErrorException =
_ServiceError . hasStatus 400 . hasCode "IDPCommunicationError"
_InvalidIdentityTokenException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidIdentityTokenException =
_ServiceError . hasStatus 400 . hasCode "InvalidIdentityToken"
_ExpiredTokenException :: AsError a => Getting (First ServiceError) a ServiceError
_ExpiredTokenException =
_ServiceError . hasStatus 400 . hasCode "ExpiredTokenException"
_IdPRejectedClaimException :: AsError a => Getting (First ServiceError) a ServiceError
_IdPRejectedClaimException =
_ServiceError . hasStatus 403 . hasCode "IDPRejectedClaim"