{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.Pinpoint.Types
(
pinpoint
, _ForbiddenException
, _NotFoundException
, _TooManyRequestsException
, _InternalServerErrorException
, _MethodNotAllowedException
, _BadRequestException
, Action (..)
, AttributeType (..)
, CampaignStatus (..)
, ChannelType (..)
, DefinitionFormat (..)
, DimensionType (..)
, Duration (..)
, Frequency (..)
, JobStatus (..)
, RecencyType (..)
, SegmentType (..)
, APNSChannelRequest
, apnsChannelRequest
, acrPrivateKey
, acrCertificate
, APNSChannelResponse
, apnsChannelResponse
, acPlatform
, acLastModifiedDate
, acIsArchived
, acApplicationId
, acVersion
, acId
, acCreationDate
, acLastModifiedBy
, ActivitiesResponse
, activitiesResponse
, aItem
, ActivityResponse
, activityResponse
, aState
, aStart
, aCampaignId
, aResult
, aTreatmentId
, aSuccessfulEndpointCount
, aEnd
, aApplicationId
, aTotalEndpointCount
, aId
, aScheduledStart
, ApplicationSettingsResource
, applicationSettingsResource
, asrLastModifiedDate
, asrLimits
, asrQuietTime
, asrApplicationId
, AttributeDimension
, attributeDimension
, adValues
, adAttributeType
, CampaignLimits
, campaignLimits
, clDaily
, clTotal
, CampaignResponse
, campaignResponse
, cState
, cLastModifiedDate
, cSchedule
, cTreatmentName
, cLimits
, cIsPaused
, cDefaultState
, cApplicationId
, cName
, cVersion
, cHoldoutPercent
, cTreatmentDescription
, cId
, cCreationDate
, cMessageConfiguration
, cDescription
, cSegmentId
, cAdditionalTreatments
, cSegmentVersion
, CampaignState
, campaignState
, csCampaignStatus
, CampaignsResponse
, campaignsResponse
, cNextToken
, cItem
, EndpointBatchItem
, endpointBatchItem
, ebiRequestId
, ebiMetrics
, ebiLocation
, ebiDemographic
, ebiAddress
, ebiEffectiveDate
, ebiUser
, ebiAttributes
, ebiEndpointStatus
, ebiOptOut
, ebiId
, ebiChannelType
, EndpointBatchRequest
, endpointBatchRequest
, ebrItem
, EndpointDemographic
, endpointDemographic
, edPlatform
, edPlatformVersion
, edLocale
, edAppVersion
, edModel
, edMake
, edModelVersion
, edTimezone
, EndpointLocation
, endpointLocation
, elPostalCode
, elLatitude
, elCountry
, elCity
, elRegion
, elLongitude
, EndpointRequest
, endpointRequest
, erRequestId
, erMetrics
, erLocation
, erDemographic
, erAddress
, erEffectiveDate
, erUser
, erAttributes
, erEndpointStatus
, erOptOut
, erChannelType
, EndpointResponse
, endpointResponse
, eRequestId
, eMetrics
, eLocation
, eDemographic
, eCohortId
, eAddress
, eEffectiveDate
, eUser
, eApplicationId
, eAttributes
, eEndpointStatus
, eOptOut
, eId
, eCreationDate
, eChannelType
, eShardId
, EndpointUser
, endpointUser
, euUserAttributes
, euUserId
, GCMChannelRequest
, gcmChannelRequest
, gcrAPIKey
, GCMChannelResponse
, gcmChannelResponse
, gcPlatform
, gcLastModifiedDate
, gcCredential
, gcIsArchived
, gcApplicationId
, gcVersion
, gcId
, gcCreationDate
, gcLastModifiedBy
, ImportJobRequest
, importJobRequest
, iSegmentName
, iFormat
, iDefineSegment
, iRegisterEndpoints
, iExternalId
, iS3URL
, iSegmentId
, iRoleARN
, ImportJobResource
, importJobResource
, ijrSegmentName
, ijrFormat
, ijrDefineSegment
, ijrRegisterEndpoints
, ijrExternalId
, ijrS3URL
, ijrSegmentId
, ijrRoleARN
, ImportJobResponse
, importJobResponse
, ijCompletedPieces
, ijFailedPieces
, ijDefinition
, ijTotalProcessed
, ijFailures
, ijTotalPieces
, ijApplicationId
, ijId
, ijCreationDate
, ijType
, ijCompletionDate
, ijJobStatus
, ijTotalFailures
, ImportJobsResponse
, importJobsResponse
, ijNextToken
, ijItem
, Message
, message
, mSilentPush
, mImageIconURL
, mBody
, mJSONBody
, mURL
, mAction
, mImageURL
, mMediaURL
, mTitle
, MessageBody
, messageBody
, mbRequestId
, mbMessage
, MessageConfiguration
, messageConfiguration
, mcAPNSMessage
, mcGCMMessage
, mcDefaultMessage
, QuietTime
, quietTime
, qtStart
, qtEnd
, RecencyDimension
, recencyDimension
, rdRecencyType
, rdDuration
, Schedule
, schedule
, sFrequency
, sStartTime
, sQuietTime
, sIsLocalTime
, sEndTime
, sTimezone
, SegmentBehaviors
, segmentBehaviors
, sbRecency
, SegmentDemographics
, segmentDemographics
, sdPlatform
, sdAppVersion
, sdModel
, sdMake
, sdDeviceType
, SegmentDimensions
, segmentDimensions
, sdLocation
, sdDemographic
, sdBehavior
, sdAttributes
, SegmentImportResource
, segmentImportResource
, sirSize
, sirFormat
, sirExternalId
, sirS3URL
, sirRoleARN
, SegmentLocation
, segmentLocation
, slCountry
, SegmentResponse
, segmentResponse
, sLastModifiedDate
, sSegmentType
, sApplicationId
, sName
, sVersion
, sId
, sCreationDate
, sImportDefinition
, sDimensions
, SegmentsResponse
, segmentsResponse
, sNextToken
, sItem
, SetDimension
, setDimension
, sdValues
, sdDimensionType
, TreatmentResource
, treatmentResource
, trState
, trSchedule
, trTreatmentName
, trSizePercent
, trTreatmentDescription
, trId
, trMessageConfiguration
, WriteApplicationSettingsRequest
, writeApplicationSettingsRequest
, wasrLimits
, wasrQuietTime
, WriteCampaignRequest
, writeCampaignRequest
, wcrSchedule
, wcrTreatmentName
, wcrLimits
, wcrIsPaused
, wcrName
, wcrHoldoutPercent
, wcrTreatmentDescription
, wcrMessageConfiguration
, wcrDescription
, wcrSegmentId
, wcrAdditionalTreatments
, wcrSegmentVersion
, WriteSegmentRequest
, writeSegmentRequest
, wsrName
, wsrDimensions
, WriteTreatmentResource
, writeTreatmentResource
, wtrSchedule
, wtrTreatmentName
, wtrSizePercent
, wtrTreatmentDescription
, wtrMessageConfiguration
) where
import Network.AWS.Lens
import Network.AWS.Pinpoint.Types.Product
import Network.AWS.Pinpoint.Types.Sum
import Network.AWS.Prelude
import Network.AWS.Sign.V4
pinpoint :: Service
pinpoint =
Service
{ _svcAbbrev = "Pinpoint"
, _svcSigner = v4
, _svcPrefix = "pinpoint"
, _svcVersion = "2016-12-01"
, _svcEndpoint = defaultEndpoint pinpoint
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "Pinpoint"
, _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
_ForbiddenException :: AsError a => Getting (First ServiceError) a ServiceError
_ForbiddenException =
_ServiceError . hasStatus 403 . hasCode "ForbiddenException"
_NotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_NotFoundException =
_ServiceError . hasStatus 404 . hasCode "NotFoundException"
_TooManyRequestsException :: AsError a => Getting (First ServiceError) a ServiceError
_TooManyRequestsException =
_ServiceError . hasStatus 429 . hasCode "TooManyRequestsException"
_InternalServerErrorException :: AsError a => Getting (First ServiceError) a ServiceError
_InternalServerErrorException =
_ServiceError . hasStatus 500 . hasCode "InternalServerErrorException"
_MethodNotAllowedException :: AsError a => Getting (First ServiceError) a ServiceError
_MethodNotAllowedException =
_ServiceError . hasStatus 405 . hasCode "MethodNotAllowedException"
_BadRequestException :: AsError a => Getting (First ServiceError) a ServiceError
_BadRequestException =
_ServiceError . hasStatus 400 . hasCode "BadRequestException"