{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Snowball.Types
(
defaultService,
_InvalidResourceException,
_UnsupportedAddressException,
_ReturnShippingLabelAlreadyExistsException,
_KMSRequestFailedException,
_InvalidJobStateException,
_InvalidInputCombinationException,
_ConflictException,
_Ec2RequestFailedException,
_InvalidNextTokenException,
_InvalidAddressException,
_ClusterLimitExceededException,
ClusterState (..),
DeviceServiceName (..),
JobState (..),
JobType (..),
LongTermPricingType (..),
RemoteManagement (..),
ShipmentState (..),
ShippingLabelStatus (..),
ShippingOption (..),
SnowballCapacity (..),
SnowballType (..),
StorageUnit (..),
TransferOption (..),
Address (..),
newAddress,
address_isRestricted,
address_street3,
address_landmark,
address_postalCode,
address_country,
address_stateOrProvince,
address_street2,
address_addressId,
address_city,
address_phoneNumber,
address_company,
address_name,
address_prefectureOrDistrict,
address_street1,
ClusterListEntry (..),
newClusterListEntry,
clusterListEntry_clusterState,
clusterListEntry_clusterId,
clusterListEntry_creationDate,
clusterListEntry_description,
ClusterMetadata (..),
newClusterMetadata,
clusterMetadata_jobType,
clusterMetadata_kmsKeyARN,
clusterMetadata_clusterState,
clusterMetadata_notification,
clusterMetadata_forwardingAddressId,
clusterMetadata_addressId,
clusterMetadata_snowballType,
clusterMetadata_shippingOption,
clusterMetadata_resources,
clusterMetadata_onDeviceServiceConfiguration,
clusterMetadata_clusterId,
clusterMetadata_creationDate,
clusterMetadata_description,
clusterMetadata_taxDocuments,
clusterMetadata_roleARN,
CompatibleImage (..),
newCompatibleImage,
compatibleImage_name,
compatibleImage_amiId,
DataTransfer (..),
newDataTransfer,
dataTransfer_totalObjects,
dataTransfer_totalBytes,
dataTransfer_objectsTransferred,
dataTransfer_bytesTransferred,
DeviceConfiguration (..),
newDeviceConfiguration,
deviceConfiguration_snowconeDeviceConfiguration,
Ec2AmiResource (..),
newEc2AmiResource,
ec2AmiResource_snowballAmiId,
ec2AmiResource_amiId,
EventTriggerDefinition (..),
newEventTriggerDefinition,
eventTriggerDefinition_eventResourceARN,
INDTaxDocuments (..),
newINDTaxDocuments,
iNDTaxDocuments_gstin,
JobListEntry (..),
newJobListEntry,
jobListEntry_jobType,
jobListEntry_jobId,
jobListEntry_jobState,
jobListEntry_snowballType,
jobListEntry_creationDate,
jobListEntry_description,
jobListEntry_isMaster,
JobLogs (..),
newJobLogs,
jobLogs_jobFailureLogURI,
jobLogs_jobCompletionReportURI,
jobLogs_jobSuccessLogURI,
JobMetadata (..),
newJobMetadata,
jobMetadata_jobType,
jobMetadata_kmsKeyARN,
jobMetadata_remoteManagement,
jobMetadata_jobId,
jobMetadata_jobLogInfo,
jobMetadata_notification,
jobMetadata_jobState,
jobMetadata_forwardingAddressId,
jobMetadata_shippingDetails,
jobMetadata_addressId,
jobMetadata_snowballType,
jobMetadata_dataTransferProgress,
jobMetadata_longTermPricingId,
jobMetadata_resources,
jobMetadata_onDeviceServiceConfiguration,
jobMetadata_clusterId,
jobMetadata_creationDate,
jobMetadata_deviceConfiguration,
jobMetadata_description,
jobMetadata_taxDocuments,
jobMetadata_roleARN,
jobMetadata_snowballCapacityPreference,
JobResource (..),
newJobResource,
jobResource_ec2AmiResources,
jobResource_lambdaResources,
jobResource_s3Resources,
KeyRange (..),
newKeyRange,
keyRange_endMarker,
keyRange_beginMarker,
LambdaResource (..),
newLambdaResource,
lambdaResource_eventTriggers,
lambdaResource_lambdaArn,
LongTermPricingListEntry (..),
newLongTermPricingListEntry,
longTermPricingListEntry_longTermPricingType,
longTermPricingListEntry_longTermPricingStartDate,
longTermPricingListEntry_snowballType,
longTermPricingListEntry_longTermPricingId,
longTermPricingListEntry_longTermPricingEndDate,
longTermPricingListEntry_currentActiveJob,
longTermPricingListEntry_isLongTermPricingAutoRenew,
longTermPricingListEntry_longTermPricingStatus,
longTermPricingListEntry_jobIds,
longTermPricingListEntry_replacementJob,
NFSOnDeviceServiceConfiguration (..),
newNFSOnDeviceServiceConfiguration,
nFSOnDeviceServiceConfiguration_storageLimit,
nFSOnDeviceServiceConfiguration_storageUnit,
Notification (..),
newNotification,
notification_notifyAll,
notification_snsTopicARN,
notification_jobStatesToNotify,
OnDeviceServiceConfiguration (..),
newOnDeviceServiceConfiguration,
onDeviceServiceConfiguration_nFSOnDeviceService,
S3Resource (..),
newS3Resource,
s3Resource_keyRange,
s3Resource_bucketArn,
s3Resource_targetOnDeviceServices,
Shipment (..),
newShipment,
shipment_status,
shipment_trackingNumber,
ShippingDetails (..),
newShippingDetails,
shippingDetails_shippingOption,
shippingDetails_outboundShipment,
shippingDetails_inboundShipment,
SnowconeDeviceConfiguration (..),
newSnowconeDeviceConfiguration,
snowconeDeviceConfiguration_wirelessConnection,
TargetOnDeviceService (..),
newTargetOnDeviceService,
targetOnDeviceService_transferOption,
targetOnDeviceService_serviceName,
TaxDocuments (..),
newTaxDocuments,
taxDocuments_ind,
WirelessConnection (..),
newWirelessConnection,
wirelessConnection_isWifiEnabled,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Sign.V4 as Sign
import Amazonka.Snowball.Types.Address
import Amazonka.Snowball.Types.ClusterListEntry
import Amazonka.Snowball.Types.ClusterMetadata
import Amazonka.Snowball.Types.ClusterState
import Amazonka.Snowball.Types.CompatibleImage
import Amazonka.Snowball.Types.DataTransfer
import Amazonka.Snowball.Types.DeviceConfiguration
import Amazonka.Snowball.Types.DeviceServiceName
import Amazonka.Snowball.Types.Ec2AmiResource
import Amazonka.Snowball.Types.EventTriggerDefinition
import Amazonka.Snowball.Types.INDTaxDocuments
import Amazonka.Snowball.Types.JobListEntry
import Amazonka.Snowball.Types.JobLogs
import Amazonka.Snowball.Types.JobMetadata
import Amazonka.Snowball.Types.JobResource
import Amazonka.Snowball.Types.JobState
import Amazonka.Snowball.Types.JobType
import Amazonka.Snowball.Types.KeyRange
import Amazonka.Snowball.Types.LambdaResource
import Amazonka.Snowball.Types.LongTermPricingListEntry
import Amazonka.Snowball.Types.LongTermPricingType
import Amazonka.Snowball.Types.NFSOnDeviceServiceConfiguration
import Amazonka.Snowball.Types.Notification
import Amazonka.Snowball.Types.OnDeviceServiceConfiguration
import Amazonka.Snowball.Types.RemoteManagement
import Amazonka.Snowball.Types.S3Resource
import Amazonka.Snowball.Types.Shipment
import Amazonka.Snowball.Types.ShipmentState
import Amazonka.Snowball.Types.ShippingDetails
import Amazonka.Snowball.Types.ShippingLabelStatus
import Amazonka.Snowball.Types.ShippingOption
import Amazonka.Snowball.Types.SnowballCapacity
import Amazonka.Snowball.Types.SnowballType
import Amazonka.Snowball.Types.SnowconeDeviceConfiguration
import Amazonka.Snowball.Types.StorageUnit
import Amazonka.Snowball.Types.TargetOnDeviceService
import Amazonka.Snowball.Types.TaxDocuments
import Amazonka.Snowball.Types.TransferOption
import Amazonka.Snowball.Types.WirelessConnection
defaultService :: Core.Service
defaultService :: Service
defaultService =
Service :: Abbrev
-> Signer
-> ByteString
-> ByteString
-> ByteString
-> (Region -> Endpoint)
-> Maybe Seconds
-> (Status -> Bool)
-> (Status -> [Header] -> ByteStringLazy -> Error)
-> Retry
-> Service
Core.Service
{ $sel:_serviceAbbrev:Service :: Abbrev
Core._serviceAbbrev = Abbrev
"Snowball",
$sel:_serviceSigner:Service :: Signer
Core._serviceSigner = Signer
Sign.v4,
$sel:_serviceEndpointPrefix:Service :: ByteString
Core._serviceEndpointPrefix = ByteString
"snowball",
$sel:_serviceSigningName:Service :: ByteString
Core._serviceSigningName = ByteString
"snowball",
$sel:_serviceVersion:Service :: ByteString
Core._serviceVersion = ByteString
"2016-06-30",
$sel:_serviceEndpoint:Service :: Region -> Endpoint
Core._serviceEndpoint =
Service -> Region -> Endpoint
Core.defaultEndpoint Service
defaultService,
$sel:_serviceTimeout:Service :: Maybe Seconds
Core._serviceTimeout = Seconds -> Maybe Seconds
forall a. a -> Maybe a
Prelude.Just Seconds
70,
$sel:_serviceCheck:Service :: Status -> Bool
Core._serviceCheck = Status -> Bool
Core.statusSuccess,
$sel:_serviceError:Service :: Status -> [Header] -> ByteStringLazy -> Error
Core._serviceError = Abbrev -> Status -> [Header] -> ByteStringLazy -> Error
Core.parseJSONError Abbrev
"Snowball",
$sel:_serviceRetry:Service :: Retry
Core._serviceRetry = Retry
retry
}
where
retry :: Retry
retry =
Exponential :: Double -> Int -> Int -> (ServiceError -> Maybe Text) -> Retry
Core.Exponential
{ $sel:_retryBase:Exponential :: Double
Core._retryBase = Double
5.0e-2,
$sel:_retryGrowth:Exponential :: Int
Core._retryGrowth = Int
2,
$sel:_retryAttempts:Exponential :: Int
Core._retryAttempts = Int
5,
$sel:_retryCheck:Exponential :: ServiceError -> Maybe Text
Core._retryCheck = ServiceError -> Maybe Text
forall a. IsString a => ServiceError -> Maybe a
check
}
check :: ServiceError -> Maybe a
check ServiceError
e
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottledException"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throttled_exception"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
429) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"too_many_requests"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottlingException"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throttling_exception"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"Throttling"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throttling"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode
ErrorCode
"ProvisionedThroughputExceededException"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throughput_exceeded"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
504) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"gateway_timeout"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"RequestThrottledException"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"request_throttled_exception"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
502) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"bad_gateway"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
503) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"service_unavailable"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
500) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"general_server_error"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
509) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"limit_exceeded"
| Bool
Prelude.otherwise = Maybe a
forall a. Maybe a
Prelude.Nothing
_InvalidResourceException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_InvalidResourceException :: Getting (First ServiceError) a ServiceError
_InvalidResourceException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"InvalidResourceException"
_UnsupportedAddressException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_UnsupportedAddressException :: Getting (First ServiceError) a ServiceError
_UnsupportedAddressException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"UnsupportedAddressException"
_ReturnShippingLabelAlreadyExistsException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_ReturnShippingLabelAlreadyExistsException :: Getting (First ServiceError) a ServiceError
_ReturnShippingLabelAlreadyExistsException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ReturnShippingLabelAlreadyExistsException"
_KMSRequestFailedException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_KMSRequestFailedException :: Getting (First ServiceError) a ServiceError
_KMSRequestFailedException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"KMSRequestFailedException"
_InvalidJobStateException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_InvalidJobStateException :: Getting (First ServiceError) a ServiceError
_InvalidJobStateException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"InvalidJobStateException"
_InvalidInputCombinationException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_InvalidInputCombinationException :: Getting (First ServiceError) a ServiceError
_InvalidInputCombinationException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"InvalidInputCombinationException"
_ConflictException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_ConflictException :: Getting (First ServiceError) a ServiceError
_ConflictException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ConflictException"
_Ec2RequestFailedException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_Ec2RequestFailedException :: Getting (First ServiceError) a ServiceError
_Ec2RequestFailedException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"Ec2RequestFailedException"
_InvalidNextTokenException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_InvalidNextTokenException :: Getting (First ServiceError) a ServiceError
_InvalidNextTokenException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"InvalidNextTokenException"
_InvalidAddressException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_InvalidAddressException :: Getting (First ServiceError) a ServiceError
_InvalidAddressException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"InvalidAddressException"
_ClusterLimitExceededException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_ClusterLimitExceededException :: Getting (First ServiceError) a ServiceError
_ClusterLimitExceededException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ClusterLimitExceededException"