{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.Greengrass.Types
(
greengrass
, _InternalServerErrorException
, _BadRequestException
, DeploymentType (..)
, EncodingType (..)
, LoggerComponent (..)
, LoggerLevel (..)
, LoggerType (..)
, Permission (..)
, SoftwareToUpdate (..)
, UpdateAgentLogLevel (..)
, UpdateTargetsArchitecture (..)
, UpdateTargetsOperatingSystem (..)
, ConnectivityInfo
, connectivityInfo
, ciPortNumber
, ciId
, ciMetadata
, ciHostAddress
, Core
, core
, cCertificateARN
, cThingARN
, cSyncShadow
, cId
, CoreDefinitionVersion
, coreDefinitionVersion
, cdvCores
, DefinitionInformation
, definitionInformation
, diLatestVersionARN
, diARN
, diName
, diCreationTimestamp
, diId
, diLatestVersion
, diLastUpdatedTimestamp
, Deployment
, deployment
, dDeploymentId
, dDeploymentARN
, dCreatedAt
, dDeploymentType
, dGroupARN
, Device
, device
, dCertificateARN
, dThingARN
, dSyncShadow
, dId
, DeviceDefinitionVersion
, deviceDefinitionVersion
, ddvDevices
, ErrorDetail
, errorDetail
, edDetailedErrorCode
, edDetailedErrorMessage
, Function
, function
, fFunctionARN
, fFunctionConfiguration
, fId
, FunctionConfiguration
, functionConfiguration
, fcMemorySize
, fcExecArgs
, fcEnvironment
, fcExecutable
, fcPinned
, fcEncodingType
, fcTimeout
, FunctionConfigurationEnvironment
, functionConfigurationEnvironment
, fceVariables
, fceResourceAccessPolicies
, fceAccessSysfs
, FunctionDefinitionVersion
, functionDefinitionVersion
, fdvFunctions
, GreengrassLogger
, greengrassLogger
, glSpace
, glComponent
, glId
, glType
, glLevel
, GroupCertificateAuthorityProperties
, groupCertificateAuthorityProperties
, gcapGroupCertificateAuthorityARN
, gcapGroupCertificateAuthorityId
, GroupInformation
, groupInformation
, giLatestVersionARN
, giARN
, giName
, giCreationTimestamp
, giId
, giLatestVersion
, giLastUpdatedTimestamp
, GroupOwnerSetting
, groupOwnerSetting
, gosAutoAddGroupOwner
, gosGroupOwner
, GroupVersion
, groupVersion
, gvResourceDefinitionVersionARN
, gvSubscriptionDefinitionVersionARN
, gvCoreDefinitionVersionARN
, gvDeviceDefinitionVersionARN
, gvFunctionDefinitionVersionARN
, gvLoggerDefinitionVersionARN
, LocalDeviceResourceData
, localDeviceResourceData
, ldrdGroupOwnerSetting
, ldrdSourcePath
, LocalVolumeResourceData
, localVolumeResourceData
, lvrdGroupOwnerSetting
, lvrdDestinationPath
, lvrdSourcePath
, LoggerDefinitionVersion
, loggerDefinitionVersion
, ldvLoggers
, Resource
, resource
, rResourceDataContainer
, rName
, rId
, ResourceAccessPolicy
, resourceAccessPolicy
, rapResourceId
, rapPermission
, ResourceDataContainer
, resourceDataContainer
, rdcS3MachineLearningModelResourceData
, rdcSageMakerMachineLearningModelResourceData
, rdcLocalVolumeResourceData
, rdcLocalDeviceResourceData
, ResourceDefinitionVersion
, resourceDefinitionVersion
, rdvResources
, S3MachineLearningModelResourceData
, s3MachineLearningModelResourceData
, smlmrdDestinationPath
, smlmrdS3URI
, SageMakerMachineLearningModelResourceData
, sageMakerMachineLearningModelResourceData
, smmlmrdSageMakerJobARN
, smmlmrdDestinationPath
, Subscription
, subscription
, sSubject
, sSource
, sId
, sTarget
, SubscriptionDefinitionVersion
, subscriptionDefinitionVersion
, sdvSubscriptions
, VersionInformation
, versionInformation
, viARN
, viCreationTimestamp
, viVersion
, viId
) where
import Network.AWS.Greengrass.Types.Product
import Network.AWS.Greengrass.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
greengrass :: Service
greengrass =
Service
{ _svcAbbrev = "Greengrass"
, _svcSigner = v4
, _svcPrefix = "greengrass"
, _svcVersion = "2017-06-07"
, _svcEndpoint = defaultEndpoint greengrass
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "Greengrass"
, _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
_InternalServerErrorException :: AsError a => Getting (First ServiceError) a ServiceError
_InternalServerErrorException =
_MatchServiceError greengrass "InternalServerErrorException" . hasStatus 500
_BadRequestException :: AsError a => Getting (First ServiceError) a ServiceError
_BadRequestException =
_MatchServiceError greengrass "BadRequestException" . hasStatus 400