{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.MigrationHub.Types
(
migrationHub
, _AccessDeniedException
, _DryRunOperation
, _PolicyErrorException
, _InternalServerError
, _InvalidInputException
, _ServiceUnavailableException
, _ResourceNotFoundException
, _UnauthorizedOperation
, ApplicationStatus (..)
, MigrationStatus (..)
, ResourceAttributeType (..)
, CreatedArtifact
, createdArtifact
, caDescription
, caName
, DiscoveredResource
, discoveredResource
, drDescription
, drConfigurationId
, MigrationTask
, migrationTask
, mtUpdateDateTime
, mtResourceAttributeList
, mtTask
, mtProgressUpdateStream
, mtMigrationTaskName
, MigrationTaskSummary
, migrationTaskSummary
, mtsStatus
, mtsUpdateDateTime
, mtsProgressPercent
, mtsStatusDetail
, mtsProgressUpdateStream
, mtsMigrationTaskName
, ProgressUpdateStreamSummary
, progressUpdateStreamSummary
, pussProgressUpdateStreamName
, ResourceAttribute
, resourceAttribute
, raType
, raValue
, Task
, task
, tProgressPercent
, tStatusDetail
, tStatus
) where
import Network.AWS.Lens
import Network.AWS.MigrationHub.Types.Product
import Network.AWS.MigrationHub.Types.Sum
import Network.AWS.Prelude
import Network.AWS.Sign.V4
migrationHub :: Service
migrationHub =
Service
{ _svcAbbrev = "MigrationHub"
, _svcSigner = v4
, _svcPrefix = "mgh"
, _svcVersion = "2017-05-31"
, _svcEndpoint = defaultEndpoint migrationHub
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "MigrationHub"
, _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
_AccessDeniedException :: AsError a => Getting (First ServiceError) a ServiceError
_AccessDeniedException = _MatchServiceError migrationHub "AccessDeniedException"
_DryRunOperation :: AsError a => Getting (First ServiceError) a ServiceError
_DryRunOperation = _MatchServiceError migrationHub "DryRunOperation"
_PolicyErrorException :: AsError a => Getting (First ServiceError) a ServiceError
_PolicyErrorException = _MatchServiceError migrationHub "PolicyErrorException"
_InternalServerError :: AsError a => Getting (First ServiceError) a ServiceError
_InternalServerError = _MatchServiceError migrationHub "InternalServerError"
_InvalidInputException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidInputException = _MatchServiceError migrationHub "InvalidInputException"
_ServiceUnavailableException :: AsError a => Getting (First ServiceError) a ServiceError
_ServiceUnavailableException =
_MatchServiceError migrationHub "ServiceUnavailableException"
_ResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_ResourceNotFoundException =
_MatchServiceError migrationHub "ResourceNotFoundException"
_UnauthorizedOperation :: AsError a => Getting (First ServiceError) a ServiceError
_UnauthorizedOperation = _MatchServiceError migrationHub "UnauthorizedOperation"