{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.KinesisVideoArchivedMedia.Types
(
kinesisVideoArchivedMedia
, _InvalidArgumentException
, _NotAuthorizedException
, _ClientLimitExceededException
, _ResourceNotFoundException
, FragmentSelectorType (..)
, Fragment
, fragment
, fFragmentLengthInMilliseconds
, fServerTimestamp
, fFragmentSizeInBytes
, fFragmentNumber
, fProducerTimestamp
, FragmentSelector
, fragmentSelector
, fsFragmentSelectorType
, fsTimestampRange
, TimestampRange
, timestampRange
, trStartTimestamp
, trEndTimestamp
) where
import Network.AWS.KinesisVideoArchivedMedia.Types.Product
import Network.AWS.KinesisVideoArchivedMedia.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
kinesisVideoArchivedMedia :: Service
kinesisVideoArchivedMedia =
Service
{ _svcAbbrev = "KinesisVideoArchivedMedia"
, _svcSigner = v4
, _svcPrefix = "kinesisvideo"
, _svcVersion = "2017-09-30"
, _svcEndpoint = defaultEndpoint kinesisVideoArchivedMedia
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "KinesisVideoArchivedMedia"
, _svcRetry = retry
}
where
retry =
Exponential
{ _retryBase = 5.0e-2
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check e
| has (hasCode "ThrottledException" . hasStatus 400) e =
Just "throttled_exception"
| 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 (hasCode "RequestThrottledException" . hasStatus 400) e =
Just "request_throttled_exception"
| 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
_InvalidArgumentException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidArgumentException =
_MatchServiceError kinesisVideoArchivedMedia "InvalidArgumentException" .
hasStatus 400
_NotAuthorizedException :: AsError a => Getting (First ServiceError) a ServiceError
_NotAuthorizedException =
_MatchServiceError kinesisVideoArchivedMedia "NotAuthorizedException" .
hasStatus 401
_ClientLimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_ClientLimitExceededException =
_MatchServiceError kinesisVideoArchivedMedia "ClientLimitExceededException" .
hasStatus 400
_ResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_ResourceNotFoundException =
_MatchServiceError kinesisVideoArchivedMedia "ResourceNotFoundException" .
hasStatus 404