{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.SES.Types
    (
    
      ses
    
    , _InvalidConfigurationSetException
    , _CannotDeleteException
    , _RuleDoesNotExistException
    , _MessageRejected
    , _RuleSetDoesNotExistException
    , _MailFromDomainNotVerifiedException
    , _InvalidFirehoseDestinationException
    , _ConfigurationSetAlreadyExistsException
    , _EventDestinationDoesNotExistException
    , _InvalidCloudWatchDestinationException
    , _InvalidLambdaFunctionException
    , _ConfigurationSetDoesNotExistException
    , _InvalidPolicyException
    , _InvalidS3ConfigurationException
    , _InvalidSNSTopicException
    , _EventDestinationAlreadyExistsException
    , _AlreadyExistsException
    , _LimitExceededException
    
    , BehaviorOnMXFailure (..)
    
    , BounceType (..)
    
    , ConfigurationSetAttribute (..)
    
    , CustomMailFromStatus (..)
    
    , DimensionValueSource (..)
    
    , DsnAction (..)
    
    , EventType (..)
    
    , IdentityType (..)
    
    , InvocationType (..)
    
    , NotificationType (..)
    
    , ReceiptFilterPolicy (..)
    
    , SNSActionEncoding (..)
    
    , StopScope (..)
    
    , TLSPolicy (..)
    
    , VerificationStatus (..)
    
    , AddHeaderAction
    , addHeaderAction
    , ahaHeaderName
    , ahaHeaderValue
    
    , Body
    , body
    , bText
    , bHTML
    
    , BounceAction
    , bounceAction
    , baTopicARN
    , baStatusCode
    , baSmtpReplyCode
    , baMessage
    , baSender
    
    , BouncedRecipientInfo
    , bouncedRecipientInfo
    , briBounceType
    , briRecipientDsnFields
    , briRecipientARN
    , briRecipient
    
    , CloudWatchDestination
    , cloudWatchDestination
    , cwdDimensionConfigurations
    
    , CloudWatchDimensionConfiguration
    , cloudWatchDimensionConfiguration
    , cwdcDimensionName
    , cwdcDimensionValueSource
    , cwdcDefaultDimensionValue
    
    , ConfigurationSet
    , configurationSet
    , csName
    
    , Content
    , content
    , cCharset
    , cData
    
    , Destination
    , destination
    , dBCCAddresses
    , dCCAddresses
    , dToAddresses
    
    , EventDestination
    , eventDestination
    , edEnabled
    , edKinesisFirehoseDestination
    , edCloudWatchDestination
    , edName
    , edMatchingEventTypes
    
    , ExtensionField
    , extensionField
    , efName
    , efValue
    
    , IdentityDkimAttributes
    , identityDkimAttributes
    , idaDkimTokens
    , idaDkimEnabled
    , idaDkimVerificationStatus
    
    , IdentityMailFromDomainAttributes
    , identityMailFromDomainAttributes
    , imfdaMailFromDomain
    , imfdaMailFromDomainStatus
    , imfdaBehaviorOnMXFailure
    
    , IdentityNotificationAttributes
    , identityNotificationAttributes
    , inaHeadersInDeliveryNotificationsEnabled
    , inaHeadersInComplaintNotificationsEnabled
    , inaHeadersInBounceNotificationsEnabled
    , inaBounceTopic
    , inaComplaintTopic
    , inaDeliveryTopic
    , inaForwardingEnabled
    
    , IdentityVerificationAttributes
    , identityVerificationAttributes
    , ivaVerificationToken
    , ivaVerificationStatus
    
    , KinesisFirehoseDestination
    , kinesisFirehoseDestination
    , kfdIAMRoleARN
    , kfdDeliveryStreamARN
    
    , LambdaAction
    , lambdaAction
    , laInvocationType
    , laTopicARN
    , laFunctionARN
    
    , Message
    , message
    , mSubject
    , mBody
    
    , MessageDsn
    , messageDsn
    , mdArrivalDate
    , mdExtensionFields
    , mdReportingMta
    
    , MessageTag
    , messageTag
    , mtName
    , mtValue
    
    , RawMessage
    , rawMessage
    , rmData
    
    , ReceiptAction
    , receiptAction
    , raAddHeaderAction
    , raSNSAction
    , raWorkmailAction
    , raBounceAction
    , raLambdaAction
    , raStopAction
    , raS3Action
    
    , ReceiptFilter
    , receiptFilter
    , rfName
    , rfIPFilter
    
    , ReceiptIPFilter
    , receiptIPFilter
    , rifPolicy
    , rifCidr
    
    , ReceiptRule
    , receiptRule
    , rrScanEnabled
    , rrEnabled
    , rrActions
    , rrRecipients
    , rrTLSPolicy
    , rrName
    
    , ReceiptRuleSetMetadata
    , receiptRuleSetMetadata
    , rrsmName
    , rrsmCreatedTimestamp
    
    , RecipientDsnFields
    , recipientDsnFields
    , rdfDiagnosticCode
    , rdfRemoteMta
    , rdfFinalRecipient
    , rdfExtensionFields
    , rdfLastAttemptDate
    , rdfAction
    , rdfStatus
    
    , S3Action
    , s3Action
    , s3KMSKeyARN
    , s3TopicARN
    , s3ObjectKeyPrefix
    , s3BucketName
    
    , SNSAction
    , snsAction
    , saEncoding
    , saTopicARN
    
    , SendDataPoint
    , sendDataPoint
    , sdpRejects
    , sdpComplaints
    , sdpDeliveryAttempts
    , sdpBounces
    , sdpTimestamp
    
    , StopAction
    , stopAction
    , sTopicARN
    , sScope
    
    , WorkmailAction
    , workmailAction
    , waTopicARN
    , waOrganizationARN
    ) where
import           Network.AWS.Lens
import           Network.AWS.Prelude
import           Network.AWS.SES.Types.Product
import           Network.AWS.SES.Types.Sum
import           Network.AWS.Sign.V4
ses :: Service
ses =
    Service
    { _svcAbbrev = "SES"
    , _svcSigner = v4
    , _svcPrefix = "email"
    , _svcVersion = "2010-12-01"
    , _svcEndpoint = defaultEndpoint ses
    , _svcTimeout = Just 70
    , _svcCheck = statusSuccess
    , _svcError = parseXMLError "SES"
    , _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
_InvalidConfigurationSetException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidConfigurationSetException =
    _ServiceError . hasStatus 400 . hasCode "InvalidConfigurationSet"
_CannotDeleteException :: AsError a => Getting (First ServiceError) a ServiceError
_CannotDeleteException = _ServiceError . hasStatus 400 . hasCode "CannotDelete"
_RuleDoesNotExistException :: AsError a => Getting (First ServiceError) a ServiceError
_RuleDoesNotExistException =
    _ServiceError . hasStatus 400 . hasCode "RuleDoesNotExist"
_MessageRejected :: AsError a => Getting (First ServiceError) a ServiceError
_MessageRejected = _ServiceError . hasStatus 400 . hasCode "MessageRejected"
_RuleSetDoesNotExistException :: AsError a => Getting (First ServiceError) a ServiceError
_RuleSetDoesNotExistException =
    _ServiceError . hasStatus 400 . hasCode "RuleSetDoesNotExist"
_MailFromDomainNotVerifiedException :: AsError a => Getting (First ServiceError) a ServiceError
_MailFromDomainNotVerifiedException =
    _ServiceError .
    hasStatus 400 . hasCode "MailFromDomainNotVerifiedException"
_InvalidFirehoseDestinationException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidFirehoseDestinationException =
    _ServiceError . hasStatus 400 . hasCode "InvalidFirehoseDestination"
_ConfigurationSetAlreadyExistsException :: AsError a => Getting (First ServiceError) a ServiceError
_ConfigurationSetAlreadyExistsException =
    _ServiceError . hasStatus 400 . hasCode "ConfigurationSetAlreadyExists"
_EventDestinationDoesNotExistException :: AsError a => Getting (First ServiceError) a ServiceError
_EventDestinationDoesNotExistException =
    _ServiceError . hasStatus 400 . hasCode "EventDestinationDoesNotExist"
_InvalidCloudWatchDestinationException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidCloudWatchDestinationException =
    _ServiceError . hasStatus 400 . hasCode "InvalidCloudWatchDestination"
_InvalidLambdaFunctionException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidLambdaFunctionException =
    _ServiceError . hasStatus 400 . hasCode "InvalidLambdaFunction"
_ConfigurationSetDoesNotExistException :: AsError a => Getting (First ServiceError) a ServiceError
_ConfigurationSetDoesNotExistException =
    _ServiceError . hasStatus 400 . hasCode "ConfigurationSetDoesNotExist"
_InvalidPolicyException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidPolicyException =
    _ServiceError . hasStatus 400 . hasCode "InvalidPolicy"
_InvalidS3ConfigurationException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidS3ConfigurationException =
    _ServiceError . hasStatus 400 . hasCode "InvalidS3Configuration"
_InvalidSNSTopicException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidSNSTopicException =
    _ServiceError . hasStatus 400 . hasCode "InvalidSnsTopic"
_EventDestinationAlreadyExistsException :: AsError a => Getting (First ServiceError) a ServiceError
_EventDestinationAlreadyExistsException =
    _ServiceError . hasStatus 400 . hasCode "EventDestinationAlreadyExists"
_AlreadyExistsException :: AsError a => Getting (First ServiceError) a ServiceError
_AlreadyExistsException =
    _ServiceError . hasStatus 400 . hasCode "AlreadyExists"
_LimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_LimitExceededException =
    _ServiceError . hasStatus 400 . hasCode "LimitExceeded"