{-# LANGUAGE DisambiguateRecordFields #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Glacier.Types
(
defaultService,
_InsufficientCapacityException,
_InvalidParameterValueException,
_LimitExceededException,
_MissingParameterValueException,
_PolicyEnforcedException,
_RequestTimeoutException,
_ResourceNotFoundException,
_ServiceUnavailableException,
ActionCode (..),
CannedACL (..),
EncryptionType (..),
ExpressionType (..),
FileHeaderInfo (..),
Permission (..),
QuoteFields (..),
StatusCode (..),
StorageClass (..),
Type (..),
ArchiveCreationOutput (..),
newArchiveCreationOutput,
archiveCreationOutput_archiveId,
archiveCreationOutput_checksum,
archiveCreationOutput_location,
CSVInput (..),
newCSVInput,
cSVInput_comments,
cSVInput_fieldDelimiter,
cSVInput_fileHeaderInfo,
cSVInput_quoteCharacter,
cSVInput_quoteEscapeCharacter,
cSVInput_recordDelimiter,
CSVOutput (..),
newCSVOutput,
cSVOutput_fieldDelimiter,
cSVOutput_quoteCharacter,
cSVOutput_quoteEscapeCharacter,
cSVOutput_quoteFields,
cSVOutput_recordDelimiter,
DataRetrievalPolicy (..),
newDataRetrievalPolicy,
dataRetrievalPolicy_rules,
DataRetrievalRule (..),
newDataRetrievalRule,
dataRetrievalRule_bytesPerHour,
dataRetrievalRule_strategy,
DescribeVaultOutput (..),
newDescribeVaultOutput,
describeVaultOutput_creationDate,
describeVaultOutput_lastInventoryDate,
describeVaultOutput_numberOfArchives,
describeVaultOutput_sizeInBytes,
describeVaultOutput_vaultARN,
describeVaultOutput_vaultName,
Encryption (..),
newEncryption,
encryption_encryptionType,
encryption_kmsContext,
encryption_kmsKeyId,
GlacierJobDescription (..),
newGlacierJobDescription,
glacierJobDescription_action,
glacierJobDescription_archiveId,
glacierJobDescription_archiveSHA256TreeHash,
glacierJobDescription_archiveSizeInBytes,
glacierJobDescription_completed,
glacierJobDescription_completionDate,
glacierJobDescription_creationDate,
glacierJobDescription_inventoryRetrievalParameters,
glacierJobDescription_inventorySizeInBytes,
glacierJobDescription_jobDescription,
glacierJobDescription_jobId,
glacierJobDescription_jobOutputPath,
glacierJobDescription_outputLocation,
glacierJobDescription_retrievalByteRange,
glacierJobDescription_sHA256TreeHash,
glacierJobDescription_sNSTopic,
glacierJobDescription_selectParameters,
glacierJobDescription_statusCode,
glacierJobDescription_statusMessage,
glacierJobDescription_tier,
glacierJobDescription_vaultARN,
Grant (..),
newGrant,
grant_grantee,
grant_permission,
Grantee (..),
newGrantee,
grantee_displayName,
grantee_emailAddress,
grantee_id,
grantee_uri,
grantee_type,
InputSerialization (..),
newInputSerialization,
inputSerialization_csv,
InventoryRetrievalJobDescription (..),
newInventoryRetrievalJobDescription,
inventoryRetrievalJobDescription_endDate,
inventoryRetrievalJobDescription_format,
inventoryRetrievalJobDescription_limit,
inventoryRetrievalJobDescription_marker,
inventoryRetrievalJobDescription_startDate,
InventoryRetrievalJobInput (..),
newInventoryRetrievalJobInput,
inventoryRetrievalJobInput_endDate,
inventoryRetrievalJobInput_limit,
inventoryRetrievalJobInput_marker,
inventoryRetrievalJobInput_startDate,
JobParameters (..),
newJobParameters,
jobParameters_archiveId,
jobParameters_description,
jobParameters_format,
jobParameters_inventoryRetrievalParameters,
jobParameters_outputLocation,
jobParameters_retrievalByteRange,
jobParameters_sNSTopic,
jobParameters_selectParameters,
jobParameters_tier,
jobParameters_type,
OutputLocation (..),
newOutputLocation,
outputLocation_s3,
OutputSerialization (..),
newOutputSerialization,
outputSerialization_csv,
PartListElement (..),
newPartListElement,
partListElement_rangeInBytes,
partListElement_sHA256TreeHash,
ProvisionedCapacityDescription (..),
newProvisionedCapacityDescription,
provisionedCapacityDescription_capacityId,
provisionedCapacityDescription_expirationDate,
provisionedCapacityDescription_startDate,
S3Location (..),
newS3Location,
s3Location_accessControlList,
s3Location_bucketName,
s3Location_cannedACL,
s3Location_encryption,
s3Location_prefix,
s3Location_storageClass,
s3Location_tagging,
s3Location_userMetadata,
SelectParameters (..),
newSelectParameters,
selectParameters_expression,
selectParameters_expressionType,
selectParameters_inputSerialization,
selectParameters_outputSerialization,
UploadListElement (..),
newUploadListElement,
uploadListElement_archiveDescription,
uploadListElement_creationDate,
uploadListElement_multipartUploadId,
uploadListElement_partSizeInBytes,
uploadListElement_vaultARN,
VaultAccessPolicy (..),
newVaultAccessPolicy,
vaultAccessPolicy_policy,
VaultLockPolicy (..),
newVaultLockPolicy,
vaultLockPolicy_policy,
VaultNotificationConfig (..),
newVaultNotificationConfig,
vaultNotificationConfig_events,
vaultNotificationConfig_sNSTopic,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.Glacier.Types.ActionCode
import Amazonka.Glacier.Types.ArchiveCreationOutput
import Amazonka.Glacier.Types.CSVInput
import Amazonka.Glacier.Types.CSVOutput
import Amazonka.Glacier.Types.CannedACL
import Amazonka.Glacier.Types.DataRetrievalPolicy
import Amazonka.Glacier.Types.DataRetrievalRule
import Amazonka.Glacier.Types.DescribeVaultOutput
import Amazonka.Glacier.Types.Encryption
import Amazonka.Glacier.Types.EncryptionType
import Amazonka.Glacier.Types.ExpressionType
import Amazonka.Glacier.Types.FileHeaderInfo
import Amazonka.Glacier.Types.GlacierJobDescription
import Amazonka.Glacier.Types.Grant
import Amazonka.Glacier.Types.Grantee
import Amazonka.Glacier.Types.InputSerialization
import Amazonka.Glacier.Types.InventoryRetrievalJobDescription
import Amazonka.Glacier.Types.InventoryRetrievalJobInput
import Amazonka.Glacier.Types.JobParameters
import Amazonka.Glacier.Types.OutputLocation
import Amazonka.Glacier.Types.OutputSerialization
import Amazonka.Glacier.Types.PartListElement
import Amazonka.Glacier.Types.Permission
import Amazonka.Glacier.Types.ProvisionedCapacityDescription
import Amazonka.Glacier.Types.QuoteFields
import Amazonka.Glacier.Types.S3Location
import Amazonka.Glacier.Types.SelectParameters
import Amazonka.Glacier.Types.StatusCode
import Amazonka.Glacier.Types.StorageClass
import Amazonka.Glacier.Types.Type
import Amazonka.Glacier.Types.UploadListElement
import Amazonka.Glacier.Types.VaultAccessPolicy
import Amazonka.Glacier.Types.VaultLockPolicy
import Amazonka.Glacier.Types.VaultNotificationConfig
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Sign.V4 as Sign
defaultService :: Core.Service
defaultService :: Service
defaultService =
Core.Service
{ $sel:abbrev:Service :: Abbrev
Core.abbrev = Abbrev
"Glacier",
$sel:signer:Service :: Signer
Core.signer = Signer
Sign.v4,
$sel:endpointPrefix:Service :: ByteString
Core.endpointPrefix = ByteString
"glacier",
$sel:signingName:Service :: ByteString
Core.signingName = ByteString
"glacier",
$sel:version:Service :: ByteString
Core.version = ByteString
"2012-06-01",
$sel:s3AddressingStyle:Service :: S3AddressingStyle
Core.s3AddressingStyle = S3AddressingStyle
Core.S3AddressingStyleAuto,
$sel:endpoint:Service :: Region -> Endpoint
Core.endpoint = Service -> Region -> Endpoint
Core.defaultEndpoint Service
defaultService,
$sel:timeout:Service :: Maybe Seconds
Core.timeout = forall a. a -> Maybe a
Prelude.Just Seconds
70,
$sel:check:Service :: Status -> Bool
Core.check = Status -> Bool
Core.statusSuccess,
$sel:error:Service :: Status -> [Header] -> ByteStringLazy -> Error
Core.error = Abbrev -> Status -> [Header] -> ByteStringLazy -> Error
Core.parseJSONError Abbrev
"Glacier",
$sel:retry:Service :: Retry
Core.retry = Retry
retry
}
where
retry :: Retry
retry =
Core.Exponential
{ $sel:base:Exponential :: Double
Core.base = Double
5.0e-2,
$sel:growth:Exponential :: Int
Core.growth = Int
2,
$sel:attempts:Exponential :: Int
Core.attempts = Int
5,
$sel:check:Exponential :: ServiceError -> Maybe Text
Core.check = forall {a}. IsString a => ServiceError -> Maybe a
check
}
check :: ServiceError -> Maybe a
check ServiceError
e
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
502) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"bad_gateway"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
504) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"gateway_timeout"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
500) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"general_server_error"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
509) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"limit_exceeded"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"RequestThrottledException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"request_throttled_exception"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
503) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"service_unavailable"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottledException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throttled_exception"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"Throttling"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throttling"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottlingException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throttling_exception"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode
ErrorCode
"ProvisionedThroughputExceededException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throughput_exceeded"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"RequestTimeoutException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
408
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"timeouts"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
429) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"too_many_requests"
| Bool
Prelude.otherwise = forall a. Maybe a
Prelude.Nothing
_InsufficientCapacityException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_InsufficientCapacityException :: forall a. AsError a => Fold a ServiceError
_InsufficientCapacityException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"InsufficientCapacityException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
_InvalidParameterValueException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_InvalidParameterValueException :: forall a. AsError a => Fold a ServiceError
_InvalidParameterValueException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"InvalidParameterValueException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
_LimitExceededException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_LimitExceededException :: forall a. AsError a => Fold a ServiceError
_LimitExceededException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"LimitExceededException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
_MissingParameterValueException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_MissingParameterValueException :: forall a. AsError a => Fold a ServiceError
_MissingParameterValueException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"MissingParameterValueException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
_PolicyEnforcedException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_PolicyEnforcedException :: forall a. AsError a => Fold a ServiceError
_PolicyEnforcedException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"PolicyEnforcedException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
_RequestTimeoutException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_RequestTimeoutException :: forall a. AsError a => Fold a ServiceError
_RequestTimeoutException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"RequestTimeoutException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
408
_ResourceNotFoundException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ResourceNotFoundException :: forall a. AsError a => Fold a ServiceError
_ResourceNotFoundException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ResourceNotFoundException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
404
_ServiceUnavailableException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ServiceUnavailableException :: forall a. AsError a => Fold a ServiceError
_ServiceUnavailableException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ServiceUnavailableException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
500