amazonka-glacier (empty) → 0.3.0
raw patch · 27 files changed
+5531/−0 lines, 27 filesdep +amazonka-coredep +basesetup-changed
Dependencies added: amazonka-core, base
Files
- LICENSE +373/−0
- README.md +34/−0
- Setup.hs +2/−0
- amazonka-glacier.cabal +68/−0
- gen/Network/AWS/Glacier.hs +65/−0
- gen/Network/AWS/Glacier/AbortMultipartUpload.hs +136/−0
- gen/Network/AWS/Glacier/CompleteMultipartUpload.hs +222/−0
- gen/Network/AWS/Glacier/CreateVault.hs +145/−0
- gen/Network/AWS/Glacier/DeleteArchive.hs +139/−0
- gen/Network/AWS/Glacier/DeleteVault.hs +124/−0
- gen/Network/AWS/Glacier/DeleteVaultNotifications.hs +122/−0
- gen/Network/AWS/Glacier/DescribeJob.hs +357/−0
- gen/Network/AWS/Glacier/DescribeVault.hs +201/−0
- gen/Network/AWS/Glacier/GetDataRetrievalPolicy.hs +109/−0
- gen/Network/AWS/Glacier/GetJobOutput.hs +269/−0
- gen/Network/AWS/Glacier/GetVaultNotifications.hs +143/−0
- gen/Network/AWS/Glacier/InitiateJob.hs +249/−0
- gen/Network/AWS/Glacier/InitiateMultipartUpload.hs +195/−0
- gen/Network/AWS/Glacier/ListJobs.hs +224/−0
- gen/Network/AWS/Glacier/ListMultipartUploads.hs +191/−0
- gen/Network/AWS/Glacier/ListParts.hs +249/−0
- gen/Network/AWS/Glacier/ListVaults.hs +167/−0
- gen/Network/AWS/Glacier/SetDataRetrievalPolicy.hs +102/−0
- gen/Network/AWS/Glacier/SetVaultNotifications.hs +147/−0
- gen/Network/AWS/Glacier/Types.hs +1082/−0
- gen/Network/AWS/Glacier/UploadArchive.hs +208/−0
- gen/Network/AWS/Glacier/UploadMultipartPart.hs +208/−0
+ LICENSE view
@@ -0,0 +1,373 @@+Mozilla Public License Version 2.0+==================================++1. Definitions+--------------++1.1. "Contributor"+ means each individual or legal entity that creates, contributes to+ the creation of, or owns Covered Software.++1.2. "Contributor Version"+ means the combination of the Contributions of others (if any) used+ by a Contributor and that particular Contributor's Contribution.++1.3. "Contribution"+ means Covered Software of a particular Contributor.++1.4. "Covered Software"+ means Source Code Form to which the initial Contributor has attached+ the notice in Exhibit A, the Executable Form of such Source Code+ Form, and Modifications of such Source Code Form, in each case+ including portions thereof.++1.5. "Incompatible With Secondary Licenses"+ means++ (a) that the initial Contributor has attached the notice described+ in Exhibit B to the Covered Software; or++ (b) that the Covered Software was made available under the terms of+ version 1.1 or earlier of the License, but not also under the+ terms of a Secondary License.++1.6. "Executable Form"+ means any form of the work other than Source Code Form.++1.7. "Larger Work"+ means a work that combines Covered Software with other material, in+ a separate file or files, that is not Covered Software.++1.8. "License"+ means this document.++1.9. "Licensable"+ means having the right to grant, to the maximum extent possible,+ whether at the time of the initial grant or subsequently, any and+ all of the rights conveyed by this License.++1.10. "Modifications"+ means any of the following:++ (a) any file in Source Code Form that results from an addition to,+ deletion from, or modification of the contents of Covered+ Software; or++ (b) any new file in Source Code Form that contains any Covered+ Software.++1.11. "Patent Claims" of a Contributor+ means any patent claim(s), including without limitation, method,+ process, and apparatus claims, in any patent Licensable by such+ Contributor that would be infringed, but for the grant of the+ License, by the making, using, selling, offering for sale, having+ made, import, or transfer of either its Contributions or its+ Contributor Version.++1.12. "Secondary License"+ means either the GNU General Public License, Version 2.0, the GNU+ Lesser General Public License, Version 2.1, the GNU Affero General+ Public License, Version 3.0, or any later versions of those+ licenses.++1.13. "Source Code Form"+ means the form of the work preferred for making modifications.++1.14. "You" (or "Your")+ means an individual or a legal entity exercising rights under this+ License. For legal entities, "You" includes any entity that+ controls, is controlled by, or is under common control with You. For+ purposes of this definition, "control" means (a) the power, direct+ or indirect, to cause the direction or management of such entity,+ whether by contract or otherwise, or (b) ownership of more than+ fifty percent (50%) of the outstanding shares or beneficial+ ownership of such entity.++2. License Grants and Conditions+--------------------------------++2.1. Grants++Each Contributor hereby grants You a world-wide, royalty-free,+non-exclusive license:++(a) under intellectual property rights (other than patent or trademark)+ Licensable by such Contributor to use, reproduce, make available,+ modify, display, perform, distribute, and otherwise exploit its+ Contributions, either on an unmodified basis, with Modifications, or+ as part of a Larger Work; and++(b) under Patent Claims of such Contributor to make, use, sell, offer+ for sale, have made, import, and otherwise transfer either its+ Contributions or its Contributor Version.++2.2. Effective Date++The licenses granted in Section 2.1 with respect to any Contribution+become effective for each Contribution on the date the Contributor first+distributes such Contribution.++2.3. Limitations on Grant Scope++The licenses granted in this Section 2 are the only rights granted under+this License. No additional rights or licenses will be implied from the+distribution or licensing of Covered Software under this License.+Notwithstanding Section 2.1(b) above, no patent license is granted by a+Contributor:++(a) for any code that a Contributor has removed from Covered Software;+ or++(b) for infringements caused by: (i) Your and any other third party's+ modifications of Covered Software, or (ii) the combination of its+ Contributions with other software (except as part of its Contributor+ Version); or++(c) under Patent Claims infringed by Covered Software in the absence of+ its Contributions.++This License does not grant any rights in the trademarks, service marks,+or logos of any Contributor (except as may be necessary to comply with+the notice requirements in Section 3.4).++2.4. Subsequent Licenses++No Contributor makes additional grants as a result of Your choice to+distribute the Covered Software under a subsequent version of this+License (see Section 10.2) or under the terms of a Secondary License (if+permitted under the terms of Section 3.3).++2.5. Representation++Each Contributor represents that the Contributor believes its+Contributions are its original creation(s) or it has sufficient rights+to grant the rights to its Contributions conveyed by this License.++2.6. Fair Use++This License is not intended to limit any rights You have under+applicable copyright doctrines of fair use, fair dealing, or other+equivalents.++2.7. Conditions++Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted+in Section 2.1.++3. Responsibilities+-------------------++3.1. Distribution of Source Form++All distribution of Covered Software in Source Code Form, including any+Modifications that You create or to which You contribute, must be under+the terms of this License. You must inform recipients that the Source+Code Form of the Covered Software is governed by the terms of this+License, and how they can obtain a copy of this License. You may not+attempt to alter or restrict the recipients' rights in the Source Code+Form.++3.2. Distribution of Executable Form++If You distribute Covered Software in Executable Form then:++(a) such Covered Software must also be made available in Source Code+ Form, as described in Section 3.1, and You must inform recipients of+ the Executable Form how they can obtain a copy of such Source Code+ Form by reasonable means in a timely manner, at a charge no more+ than the cost of distribution to the recipient; and++(b) You may distribute such Executable Form under the terms of this+ License, or sublicense it under different terms, provided that the+ license for the Executable Form does not attempt to limit or alter+ the recipients' rights in the Source Code Form under this License.++3.3. Distribution of a Larger Work++You may create and distribute a Larger Work under terms of Your choice,+provided that You also comply with the requirements of this License for+the Covered Software. If the Larger Work is a combination of Covered+Software with a work governed by one or more Secondary Licenses, and the+Covered Software is not Incompatible With Secondary Licenses, this+License permits You to additionally distribute such Covered Software+under the terms of such Secondary License(s), so that the recipient of+the Larger Work may, at their option, further distribute the Covered+Software under the terms of either this License or such Secondary+License(s).++3.4. Notices++You may not remove or alter the substance of any license notices+(including copyright notices, patent notices, disclaimers of warranty,+or limitations of liability) contained within the Source Code Form of+the Covered Software, except that You may alter any license notices to+the extent required to remedy known factual inaccuracies.++3.5. Application of Additional Terms++You may choose to offer, and to charge a fee for, warranty, support,+indemnity or liability obligations to one or more recipients of Covered+Software. However, You may do so only on Your own behalf, and not on+behalf of any Contributor. You must make it absolutely clear that any+such warranty, support, indemnity, or liability obligation is offered by+You alone, and You hereby agree to indemnify every Contributor for any+liability incurred by such Contributor as a result of warranty, support,+indemnity or liability terms You offer. You may include additional+disclaimers of warranty and limitations of liability specific to any+jurisdiction.++4. Inability to Comply Due to Statute or Regulation+---------------------------------------------------++If it is impossible for You to comply with any of the terms of this+License with respect to some or all of the Covered Software due to+statute, judicial order, or regulation then You must: (a) comply with+the terms of this License to the maximum extent possible; and (b)+describe the limitations and the code they affect. Such description must+be placed in a text file included with all distributions of the Covered+Software under this License. Except to the extent prohibited by statute+or regulation, such description must be sufficiently detailed for a+recipient of ordinary skill to be able to understand it.++5. Termination+--------------++5.1. The rights granted under this License will terminate automatically+if You fail to comply with any of its terms. However, if You become+compliant, then the rights granted under this License from a particular+Contributor are reinstated (a) provisionally, unless and until such+Contributor explicitly and finally terminates Your grants, and (b) on an+ongoing basis, if such Contributor fails to notify You of the+non-compliance by some reasonable means prior to 60 days after You have+come back into compliance. Moreover, Your grants from a particular+Contributor are reinstated on an ongoing basis if such Contributor+notifies You of the non-compliance by some reasonable means, this is the+first time You have received notice of non-compliance with this License+from such Contributor, and You become compliant prior to 30 days after+Your receipt of the notice.++5.2. If You initiate litigation against any entity by asserting a patent+infringement claim (excluding declaratory judgment actions,+counter-claims, and cross-claims) alleging that a Contributor Version+directly or indirectly infringes any patent, then the rights granted to+You by any and all Contributors for the Covered Software under Section+2.1 of this License shall terminate.++5.3. In the event of termination under Sections 5.1 or 5.2 above, all+end user license agreements (excluding distributors and resellers) which+have been validly granted by You or Your distributors under this License+prior to termination shall survive termination.++************************************************************************+* *+* 6. Disclaimer of Warranty *+* ------------------------- *+* *+* Covered Software is provided under this License on an "as is" *+* basis, without warranty of any kind, either expressed, implied, or *+* statutory, including, without limitation, warranties that the *+* Covered Software is free of defects, merchantable, fit for a *+* particular purpose or non-infringing. The entire risk as to the *+* quality and performance of the Covered Software is with You. *+* Should any Covered Software prove defective in any respect, You *+* (not any Contributor) assume the cost of any necessary servicing, *+* repair, or correction. This disclaimer of warranty constitutes an *+* essential part of this License. No use of any Covered Software is *+* authorized under this License except under this disclaimer. *+* *+************************************************************************++************************************************************************+* *+* 7. Limitation of Liability *+* -------------------------- *+* *+* Under no circumstances and under no legal theory, whether tort *+* (including negligence), contract, or otherwise, shall any *+* Contributor, or anyone who distributes Covered Software as *+* permitted above, be liable to You for any direct, indirect, *+* special, incidental, or consequential damages of any character *+* including, without limitation, damages for lost profits, loss of *+* goodwill, work stoppage, computer failure or malfunction, or any *+* and all other commercial damages or losses, even if such party *+* shall have been informed of the possibility of such damages. This *+* limitation of liability shall not apply to liability for death or *+* personal injury resulting from such party's negligence to the *+* extent applicable law prohibits such limitation. Some *+* jurisdictions do not allow the exclusion or limitation of *+* incidental or consequential damages, so this exclusion and *+* limitation may not apply to You. *+* *+************************************************************************++8. Litigation+-------------++Any litigation relating to this License may be brought only in the+courts of a jurisdiction where the defendant maintains its principal+place of business and such litigation shall be governed by laws of that+jurisdiction, without reference to its conflict-of-law provisions.+Nothing in this Section shall prevent a party's ability to bring+cross-claims or counter-claims.++9. Miscellaneous+----------------++This License represents the complete agreement concerning the subject+matter hereof. If any provision of this License is held to be+unenforceable, such provision shall be reformed only to the extent+necessary to make it enforceable. Any law or regulation which provides+that the language of a contract shall be construed against the drafter+shall not be used to construe this License against a Contributor.++10. Versions of the License+---------------------------++10.1. New Versions++Mozilla Foundation is the license steward. Except as provided in Section+10.3, no one other than the license steward has the right to modify or+publish new versions of this License. Each version will be given a+distinguishing version number.++10.2. Effect of New Versions++You may distribute the Covered Software under the terms of the version+of the License under which You originally received the Covered Software,+or under the terms of any subsequent version published by the license+steward.++10.3. Modified Versions++If you create software not governed by this License, and you want to+create a new license for such software, you may create and use a+modified version of this License if you rename the license and remove+any references to the name of the license steward (except to note that+such modified license differs from this License).++10.4. Distributing Source Code Form that is Incompatible With Secondary+Licenses++If You choose to distribute Source Code Form that is Incompatible With+Secondary Licenses under the terms of this version of the License, the+notice described in Exhibit B of this License must be attached.++Exhibit A - Source Code Form License Notice+-------------------------------------------++ This Source Code Form is subject to the terms of the Mozilla Public+ License, v. 2.0. If a copy of the MPL was not distributed with this+ file, You can obtain one at http://mozilla.org/MPL/2.0/.++If it is not possible or desirable to put the notice in a particular+file, then You may include the notice in a location (such as a LICENSE+file in a relevant directory) where a recipient would be likely to look+for such a notice.++You may add additional accurate notices of copyright ownership.++Exhibit B - "Incompatible With Secondary Licenses" Notice+---------------------------------------------------------++ This Source Code Form is "Incompatible With Secondary Licenses", as+ defined by the Mozilla Public License, v. 2.0.
+ README.md view
@@ -0,0 +1,34 @@+# Amazon Glacier SDK++> _Warning:_ This is an experimental preview release which is still under heavy development and not intended for public consumption, _caveat emptor_!++* [Description](#description)+* [Contribute](#contribute)+* [Licence](#licence)++## Description++Amazon Glacier is a secure, durable, and extremely low-cost storage service+for data archiving and online backup. Customers can reliably store large or+small amounts of data for as little as $0.01 per gigabyte per month, a+significant savings compared to on-premises solutions. To keep costs low,+Amazon Glacier is optimized for infrequently accessed data where a retrieval+time of several hours is suitable.++Documentation is available via [Hackage](http://hackage.haskell.org/package/amazonka-glacier)+and the [AWS API Reference](http://docs.aws.amazon.com/amazonglacier/latest/dev/introduction.html).+++## Contribute++For any problems, comments, or feedback please create an issue [here on GitHub](https://github.com/brendanhay/amazonka/issues).++> _Note:_ this library is an auto-generated Haskell package. Please see `amazonka-gen` for more information.+++## Licence++`amazonka-glacier` is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/).++Parts of the code are derived from AWS service descriptions, licensed under Apache 2.0.+Source files subject to this contain an additional licensing clause in their header.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ amazonka-glacier.cabal view
@@ -0,0 +1,68 @@+name: amazonka-glacier+version: 0.3.0+synopsis: Amazon Glacier SDK.+homepage: https://github.com/brendanhay/amazonka+license: OtherLicense+license-file: LICENSE+author: Brendan Hay+maintainer: Brendan Hay <brendan.g.hay@gmail.com>+copyright: Copyright (c) 2013-2014 Brendan Hay+category: Network, AWS, Cloud, Distributed Computing+build-type: Simple+extra-source-files: README.md+cabal-version: >= 1.10++description:+ Amazon Glacier is a secure, durable, and extremely low-cost storage service+ for data archiving and online backup. Customers can reliably store large or+ small amounts of data for as little as $0.01 per gigabyte per month, a+ significant savings compared to on-premises solutions. To keep costs low,+ Amazon Glacier is optimized for infrequently accessed data where a retrieval+ time of several hours is suitable.++ .+ /See:/ <http://docs.aws.amazon.com/amazonglacier/latest/dev/introduction.html AWS API Reference>+ .+ /Warning:/ This is an experimental preview release which is still under+ heavy development and not intended for public consumption, caveat emptor!++source-repository head+ type: git+ location: git://github.com/brendanhay/amazonka.git++library+ default-language: Haskell2010+ hs-source-dirs: src gen++ ghc-options: -Wall++ exposed-modules:+ Network.AWS.Glacier+ , Network.AWS.Glacier.AbortMultipartUpload+ , Network.AWS.Glacier.CompleteMultipartUpload+ , Network.AWS.Glacier.CreateVault+ , Network.AWS.Glacier.DeleteArchive+ , Network.AWS.Glacier.DeleteVault+ , Network.AWS.Glacier.DeleteVaultNotifications+ , Network.AWS.Glacier.DescribeJob+ , Network.AWS.Glacier.DescribeVault+ , Network.AWS.Glacier.GetDataRetrievalPolicy+ , Network.AWS.Glacier.GetJobOutput+ , Network.AWS.Glacier.GetVaultNotifications+ , Network.AWS.Glacier.InitiateJob+ , Network.AWS.Glacier.InitiateMultipartUpload+ , Network.AWS.Glacier.ListJobs+ , Network.AWS.Glacier.ListMultipartUploads+ , Network.AWS.Glacier.ListParts+ , Network.AWS.Glacier.ListVaults+ , Network.AWS.Glacier.SetDataRetrievalPolicy+ , Network.AWS.Glacier.SetVaultNotifications+ , Network.AWS.Glacier.Types+ , Network.AWS.Glacier.UploadArchive+ , Network.AWS.Glacier.UploadMultipartPart++ other-modules:++ build-depends:+ amazonka-core == 0.3.0.*+ , base >= 4.7 && < 5
+ gen/Network/AWS/Glacier.hs view
@@ -0,0 +1,65 @@+-- Module : Network.AWS.Glacier+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | Amazon Glacier is a secure, durable, and extremely low-cost storage service+-- for data archiving and online backup. Customers can reliably store large or+-- small amounts of data for as little as $0.01 per gigabyte per month, a+-- significant savings compared to on-premises solutions. To keep costs low,+-- Amazon Glacier is optimized for infrequently accessed data where a retrieval+-- time of several hours is suitable.+module Network.AWS.Glacier+ ( module Network.AWS.Glacier.AbortMultipartUpload+ , module Network.AWS.Glacier.CompleteMultipartUpload+ , module Network.AWS.Glacier.CreateVault+ , module Network.AWS.Glacier.DeleteArchive+ , module Network.AWS.Glacier.DeleteVault+ , module Network.AWS.Glacier.DeleteVaultNotifications+ , module Network.AWS.Glacier.DescribeJob+ , module Network.AWS.Glacier.DescribeVault+ , module Network.AWS.Glacier.GetDataRetrievalPolicy+ , module Network.AWS.Glacier.GetJobOutput+ , module Network.AWS.Glacier.GetVaultNotifications+ , module Network.AWS.Glacier.InitiateJob+ , module Network.AWS.Glacier.InitiateMultipartUpload+ , module Network.AWS.Glacier.ListJobs+ , module Network.AWS.Glacier.ListMultipartUploads+ , module Network.AWS.Glacier.ListParts+ , module Network.AWS.Glacier.ListVaults+ , module Network.AWS.Glacier.SetDataRetrievalPolicy+ , module Network.AWS.Glacier.SetVaultNotifications+ , module Network.AWS.Glacier.Types+ , module Network.AWS.Glacier.UploadArchive+ , module Network.AWS.Glacier.UploadMultipartPart+ ) where++import Network.AWS.Glacier.AbortMultipartUpload+import Network.AWS.Glacier.CompleteMultipartUpload+import Network.AWS.Glacier.CreateVault+import Network.AWS.Glacier.DeleteArchive+import Network.AWS.Glacier.DeleteVault+import Network.AWS.Glacier.DeleteVaultNotifications+import Network.AWS.Glacier.DescribeJob+import Network.AWS.Glacier.DescribeVault+import Network.AWS.Glacier.GetDataRetrievalPolicy+import Network.AWS.Glacier.GetJobOutput+import Network.AWS.Glacier.GetVaultNotifications+import Network.AWS.Glacier.InitiateJob+import Network.AWS.Glacier.InitiateMultipartUpload+import Network.AWS.Glacier.ListJobs+import Network.AWS.Glacier.ListMultipartUploads+import Network.AWS.Glacier.ListParts+import Network.AWS.Glacier.ListVaults+import Network.AWS.Glacier.SetDataRetrievalPolicy+import Network.AWS.Glacier.SetVaultNotifications+import Network.AWS.Glacier.Types+import Network.AWS.Glacier.UploadArchive+import Network.AWS.Glacier.UploadMultipartPart
+ gen/Network/AWS/Glacier/AbortMultipartUpload.hs view
@@ -0,0 +1,136 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.AbortMultipartUpload+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation aborts a multipart upload identified by the upload ID.+--+-- After the Abort Multipart Upload request succeeds, you cannot upload any+-- more parts to the multipart upload or complete the multipart upload. Aborting+-- a completed upload fails. However, aborting an already-aborted upload will+-- succeed, for a short time. For more information about uploading a part and+-- completing a multipart upload, see 'UploadMultipartPart' and 'CompleteMultipartUpload'.+--+-- This operation is idempotent.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/working-with-archives.html Working withArchives in Amazon Glacier> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-multipart-abort-upload.html Abort Multipart Upload> in the /Amazon GlacierDeveloper Guide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-AbortMultipartUpload.html>+module Network.AWS.Glacier.AbortMultipartUpload+ (+ -- * Request+ AbortMultipartUpload+ -- ** Request constructor+ , abortMultipartUpload+ -- ** Request lenses+ , amuAccountId+ , amuUploadId+ , amuVaultName++ -- * Response+ , AbortMultipartUploadResponse+ -- ** Response constructor+ , abortMultipartUploadResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data AbortMultipartUpload = AbortMultipartUpload+ { _amuAccountId :: Text+ , _amuUploadId :: Text+ , _amuVaultName :: Text+ } deriving (Eq, Ord, Read, Show)++-- | 'AbortMultipartUpload' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'amuAccountId' @::@ 'Text'+--+-- * 'amuUploadId' @::@ 'Text'+--+-- * 'amuVaultName' @::@ 'Text'+--+abortMultipartUpload :: Text -- ^ 'amuAccountId'+ -> Text -- ^ 'amuVaultName'+ -> Text -- ^ 'amuUploadId'+ -> AbortMultipartUpload+abortMultipartUpload p1 p2 p3 = AbortMultipartUpload+ { _amuAccountId = p1+ , _amuVaultName = p2+ , _amuUploadId = p3+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+amuAccountId :: Lens' AbortMultipartUpload Text+amuAccountId = lens _amuAccountId (\s a -> s { _amuAccountId = a })++-- | The upload ID of the multipart upload to delete.+amuUploadId :: Lens' AbortMultipartUpload Text+amuUploadId = lens _amuUploadId (\s a -> s { _amuUploadId = a })++-- | The name of the vault.+amuVaultName :: Lens' AbortMultipartUpload Text+amuVaultName = lens _amuVaultName (\s a -> s { _amuVaultName = a })++data AbortMultipartUploadResponse = AbortMultipartUploadResponse+ deriving (Eq, Ord, Read, Show, Generic)++-- | 'AbortMultipartUploadResponse' constructor.+abortMultipartUploadResponse :: AbortMultipartUploadResponse+abortMultipartUploadResponse = AbortMultipartUploadResponse++instance ToPath AbortMultipartUpload where+ toPath AbortMultipartUpload{..} = mconcat+ [ "/"+ , toText _amuAccountId+ , "/vaults/"+ , toText _amuVaultName+ , "/multipart-uploads/"+ , toText _amuUploadId+ ]++instance ToQuery AbortMultipartUpload where+ toQuery = const mempty++instance ToHeaders AbortMultipartUpload++instance ToJSON AbortMultipartUpload where+ toJSON = const (toJSON Empty)++instance AWSRequest AbortMultipartUpload where+ type Sv AbortMultipartUpload = Glacier+ type Rs AbortMultipartUpload = AbortMultipartUploadResponse++ request = delete+ response = nullResponse AbortMultipartUploadResponse
+ gen/Network/AWS/Glacier/CompleteMultipartUpload.hs view
@@ -0,0 +1,222 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.CompleteMultipartUpload+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | You call this operation to inform Amazon Glacier that all the archive parts+-- have been uploaded and that Amazon Glacier can now assemble the archive from+-- the uploaded parts. After assembling and saving the archive to the vault,+-- Amazon Glacier returns the URI path of the newly created archive resource.+-- Using the URI path, you can then access the archive. After you upload an+-- archive, you should save the archive ID returned to retrieve the archive at a+-- later point. You can also get the vault inventory to obtain a list of archive+-- IDs in a vault. For more information, see 'InitiateJob'.+--+-- In the request, you must include the computed SHA256 tree hash of the entire+-- archive you have uploaded. For information about computing a SHA256 tree+-- hash, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html Computing Checksums>. On the server side, Amazon Glacier also+-- constructs the SHA256 tree hash of the assembled archive. If the values+-- match, Amazon Glacier saves the archive to the vault; otherwise, it returns+-- an error, and the operation fails. The 'ListParts' operation returns a list of+-- parts uploaded for a specific multipart upload. It includes checksum+-- information for each uploaded part that can be used to debug a bad checksum+-- issue.+--+-- Additionally, Amazon Glacier also checks for any missing content ranges when+-- assembling the archive, if missing content ranges are found, Amazon Glacier+-- returns an error and the operation fails.+--+-- Complete Multipart Upload is an idempotent operation. After your first+-- successful complete multipart upload, if you call the operation again within+-- a short period, the operation will succeed and return the same archive ID.+-- This is useful in the event you experience a network issue that causes an+-- aborted connection or receive a 500 server error, in which case you can+-- repeat your Complete Multipart Upload request and get the same archive ID+-- without creating duplicate archives. Note, however, that after the multipart+-- upload completes, you cannot call the List Parts operation and the multipart+-- upload will not appear in List Multipart Uploads response, even if idempotent+-- complete is possible.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/uploading-archive-mpu.html Uploading LargeArchives in Parts (Multipart Upload)> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-multipart-complete-upload.html Complete Multipart Upload> in the /Amazon Glacier Developer Guide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-CompleteMultipartUpload.html>+module Network.AWS.Glacier.CompleteMultipartUpload+ (+ -- * Request+ CompleteMultipartUpload+ -- ** Request constructor+ , completeMultipartUpload+ -- ** Request lenses+ , cmuAccountId+ , cmuArchiveSize+ , cmuChecksum+ , cmuUploadId+ , cmuVaultName++ -- * Response+ , CompleteMultipartUploadResponse+ -- ** Response constructor+ , completeMultipartUploadResponse+ -- ** Response lenses+ , cmurArchiveId+ , cmurChecksum+ , cmurLocation+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data CompleteMultipartUpload = CompleteMultipartUpload+ { _cmuAccountId :: Text+ , _cmuArchiveSize :: Maybe Text+ , _cmuChecksum :: Maybe Text+ , _cmuUploadId :: Text+ , _cmuVaultName :: Text+ } deriving (Eq, Ord, Read, Show)++-- | 'CompleteMultipartUpload' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cmuAccountId' @::@ 'Text'+--+-- * 'cmuArchiveSize' @::@ 'Maybe' 'Text'+--+-- * 'cmuChecksum' @::@ 'Maybe' 'Text'+--+-- * 'cmuUploadId' @::@ 'Text'+--+-- * 'cmuVaultName' @::@ 'Text'+--+completeMultipartUpload :: Text -- ^ 'cmuAccountId'+ -> Text -- ^ 'cmuVaultName'+ -> Text -- ^ 'cmuUploadId'+ -> CompleteMultipartUpload+completeMultipartUpload p1 p2 p3 = CompleteMultipartUpload+ { _cmuAccountId = p1+ , _cmuVaultName = p2+ , _cmuUploadId = p3+ , _cmuArchiveSize = Nothing+ , _cmuChecksum = Nothing+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+cmuAccountId :: Lens' CompleteMultipartUpload Text+cmuAccountId = lens _cmuAccountId (\s a -> s { _cmuAccountId = a })++-- | The total size, in bytes, of the entire archive. This value should be the sum+-- of all the sizes of the individual parts that you uploaded.+cmuArchiveSize :: Lens' CompleteMultipartUpload (Maybe Text)+cmuArchiveSize = lens _cmuArchiveSize (\s a -> s { _cmuArchiveSize = a })++-- | The SHA256 tree hash of the entire archive. It is the tree hash of SHA256+-- tree hash of the individual parts. If the value you specify in the request+-- does not match the SHA256 tree hash of the final assembled archive as+-- computed by Amazon Glacier, Amazon Glacier returns an error and the request+-- fails.+cmuChecksum :: Lens' CompleteMultipartUpload (Maybe Text)+cmuChecksum = lens _cmuChecksum (\s a -> s { _cmuChecksum = a })++-- | The upload ID of the multipart upload.+cmuUploadId :: Lens' CompleteMultipartUpload Text+cmuUploadId = lens _cmuUploadId (\s a -> s { _cmuUploadId = a })++-- | The name of the vault.+cmuVaultName :: Lens' CompleteMultipartUpload Text+cmuVaultName = lens _cmuVaultName (\s a -> s { _cmuVaultName = a })++data CompleteMultipartUploadResponse = CompleteMultipartUploadResponse+ { _cmurArchiveId :: Maybe Text+ , _cmurChecksum :: Maybe Text+ , _cmurLocation :: Maybe Text+ } deriving (Eq, Ord, Read, Show)++-- | 'CompleteMultipartUploadResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cmurArchiveId' @::@ 'Maybe' 'Text'+--+-- * 'cmurChecksum' @::@ 'Maybe' 'Text'+--+-- * 'cmurLocation' @::@ 'Maybe' 'Text'+--+completeMultipartUploadResponse :: CompleteMultipartUploadResponse+completeMultipartUploadResponse = CompleteMultipartUploadResponse+ { _cmurLocation = Nothing+ , _cmurChecksum = Nothing+ , _cmurArchiveId = Nothing+ }++-- | The ID of the archive. This value is also included as part of the location.+cmurArchiveId :: Lens' CompleteMultipartUploadResponse (Maybe Text)+cmurArchiveId = lens _cmurArchiveId (\s a -> s { _cmurArchiveId = a })++-- | The checksum of the archive computed by Amazon Glacier.+cmurChecksum :: Lens' CompleteMultipartUploadResponse (Maybe Text)+cmurChecksum = lens _cmurChecksum (\s a -> s { _cmurChecksum = a })++-- | The relative URI path of the newly added archive resource.+cmurLocation :: Lens' CompleteMultipartUploadResponse (Maybe Text)+cmurLocation = lens _cmurLocation (\s a -> s { _cmurLocation = a })++instance ToPath CompleteMultipartUpload where+ toPath CompleteMultipartUpload{..} = mconcat+ [ "/"+ , toText _cmuAccountId+ , "/vaults/"+ , toText _cmuVaultName+ , "/multipart-uploads/"+ , toText _cmuUploadId+ ]++instance ToQuery CompleteMultipartUpload where+ toQuery = const mempty++instance ToHeaders CompleteMultipartUpload where+ toHeaders CompleteMultipartUpload{..} = mconcat+ [ "x-amz-archive-size" =: _cmuArchiveSize+ , "x-amz-sha256-tree-hash" =: _cmuChecksum+ ]++instance ToJSON CompleteMultipartUpload where+ toJSON = const (toJSON Empty)++instance AWSRequest CompleteMultipartUpload where+ type Sv CompleteMultipartUpload = Glacier+ type Rs CompleteMultipartUpload = CompleteMultipartUploadResponse++ request = post+ response = headerResponse $ \h -> CompleteMultipartUploadResponse+ <$> h ~:? "x-amz-archive-id"+ <*> h ~:? "x-amz-sha256-tree-hash"+ <*> h ~:? "Location"
+ gen/Network/AWS/Glacier/CreateVault.hs view
@@ -0,0 +1,145 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.CreateVault+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation creates a new vault with the specified name. The name of the+-- vault must be unique within a region for an AWS account. You can create up to+-- 1,000 vaults per account. If you need to create more vaults, contact Amazon+-- Glacier.+--+-- You must use the following guidelines when naming a vault.+--+-- Names can be between 1 and 255 characters long.+--+-- Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and+-- '.' (period).+--+--+--+-- This operation is idempotent.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/creating-vaults.html Creating a Vaultin Amazon Glacier> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-put.html Create Vault > in the /Amazon Glacier Developer Guide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-CreateVault.html>+module Network.AWS.Glacier.CreateVault+ (+ -- * Request+ CreateVault+ -- ** Request constructor+ , createVault+ -- ** Request lenses+ , cvAccountId+ , cvVaultName++ -- * Response+ , CreateVaultResponse+ -- ** Response constructor+ , createVaultResponse+ -- ** Response lenses+ , cvrLocation+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data CreateVault = CreateVault+ { _cvAccountId :: Text+ , _cvVaultName :: Text+ } deriving (Eq, Ord, Read, Show)++-- | 'CreateVault' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cvAccountId' @::@ 'Text'+--+-- * 'cvVaultName' @::@ 'Text'+--+createVault :: Text -- ^ 'cvAccountId'+ -> Text -- ^ 'cvVaultName'+ -> CreateVault+createVault p1 p2 = CreateVault+ { _cvAccountId = p1+ , _cvVaultName = p2+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+cvAccountId :: Lens' CreateVault Text+cvAccountId = lens _cvAccountId (\s a -> s { _cvAccountId = a })++-- | The name of the vault.+cvVaultName :: Lens' CreateVault Text+cvVaultName = lens _cvVaultName (\s a -> s { _cvVaultName = a })++newtype CreateVaultResponse = CreateVaultResponse+ { _cvrLocation :: Maybe Text+ } deriving (Eq, Ord, Read, Show, Monoid)++-- | 'CreateVaultResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cvrLocation' @::@ 'Maybe' 'Text'+--+createVaultResponse :: CreateVaultResponse+createVaultResponse = CreateVaultResponse+ { _cvrLocation = Nothing+ }++-- | The URI of the vault that was created.+cvrLocation :: Lens' CreateVaultResponse (Maybe Text)+cvrLocation = lens _cvrLocation (\s a -> s { _cvrLocation = a })++instance ToPath CreateVault where+ toPath CreateVault{..} = mconcat+ [ "/"+ , toText _cvAccountId+ , "/vaults/"+ , toText _cvVaultName+ ]++instance ToQuery CreateVault where+ toQuery = const mempty++instance ToHeaders CreateVault++instance ToJSON CreateVault where+ toJSON = const (toJSON Empty)++instance AWSRequest CreateVault where+ type Sv CreateVault = Glacier+ type Rs CreateVault = CreateVaultResponse++ request = put+ response = headerResponse $ \h -> CreateVaultResponse+ <$> h ~:? "Location"
+ gen/Network/AWS/Glacier/DeleteArchive.hs view
@@ -0,0 +1,139 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.DeleteArchive+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation deletes an archive from a vault. Subsequent requests to+-- initiate a retrieval of this archive will fail. Archive retrievals that are+-- in progress for this archive ID may or may not succeed according to the+-- following scenarios:+--+-- If the archive retrieval job is actively preparing the data for download+-- when Amazon Glacier receives the delete archive request, the archival+-- retrieval operation might fail. If the archive retrieval job has+-- successfully prepared the archive for download when Amazon Glacier receives+-- the delete archive request, you will be able to download the output. This+-- operation is idempotent. Attempting to delete an already-deleted archive does+-- not result in an error.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/deleting-an-archive.html Deleting anArchive in Amazon Glacier> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-archive-delete.html Delete Archive> in the /Amazon Glacier DeveloperGuide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-DeleteArchive.html>+module Network.AWS.Glacier.DeleteArchive+ (+ -- * Request+ DeleteArchive+ -- ** Request constructor+ , deleteArchive+ -- ** Request lenses+ , daAccountId+ , daArchiveId+ , daVaultName++ -- * Response+ , DeleteArchiveResponse+ -- ** Response constructor+ , deleteArchiveResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data DeleteArchive = DeleteArchive+ { _daAccountId :: Text+ , _daArchiveId :: Text+ , _daVaultName :: Text+ } deriving (Eq, Ord, Read, Show)++-- | 'DeleteArchive' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'daAccountId' @::@ 'Text'+--+-- * 'daArchiveId' @::@ 'Text'+--+-- * 'daVaultName' @::@ 'Text'+--+deleteArchive :: Text -- ^ 'daAccountId'+ -> Text -- ^ 'daVaultName'+ -> Text -- ^ 'daArchiveId'+ -> DeleteArchive+deleteArchive p1 p2 p3 = DeleteArchive+ { _daAccountId = p1+ , _daVaultName = p2+ , _daArchiveId = p3+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+daAccountId :: Lens' DeleteArchive Text+daAccountId = lens _daAccountId (\s a -> s { _daAccountId = a })++-- | The ID of the archive to delete.+daArchiveId :: Lens' DeleteArchive Text+daArchiveId = lens _daArchiveId (\s a -> s { _daArchiveId = a })++-- | The name of the vault.+daVaultName :: Lens' DeleteArchive Text+daVaultName = lens _daVaultName (\s a -> s { _daVaultName = a })++data DeleteArchiveResponse = DeleteArchiveResponse+ deriving (Eq, Ord, Read, Show, Generic)++-- | 'DeleteArchiveResponse' constructor.+deleteArchiveResponse :: DeleteArchiveResponse+deleteArchiveResponse = DeleteArchiveResponse++instance ToPath DeleteArchive where+ toPath DeleteArchive{..} = mconcat+ [ "/"+ , toText _daAccountId+ , "/vaults/"+ , toText _daVaultName+ , "/archives/"+ , toText _daArchiveId+ ]++instance ToQuery DeleteArchive where+ toQuery = const mempty++instance ToHeaders DeleteArchive++instance ToJSON DeleteArchive where+ toJSON = const (toJSON Empty)++instance AWSRequest DeleteArchive where+ type Sv DeleteArchive = Glacier+ type Rs DeleteArchive = DeleteArchiveResponse++ request = delete+ response = nullResponse DeleteArchiveResponse
+ gen/Network/AWS/Glacier/DeleteVault.hs view
@@ -0,0 +1,124 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.DeleteVault+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation deletes a vault. Amazon Glacier will delete a vault only if+-- there are no archives in the vault as of the last inventory and there have+-- been no writes to the vault since the last inventory. If either of these+-- conditions is not satisfied, the vault deletion fails (that is, the vault is+-- not removed) and Amazon Glacier returns an error. You can use 'DescribeVault'+-- to return the number of archives in a vault, and you can use <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html Initiate a Job(POST jobs)> to initiate a new inventory retrieval for a vault. The inventory+-- contains the archive IDs you use to delete archives using <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-archive-delete.html Delete Archive(DELETE archive)>.+--+-- This operation is idempotent.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/deleting-vaults.html Deleting a Vaultin Amazon Glacier> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-delete.html Delete Vault > in the /Amazon Glacier Developer Guide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-DeleteVault.html>+module Network.AWS.Glacier.DeleteVault+ (+ -- * Request+ DeleteVault+ -- ** Request constructor+ , deleteVault+ -- ** Request lenses+ , dv1AccountId+ , dv1VaultName++ -- * Response+ , DeleteVaultResponse+ -- ** Response constructor+ , deleteVaultResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data DeleteVault = DeleteVault+ { _dv1AccountId :: Text+ , _dv1VaultName :: Text+ } deriving (Eq, Ord, Read, Show)++-- | 'DeleteVault' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dv1AccountId' @::@ 'Text'+--+-- * 'dv1VaultName' @::@ 'Text'+--+deleteVault :: Text -- ^ 'dv1AccountId'+ -> Text -- ^ 'dv1VaultName'+ -> DeleteVault+deleteVault p1 p2 = DeleteVault+ { _dv1AccountId = p1+ , _dv1VaultName = p2+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+dv1AccountId :: Lens' DeleteVault Text+dv1AccountId = lens _dv1AccountId (\s a -> s { _dv1AccountId = a })++-- | The name of the vault.+dv1VaultName :: Lens' DeleteVault Text+dv1VaultName = lens _dv1VaultName (\s a -> s { _dv1VaultName = a })++data DeleteVaultResponse = DeleteVaultResponse+ deriving (Eq, Ord, Read, Show, Generic)++-- | 'DeleteVaultResponse' constructor.+deleteVaultResponse :: DeleteVaultResponse+deleteVaultResponse = DeleteVaultResponse++instance ToPath DeleteVault where+ toPath DeleteVault{..} = mconcat+ [ "/"+ , toText _dv1AccountId+ , "/vaults/"+ , toText _dv1VaultName+ ]++instance ToQuery DeleteVault where+ toQuery = const mempty++instance ToHeaders DeleteVault++instance ToJSON DeleteVault where+ toJSON = const (toJSON Empty)++instance AWSRequest DeleteVault where+ type Sv DeleteVault = Glacier+ type Rs DeleteVault = DeleteVaultResponse++ request = delete+ response = nullResponse DeleteVaultResponse
+ gen/Network/AWS/Glacier/DeleteVaultNotifications.hs view
@@ -0,0 +1,122 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.DeleteVaultNotifications+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation deletes the notification configuration set for a vault. The+-- operation is eventually consistent;that is, it might take some time for+-- Amazon Glacier to completely disable the notifications and you might still+-- receive some notifications for a short time after you send the delete+-- request.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/configuring-notifications.html Configuring VaultNotifications in Amazon Glacier> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-notifications-delete.html Delete Vault Notification Configuration >+-- in the Amazon Glacier Developer Guide.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-DeleteVaultNotifications.html>+module Network.AWS.Glacier.DeleteVaultNotifications+ (+ -- * Request+ DeleteVaultNotifications+ -- ** Request constructor+ , deleteVaultNotifications+ -- ** Request lenses+ , dvnAccountId+ , dvnVaultName++ -- * Response+ , DeleteVaultNotificationsResponse+ -- ** Response constructor+ , deleteVaultNotificationsResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data DeleteVaultNotifications = DeleteVaultNotifications+ { _dvnAccountId :: Text+ , _dvnVaultName :: Text+ } deriving (Eq, Ord, Read, Show)++-- | 'DeleteVaultNotifications' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dvnAccountId' @::@ 'Text'+--+-- * 'dvnVaultName' @::@ 'Text'+--+deleteVaultNotifications :: Text -- ^ 'dvnAccountId'+ -> Text -- ^ 'dvnVaultName'+ -> DeleteVaultNotifications+deleteVaultNotifications p1 p2 = DeleteVaultNotifications+ { _dvnAccountId = p1+ , _dvnVaultName = p2+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+dvnAccountId :: Lens' DeleteVaultNotifications Text+dvnAccountId = lens _dvnAccountId (\s a -> s { _dvnAccountId = a })++-- | The name of the vault.+dvnVaultName :: Lens' DeleteVaultNotifications Text+dvnVaultName = lens _dvnVaultName (\s a -> s { _dvnVaultName = a })++data DeleteVaultNotificationsResponse = DeleteVaultNotificationsResponse+ deriving (Eq, Ord, Read, Show, Generic)++-- | 'DeleteVaultNotificationsResponse' constructor.+deleteVaultNotificationsResponse :: DeleteVaultNotificationsResponse+deleteVaultNotificationsResponse = DeleteVaultNotificationsResponse++instance ToPath DeleteVaultNotifications where+ toPath DeleteVaultNotifications{..} = mconcat+ [ "/"+ , toText _dvnAccountId+ , "/vaults/"+ , toText _dvnVaultName+ , "/notification-configuration"+ ]++instance ToQuery DeleteVaultNotifications where+ toQuery = const mempty++instance ToHeaders DeleteVaultNotifications++instance ToJSON DeleteVaultNotifications where+ toJSON = const (toJSON Empty)++instance AWSRequest DeleteVaultNotifications where+ type Sv DeleteVaultNotifications = Glacier+ type Rs DeleteVaultNotifications = DeleteVaultNotificationsResponse++ request = delete+ response = nullResponse DeleteVaultNotificationsResponse
+ gen/Network/AWS/Glacier/DescribeJob.hs view
@@ -0,0 +1,357 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.DescribeJob+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation returns information about a job you previously initiated,+-- including the job initiation date, the user who initiated the job, the job+-- status code/message and the Amazon SNS topic to notify after Amazon Glacier+-- completes the job. For more information about initiating a job, see 'InitiateJob'.+--+-- This operation enables you to check the status of your job. However, it is+-- strongly recommended that you set up an Amazon SNS topic and specify it in+-- your initiate job request so that Amazon Glacier can notify the topic after+-- it completes the job.+--+-- A job ID will not expire for at least 24 hours after Amazon Glacier+-- completes the job.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For information about the underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-describe-job-get.html Working with Archivesin Amazon Glacier> in the /Amazon Glacier Developer Guide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-DescribeJob.html>+module Network.AWS.Glacier.DescribeJob+ (+ -- * Request+ DescribeJob+ -- ** Request constructor+ , describeJob+ -- ** Request lenses+ , djAccountId+ , djJobId+ , djVaultName++ -- * Response+ , DescribeJobResponse+ -- ** Response constructor+ , describeJobResponse+ -- ** Response lenses+ , djrAction+ , djrArchiveId+ , djrArchiveSHA256TreeHash+ , djrArchiveSizeInBytes+ , djrCompleted+ , djrCompletionDate+ , djrCreationDate+ , djrInventoryRetrievalParameters+ , djrInventorySizeInBytes+ , djrJobDescription+ , djrJobId+ , djrRetrievalByteRange+ , djrSHA256TreeHash+ , djrSNSTopic+ , djrStatusCode+ , djrStatusMessage+ , djrVaultARN+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data DescribeJob = DescribeJob+ { _djAccountId :: Text+ , _djJobId :: Text+ , _djVaultName :: Text+ } deriving (Eq, Ord, Read, Show)++-- | 'DescribeJob' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'djAccountId' @::@ 'Text'+--+-- * 'djJobId' @::@ 'Text'+--+-- * 'djVaultName' @::@ 'Text'+--+describeJob :: Text -- ^ 'djAccountId'+ -> Text -- ^ 'djVaultName'+ -> Text -- ^ 'djJobId'+ -> DescribeJob+describeJob p1 p2 p3 = DescribeJob+ { _djAccountId = p1+ , _djVaultName = p2+ , _djJobId = p3+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+djAccountId :: Lens' DescribeJob Text+djAccountId = lens _djAccountId (\s a -> s { _djAccountId = a })++-- | The ID of the job to describe.+djJobId :: Lens' DescribeJob Text+djJobId = lens _djJobId (\s a -> s { _djJobId = a })++-- | The name of the vault.+djVaultName :: Lens' DescribeJob Text+djVaultName = lens _djVaultName (\s a -> s { _djVaultName = a })++data DescribeJobResponse = DescribeJobResponse+ { _djrAction :: Maybe ActionCode+ , _djrArchiveId :: Maybe Text+ , _djrArchiveSHA256TreeHash :: Maybe Text+ , _djrArchiveSizeInBytes :: Maybe Integer+ , _djrCompleted :: Maybe Bool+ , _djrCompletionDate :: Maybe Text+ , _djrCreationDate :: Maybe Text+ , _djrInventoryRetrievalParameters :: Maybe InventoryRetrievalJobDescription+ , _djrInventorySizeInBytes :: Maybe Integer+ , _djrJobDescription :: Maybe Text+ , _djrJobId :: Maybe Text+ , _djrRetrievalByteRange :: Maybe Text+ , _djrSHA256TreeHash :: Maybe Text+ , _djrSNSTopic :: Maybe Text+ , _djrStatusCode :: Maybe StatusCode+ , _djrStatusMessage :: Maybe Text+ , _djrVaultARN :: Maybe Text+ } deriving (Eq, Read, Show)++-- | 'DescribeJobResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'djrAction' @::@ 'Maybe' 'ActionCode'+--+-- * 'djrArchiveId' @::@ 'Maybe' 'Text'+--+-- * 'djrArchiveSHA256TreeHash' @::@ 'Maybe' 'Text'+--+-- * 'djrArchiveSizeInBytes' @::@ 'Maybe' 'Integer'+--+-- * 'djrCompleted' @::@ 'Maybe' 'Bool'+--+-- * 'djrCompletionDate' @::@ 'Maybe' 'Text'+--+-- * 'djrCreationDate' @::@ 'Maybe' 'Text'+--+-- * 'djrInventoryRetrievalParameters' @::@ 'Maybe' 'InventoryRetrievalJobDescription'+--+-- * 'djrInventorySizeInBytes' @::@ 'Maybe' 'Integer'+--+-- * 'djrJobDescription' @::@ 'Maybe' 'Text'+--+-- * 'djrJobId' @::@ 'Maybe' 'Text'+--+-- * 'djrRetrievalByteRange' @::@ 'Maybe' 'Text'+--+-- * 'djrSHA256TreeHash' @::@ 'Maybe' 'Text'+--+-- * 'djrSNSTopic' @::@ 'Maybe' 'Text'+--+-- * 'djrStatusCode' @::@ 'Maybe' 'StatusCode'+--+-- * 'djrStatusMessage' @::@ 'Maybe' 'Text'+--+-- * 'djrVaultARN' @::@ 'Maybe' 'Text'+--+describeJobResponse :: DescribeJobResponse+describeJobResponse = DescribeJobResponse+ { _djrJobId = Nothing+ , _djrJobDescription = Nothing+ , _djrAction = Nothing+ , _djrArchiveId = Nothing+ , _djrVaultARN = Nothing+ , _djrCreationDate = Nothing+ , _djrCompleted = Nothing+ , _djrStatusCode = Nothing+ , _djrStatusMessage = Nothing+ , _djrArchiveSizeInBytes = Nothing+ , _djrInventorySizeInBytes = Nothing+ , _djrSNSTopic = Nothing+ , _djrCompletionDate = Nothing+ , _djrSHA256TreeHash = Nothing+ , _djrArchiveSHA256TreeHash = Nothing+ , _djrRetrievalByteRange = Nothing+ , _djrInventoryRetrievalParameters = Nothing+ }++-- | The job type. It is either ArchiveRetrieval or InventoryRetrieval.+djrAction :: Lens' DescribeJobResponse (Maybe ActionCode)+djrAction = lens _djrAction (\s a -> s { _djrAction = a })++-- | For an ArchiveRetrieval job, this is the archive ID requested for download.+-- Otherwise, this field is null.+djrArchiveId :: Lens' DescribeJobResponse (Maybe Text)+djrArchiveId = lens _djrArchiveId (\s a -> s { _djrArchiveId = a })++-- | The SHA256 tree hash of the entire archive for an archive retrieval. For+-- inventory retrieval jobs, this field is null.+djrArchiveSHA256TreeHash :: Lens' DescribeJobResponse (Maybe Text)+djrArchiveSHA256TreeHash =+ lens _djrArchiveSHA256TreeHash+ (\s a -> s { _djrArchiveSHA256TreeHash = a })++-- | For an ArchiveRetrieval job, this is the size in bytes of the archive being+-- requested for download. For the InventoryRetrieval job, the value is null.+djrArchiveSizeInBytes :: Lens' DescribeJobResponse (Maybe Integer)+djrArchiveSizeInBytes =+ lens _djrArchiveSizeInBytes (\s a -> s { _djrArchiveSizeInBytes = a })++-- | The job status. When a job is completed, you get the job's output.+djrCompleted :: Lens' DescribeJobResponse (Maybe Bool)+djrCompleted = lens _djrCompleted (\s a -> s { _djrCompleted = a })++-- | The UTC time that the archive retrieval request completed. While the job is+-- in progress, the value will be null.+djrCompletionDate :: Lens' DescribeJobResponse (Maybe Text)+djrCompletionDate =+ lens _djrCompletionDate (\s a -> s { _djrCompletionDate = a })++-- | The UTC date when the job was created. A string representation of ISO 8601+-- date format, for example, "2012-03-20T17:03:43.221Z".+djrCreationDate :: Lens' DescribeJobResponse (Maybe Text)+djrCreationDate = lens _djrCreationDate (\s a -> s { _djrCreationDate = a })++-- | Parameters used for range inventory retrieval.+djrInventoryRetrievalParameters :: Lens' DescribeJobResponse (Maybe InventoryRetrievalJobDescription)+djrInventoryRetrievalParameters =+ lens _djrInventoryRetrievalParameters+ (\s a -> s { _djrInventoryRetrievalParameters = a })++-- | For an InventoryRetrieval job, this is the size in bytes of the inventory+-- requested for download. For the ArchiveRetrieval job, the value is null.+djrInventorySizeInBytes :: Lens' DescribeJobResponse (Maybe Integer)+djrInventorySizeInBytes =+ lens _djrInventorySizeInBytes (\s a -> s { _djrInventorySizeInBytes = a })++-- | The job description you provided when you initiated the job.+djrJobDescription :: Lens' DescribeJobResponse (Maybe Text)+djrJobDescription =+ lens _djrJobDescription (\s a -> s { _djrJobDescription = a })++-- | An opaque string that identifies an Amazon Glacier job.+djrJobId :: Lens' DescribeJobResponse (Maybe Text)+djrJobId = lens _djrJobId (\s a -> s { _djrJobId = a })++-- | The retrieved byte range for archive retrieval jobs in the form "/StartByteValue/-/EndByteValue/" If no range was specified in the archive retrieval, then the+-- whole archive is retrieved and /StartByteValue/ equals 0 and /EndByteValue/+-- equals the size of the archive minus 1. For inventory retrieval jobs this+-- field is null.+djrRetrievalByteRange :: Lens' DescribeJobResponse (Maybe Text)+djrRetrievalByteRange =+ lens _djrRetrievalByteRange (\s a -> s { _djrRetrievalByteRange = a })++-- | For an ArchiveRetrieval job, it is the checksum of the archive. Otherwise,+-- the value is null.+--+-- The SHA256 tree hash value for the requested range of an archive. If the+-- Initiate a Job request for an archive specified a tree-hash aligned range,+-- then this field returns a value.+--+-- For the specific case when the whole archive is retrieved, this value is+-- the same as the ArchiveSHA256TreeHash value.+--+-- This field is null in the following situations: Archive retrieval jobs+-- that specify a range that is not tree-hash aligned.+--+-- Archival jobs that specify a range that is equal to the whole archive and+-- the job status is InProgress.+--+-- Inventory jobs.+--+--+djrSHA256TreeHash :: Lens' DescribeJobResponse (Maybe Text)+djrSHA256TreeHash =+ lens _djrSHA256TreeHash (\s a -> s { _djrSHA256TreeHash = a })++-- | An Amazon Simple Notification Service (Amazon SNS) topic that receives+-- notification.+djrSNSTopic :: Lens' DescribeJobResponse (Maybe Text)+djrSNSTopic = lens _djrSNSTopic (\s a -> s { _djrSNSTopic = a })++-- | The status code can be InProgress, Succeeded, or Failed, and indicates the+-- status of the job.+djrStatusCode :: Lens' DescribeJobResponse (Maybe StatusCode)+djrStatusCode = lens _djrStatusCode (\s a -> s { _djrStatusCode = a })++-- | A friendly message that describes the job status.+djrStatusMessage :: Lens' DescribeJobResponse (Maybe Text)+djrStatusMessage = lens _djrStatusMessage (\s a -> s { _djrStatusMessage = a })++-- | The Amazon Resource Name (ARN) of the vault from which the archive retrieval+-- was requested.+djrVaultARN :: Lens' DescribeJobResponse (Maybe Text)+djrVaultARN = lens _djrVaultARN (\s a -> s { _djrVaultARN = a })++instance ToPath DescribeJob where+ toPath DescribeJob{..} = mconcat+ [ "/"+ , toText _djAccountId+ , "/vaults/"+ , toText _djVaultName+ , "/jobs/"+ , toText _djJobId+ ]++instance ToQuery DescribeJob where+ toQuery = const mempty++instance ToHeaders DescribeJob++instance ToJSON DescribeJob where+ toJSON = const (toJSON Empty)++instance AWSRequest DescribeJob where+ type Sv DescribeJob = Glacier+ type Rs DescribeJob = DescribeJobResponse++ request = get+ response = jsonResponse++instance FromJSON DescribeJobResponse where+ parseJSON = withObject "DescribeJobResponse" $ \o -> DescribeJobResponse+ <$> o .:? "Action"+ <*> o .:? "ArchiveId"+ <*> o .:? "ArchiveSHA256TreeHash"+ <*> o .:? "ArchiveSizeInBytes"+ <*> o .:? "Completed"+ <*> o .:? "CompletionDate"+ <*> o .:? "CreationDate"+ <*> o .:? "InventoryRetrievalParameters"+ <*> o .:? "InventorySizeInBytes"+ <*> o .:? "JobDescription"+ <*> o .:? "JobId"+ <*> o .:? "RetrievalByteRange"+ <*> o .:? "SHA256TreeHash"+ <*> o .:? "SNSTopic"+ <*> o .:? "StatusCode"+ <*> o .:? "StatusMessage"+ <*> o .:? "VaultARN"
+ gen/Network/AWS/Glacier/DescribeVault.hs view
@@ -0,0 +1,201 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.DescribeVault+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation returns information about a vault, including the vault's+-- Amazon Resource Name (ARN), the date the vault was created, the number of+-- archives it contains, and the total size of all the archives in the vault.+-- The number of archives and their total size are as of the last inventory+-- generation. This means that if you add or remove an archive from a vault, and+-- then immediately use Describe Vault, the change in contents will not be+-- immediately reflected. If you want to retrieve the latest inventory of the+-- vault, use 'InitiateJob'. Amazon Glacier generates vault inventories+-- approximately daily. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-inventory.html Downloading a Vault Inventoryin Amazon Glacier>.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/retrieving-vault-info.html Retrieving VaultMetadata in Amazon Glacier> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-get.html Describe Vault > in the /Amazon GlacierDeveloper Guide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-DescribeVault.html>+module Network.AWS.Glacier.DescribeVault+ (+ -- * Request+ DescribeVault+ -- ** Request constructor+ , describeVault+ -- ** Request lenses+ , dvAccountId+ , dvVaultName++ -- * Response+ , DescribeVaultResponse+ -- ** Response constructor+ , describeVaultResponse+ -- ** Response lenses+ , dvrCreationDate+ , dvrLastInventoryDate+ , dvrNumberOfArchives+ , dvrSizeInBytes+ , dvrVaultARN+ , dvrVaultName+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data DescribeVault = DescribeVault+ { _dvAccountId :: Text+ , _dvVaultName :: Text+ } deriving (Eq, Ord, Read, Show)++-- | 'DescribeVault' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dvAccountId' @::@ 'Text'+--+-- * 'dvVaultName' @::@ 'Text'+--+describeVault :: Text -- ^ 'dvAccountId'+ -> Text -- ^ 'dvVaultName'+ -> DescribeVault+describeVault p1 p2 = DescribeVault+ { _dvAccountId = p1+ , _dvVaultName = p2+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+dvAccountId :: Lens' DescribeVault Text+dvAccountId = lens _dvAccountId (\s a -> s { _dvAccountId = a })++-- | The name of the vault.+dvVaultName :: Lens' DescribeVault Text+dvVaultName = lens _dvVaultName (\s a -> s { _dvVaultName = a })++data DescribeVaultResponse = DescribeVaultResponse+ { _dvrCreationDate :: Maybe Text+ , _dvrLastInventoryDate :: Maybe Text+ , _dvrNumberOfArchives :: Maybe Integer+ , _dvrSizeInBytes :: Maybe Integer+ , _dvrVaultARN :: Maybe Text+ , _dvrVaultName :: Maybe Text+ } deriving (Eq, Ord, Read, Show)++-- | 'DescribeVaultResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dvrCreationDate' @::@ 'Maybe' 'Text'+--+-- * 'dvrLastInventoryDate' @::@ 'Maybe' 'Text'+--+-- * 'dvrNumberOfArchives' @::@ 'Maybe' 'Integer'+--+-- * 'dvrSizeInBytes' @::@ 'Maybe' 'Integer'+--+-- * 'dvrVaultARN' @::@ 'Maybe' 'Text'+--+-- * 'dvrVaultName' @::@ 'Maybe' 'Text'+--+describeVaultResponse :: DescribeVaultResponse+describeVaultResponse = DescribeVaultResponse+ { _dvrVaultARN = Nothing+ , _dvrVaultName = Nothing+ , _dvrCreationDate = Nothing+ , _dvrLastInventoryDate = Nothing+ , _dvrNumberOfArchives = Nothing+ , _dvrSizeInBytes = Nothing+ }++-- | The UTC date when the vault was created. A string representation of ISO 8601+-- date format, for example, "2012-03-20T17:03:43.221Z".+dvrCreationDate :: Lens' DescribeVaultResponse (Maybe Text)+dvrCreationDate = lens _dvrCreationDate (\s a -> s { _dvrCreationDate = a })++-- | The UTC date when Amazon Glacier completed the last vault inventory. A string+-- representation of ISO 8601 date format, for example,+-- "2012-03-20T17:03:43.221Z".+dvrLastInventoryDate :: Lens' DescribeVaultResponse (Maybe Text)+dvrLastInventoryDate =+ lens _dvrLastInventoryDate (\s a -> s { _dvrLastInventoryDate = a })++-- | The number of archives in the vault as of the last inventory date. This field+-- will return 'null' if an inventory has not yet run on the vault, for example,+-- if you just created the vault.+dvrNumberOfArchives :: Lens' DescribeVaultResponse (Maybe Integer)+dvrNumberOfArchives =+ lens _dvrNumberOfArchives (\s a -> s { _dvrNumberOfArchives = a })++-- | Total size, in bytes, of the archives in the vault as of the last inventory+-- date. This field will return null if an inventory has not yet run on the+-- vault, for example, if you just created the vault.+dvrSizeInBytes :: Lens' DescribeVaultResponse (Maybe Integer)+dvrSizeInBytes = lens _dvrSizeInBytes (\s a -> s { _dvrSizeInBytes = a })++-- | The Amazon Resource Name (ARN) of the vault.+dvrVaultARN :: Lens' DescribeVaultResponse (Maybe Text)+dvrVaultARN = lens _dvrVaultARN (\s a -> s { _dvrVaultARN = a })++-- | The name of the vault.+dvrVaultName :: Lens' DescribeVaultResponse (Maybe Text)+dvrVaultName = lens _dvrVaultName (\s a -> s { _dvrVaultName = a })++instance ToPath DescribeVault where+ toPath DescribeVault{..} = mconcat+ [ "/"+ , toText _dvAccountId+ , "/vaults/"+ , toText _dvVaultName+ ]++instance ToQuery DescribeVault where+ toQuery = const mempty++instance ToHeaders DescribeVault++instance ToJSON DescribeVault where+ toJSON = const (toJSON Empty)++instance AWSRequest DescribeVault where+ type Sv DescribeVault = Glacier+ type Rs DescribeVault = DescribeVaultResponse++ request = get+ response = jsonResponse++instance FromJSON DescribeVaultResponse where+ parseJSON = withObject "DescribeVaultResponse" $ \o -> DescribeVaultResponse+ <$> o .:? "CreationDate"+ <*> o .:? "LastInventoryDate"+ <*> o .:? "NumberOfArchives"+ <*> o .:? "SizeInBytes"+ <*> o .:? "VaultARN"+ <*> o .:? "VaultName"
+ gen/Network/AWS/Glacier/GetDataRetrievalPolicy.hs view
@@ -0,0 +1,109 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.GetDataRetrievalPolicy+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-GetDataRetrievalPolicy.html>+module Network.AWS.Glacier.GetDataRetrievalPolicy+ (+ -- * Request+ GetDataRetrievalPolicy+ -- ** Request constructor+ , getDataRetrievalPolicy+ -- ** Request lenses+ , gdrpAccountId++ -- * Response+ , GetDataRetrievalPolicyResponse+ -- ** Response constructor+ , getDataRetrievalPolicyResponse+ -- ** Response lenses+ , gdrprPolicy+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++newtype GetDataRetrievalPolicy = GetDataRetrievalPolicy+ { _gdrpAccountId :: Text+ } deriving (Eq, Ord, Read, Show, Monoid, IsString)++-- | 'GetDataRetrievalPolicy' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gdrpAccountId' @::@ 'Text'+--+getDataRetrievalPolicy :: Text -- ^ 'gdrpAccountId'+ -> GetDataRetrievalPolicy+getDataRetrievalPolicy p1 = GetDataRetrievalPolicy+ { _gdrpAccountId = p1+ }++gdrpAccountId :: Lens' GetDataRetrievalPolicy Text+gdrpAccountId = lens _gdrpAccountId (\s a -> s { _gdrpAccountId = a })++newtype GetDataRetrievalPolicyResponse = GetDataRetrievalPolicyResponse+ { _gdrprPolicy :: Maybe DataRetrievalPolicy+ } deriving (Eq, Read, Show)++-- | 'GetDataRetrievalPolicyResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gdrprPolicy' @::@ 'Maybe' 'DataRetrievalPolicy'+--+getDataRetrievalPolicyResponse :: GetDataRetrievalPolicyResponse+getDataRetrievalPolicyResponse = GetDataRetrievalPolicyResponse+ { _gdrprPolicy = Nothing+ }++gdrprPolicy :: Lens' GetDataRetrievalPolicyResponse (Maybe DataRetrievalPolicy)+gdrprPolicy = lens _gdrprPolicy (\s a -> s { _gdrprPolicy = a })++instance ToPath GetDataRetrievalPolicy where+ toPath GetDataRetrievalPolicy{..} = mconcat+ [ "/"+ , toText _gdrpAccountId+ , "/policies/data-retrieval"+ ]++instance ToQuery GetDataRetrievalPolicy where+ toQuery = const mempty++instance ToHeaders GetDataRetrievalPolicy++instance ToJSON GetDataRetrievalPolicy where+ toJSON = const (toJSON Empty)++instance AWSRequest GetDataRetrievalPolicy where+ type Sv GetDataRetrievalPolicy = Glacier+ type Rs GetDataRetrievalPolicy = GetDataRetrievalPolicyResponse++ request = get+ response = jsonResponse++instance FromJSON GetDataRetrievalPolicyResponse where+ parseJSON = withObject "GetDataRetrievalPolicyResponse" $ \o -> GetDataRetrievalPolicyResponse+ <$> o .:? "Policy"
+ gen/Network/AWS/Glacier/GetJobOutput.hs view
@@ -0,0 +1,269 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.GetJobOutput+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation downloads the output of the job you initiated using 'InitiateJob'+-- . Depending on the job type you specified when you initiated the job, the+-- output will be either the content of an archive or a vault inventory.+--+-- A job ID will not expire for at least 24 hours after Amazon Glacier+-- completes the job. That is, you can download the job output within the 24+-- hours period after Amazon Glacier completes the job.+--+-- If the job output is large, then you can use the 'Range' request header to+-- retrieve a portion of the output. This allows you to download the entire+-- output in smaller chunks of bytes. For example, suppose you have 1 GB of job+-- output you want to download and you decide to download 128 MB chunks of data+-- at a time, which is a total of eight Get Job Output requests. You use the+-- following process to download the job output:+--+-- Download a 128 MB chunk of output by specifying the appropriate byte range+-- using the 'Range' header.+--+-- Along with the data, the response includes a checksum of the payload. You+-- compute the checksum of the payload on the client and compare it with the+-- checksum you received in the response to ensure you received all the expected+-- data.+--+-- Repeat steps 1 and 2 for all the eight 128 MB chunks of output data, each+-- time specifying the appropriate byte range.+--+-- After downloading all the parts of the job output, you have a list of+-- eight checksum values. Compute the tree hash of these values to find the+-- checksum of the entire output. Using the 'DescribeJob' API, obtain job+-- information of the job that provided you the output. The response includes+-- the checksum of the entire archive stored in Amazon Glacier. You compare this+-- value with the checksum you computed to ensure you have downloaded the entire+-- archive content with no errors.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and the underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-inventory.html Downloading aVault Inventory>, <http://docs.aws.amazon.com/amazonglacier/latest/dev/downloading-an-archive.html Downloading an Archive>, and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-job-output-get.html Get Job Output >+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-GetJobOutput.html>+module Network.AWS.Glacier.GetJobOutput+ (+ -- * Request+ GetJobOutput+ -- ** Request constructor+ , getJobOutput+ -- ** Request lenses+ , gjoAccountId+ , gjoJobId+ , gjoRange+ , gjoVaultName++ -- * Response+ , GetJobOutputResponse+ -- ** Response constructor+ , getJobOutputResponse+ -- ** Response lenses+ , gjorAcceptRanges+ , gjorArchiveDescription+ , gjorBody+ , gjorChecksum+ , gjorContentRange+ , gjorContentType+ , gjorStatus+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data GetJobOutput = GetJobOutput+ { _gjoAccountId :: Text+ , _gjoJobId :: Text+ , _gjoRange :: Maybe Text+ , _gjoVaultName :: Text+ } deriving (Eq, Ord, Read, Show)++-- | 'GetJobOutput' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gjoAccountId' @::@ 'Text'+--+-- * 'gjoJobId' @::@ 'Text'+--+-- * 'gjoRange' @::@ 'Maybe' 'Text'+--+-- * 'gjoVaultName' @::@ 'Text'+--+getJobOutput :: Text -- ^ 'gjoAccountId'+ -> Text -- ^ 'gjoVaultName'+ -> Text -- ^ 'gjoJobId'+ -> GetJobOutput+getJobOutput p1 p2 p3 = GetJobOutput+ { _gjoAccountId = p1+ , _gjoVaultName = p2+ , _gjoJobId = p3+ , _gjoRange = Nothing+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+gjoAccountId :: Lens' GetJobOutput Text+gjoAccountId = lens _gjoAccountId (\s a -> s { _gjoAccountId = a })++-- | The job ID whose data is downloaded.+gjoJobId :: Lens' GetJobOutput Text+gjoJobId = lens _gjoJobId (\s a -> s { _gjoJobId = a })++-- | The range of bytes to retrieve from the output. For example, if you want to+-- download the first 1,048,576 bytes, specify "Range: bytes=0-1048575". By+-- default, this operation downloads the entire output.+gjoRange :: Lens' GetJobOutput (Maybe Text)+gjoRange = lens _gjoRange (\s a -> s { _gjoRange = a })++-- | The name of the vault.+gjoVaultName :: Lens' GetJobOutput Text+gjoVaultName = lens _gjoVaultName (\s a -> s { _gjoVaultName = a })++data GetJobOutputResponse = GetJobOutputResponse+ { _gjorAcceptRanges :: Maybe Text+ , _gjorArchiveDescription :: Maybe Text+ , _gjorBody :: RsBody+ , _gjorChecksum :: Maybe Text+ , _gjorContentRange :: Maybe Text+ , _gjorContentType :: Maybe Text+ , _gjorStatus :: Maybe Int+ } deriving (Show)++-- | 'GetJobOutputResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gjorAcceptRanges' @::@ 'Maybe' 'Text'+--+-- * 'gjorArchiveDescription' @::@ 'Maybe' 'Text'+--+-- * 'gjorBody' @::@ 'RsBody'+--+-- * 'gjorChecksum' @::@ 'Maybe' 'Text'+--+-- * 'gjorContentRange' @::@ 'Maybe' 'Text'+--+-- * 'gjorContentType' @::@ 'Maybe' 'Text'+--+-- * 'gjorStatus' @::@ 'Maybe' 'Int'+--+getJobOutputResponse :: RsBody -- ^ 'gjorBody'+ -> GetJobOutputResponse+getJobOutputResponse p1 = GetJobOutputResponse+ { _gjorBody = p1+ , _gjorChecksum = Nothing+ , _gjorStatus = Nothing+ , _gjorContentRange = Nothing+ , _gjorAcceptRanges = Nothing+ , _gjorContentType = Nothing+ , _gjorArchiveDescription = Nothing+ }++-- | Indicates the range units accepted. For more information, go to <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html RFC2616>.+gjorAcceptRanges :: Lens' GetJobOutputResponse (Maybe Text)+gjorAcceptRanges = lens _gjorAcceptRanges (\s a -> s { _gjorAcceptRanges = a })++-- | The description of an archive.+gjorArchiveDescription :: Lens' GetJobOutputResponse (Maybe Text)+gjorArchiveDescription =+ lens _gjorArchiveDescription (\s a -> s { _gjorArchiveDescription = a })++-- | The job data, either archive data or inventory data.+gjorBody :: Lens' GetJobOutputResponse RsBody+gjorBody = lens _gjorBody (\s a -> s { _gjorBody = a })++-- | The checksum of the data in the response. This header is returned only when+-- retrieving the output for an archive retrieval job. Furthermore, this header+-- appears only under the following conditions: You get the entire range of the+-- archive. You request a range to return of the archive that starts and ends on+-- a multiple of 1 MB. For example, if you have an 3.1 MB archive and you+-- specify a range to return that starts at 1 MB and ends at 2 MB, then the+-- x-amz-sha256-tree-hash is returned as a response header. You request a range+-- of the archive to return that starts on a multiple of 1 MB and goes to the+-- end of the archive. For example, if you have a 3.1 MB archive and you specify+-- a range that starts at 2 MB and ends at 3.1 MB (the end of the archive), then+-- the x-amz-sha256-tree-hash is returned as a response header.+gjorChecksum :: Lens' GetJobOutputResponse (Maybe Text)+gjorChecksum = lens _gjorChecksum (\s a -> s { _gjorChecksum = a })++-- | The range of bytes returned by Amazon Glacier. If only partial output is+-- downloaded, the response provides the range of bytes Amazon Glacier returned.+-- For example, bytes 0-1048575/8388608 returns the first 1 MB from 8 MB.+gjorContentRange :: Lens' GetJobOutputResponse (Maybe Text)+gjorContentRange = lens _gjorContentRange (\s a -> s { _gjorContentRange = a })++-- | The Content-Type depends on whether the job output is an archive or a vault+-- inventory. For archive data, the Content-Type is application/octet-stream.+-- For vault inventory, if you requested CSV format when you initiated the job,+-- the Content-Type is text/csv. Otherwise, by default, vault inventory is+-- returned as JSON, and the Content-Type is application/json.+gjorContentType :: Lens' GetJobOutputResponse (Maybe Text)+gjorContentType = lens _gjorContentType (\s a -> s { _gjorContentType = a })++-- | The HTTP response code for a job output request. The value depends on whether+-- a range was specified in the request.+gjorStatus :: Lens' GetJobOutputResponse (Maybe Int)+gjorStatus = lens _gjorStatus (\s a -> s { _gjorStatus = a })++instance ToPath GetJobOutput where+ toPath GetJobOutput{..} = mconcat+ [ "/"+ , toText _gjoAccountId+ , "/vaults/"+ , toText _gjoVaultName+ , "/jobs/"+ , toText _gjoJobId+ , "/output"+ ]++instance ToQuery GetJobOutput where+ toQuery = const mempty++instance ToHeaders GetJobOutput where+ toHeaders GetJobOutput{..} = mconcat+ [ "Range" =: _gjoRange+ ]++instance ToJSON GetJobOutput where+ toJSON = const (toJSON Empty)++instance AWSRequest GetJobOutput where+ type Sv GetJobOutput = Glacier+ type Rs GetJobOutput = GetJobOutputResponse++ request = get+ response = bodyResponse $ \h s b -> GetJobOutputResponse+ <$> h ~:? "Accept-Ranges"+ <*> h ~:? "x-amz-archive-description"+ <*> pure (RsBody b)+ <*> h ~:? "x-amz-sha256-tree-hash"+ <*> h ~:? "Content-Range"+ <*> h ~:? "Content-Type"+ <*> pure (Just s)
+ gen/Network/AWS/Glacier/GetVaultNotifications.hs view
@@ -0,0 +1,143 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.GetVaultNotifications+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation retrieves the 'notification-configuration' subresource of the+-- specified vault.+--+-- For information about setting a notification configuration on a vault, see 'SetVaultNotifications'. If a notification configuration for a vault is not set, the operation+-- returns a '404 Not Found' error. For more information about vault+-- notifications, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/configuring-notifications.html Configuring Vault Notifications in Amazon Glacier>.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/configuring-notifications.html Configuring VaultNotifications in Amazon Glacier> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-notifications-get.html Get Vault Notification Configuration > in+-- the /Amazon Glacier Developer Guide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-GetVaultNotifications.html>+module Network.AWS.Glacier.GetVaultNotifications+ (+ -- * Request+ GetVaultNotifications+ -- ** Request constructor+ , getVaultNotifications+ -- ** Request lenses+ , gvnAccountId+ , gvnVaultName++ -- * Response+ , GetVaultNotificationsResponse+ -- ** Response constructor+ , getVaultNotificationsResponse+ -- ** Response lenses+ , gvnrVaultNotificationConfig+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data GetVaultNotifications = GetVaultNotifications+ { _gvnAccountId :: Text+ , _gvnVaultName :: Text+ } deriving (Eq, Ord, Read, Show)++-- | 'GetVaultNotifications' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gvnAccountId' @::@ 'Text'+--+-- * 'gvnVaultName' @::@ 'Text'+--+getVaultNotifications :: Text -- ^ 'gvnAccountId'+ -> Text -- ^ 'gvnVaultName'+ -> GetVaultNotifications+getVaultNotifications p1 p2 = GetVaultNotifications+ { _gvnAccountId = p1+ , _gvnVaultName = p2+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+gvnAccountId :: Lens' GetVaultNotifications Text+gvnAccountId = lens _gvnAccountId (\s a -> s { _gvnAccountId = a })++-- | The name of the vault.+gvnVaultName :: Lens' GetVaultNotifications Text+gvnVaultName = lens _gvnVaultName (\s a -> s { _gvnVaultName = a })++newtype GetVaultNotificationsResponse = GetVaultNotificationsResponse+ { _gvnrVaultNotificationConfig :: Maybe VaultNotificationConfig+ } deriving (Eq, Read, Show)++-- | 'GetVaultNotificationsResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gvnrVaultNotificationConfig' @::@ 'Maybe' 'VaultNotificationConfig'+--+getVaultNotificationsResponse :: GetVaultNotificationsResponse+getVaultNotificationsResponse = GetVaultNotificationsResponse+ { _gvnrVaultNotificationConfig = Nothing+ }++-- | Returns the notification configuration set on the vault.+gvnrVaultNotificationConfig :: Lens' GetVaultNotificationsResponse (Maybe VaultNotificationConfig)+gvnrVaultNotificationConfig =+ lens _gvnrVaultNotificationConfig+ (\s a -> s { _gvnrVaultNotificationConfig = a })++instance ToPath GetVaultNotifications where+ toPath GetVaultNotifications{..} = mconcat+ [ "/"+ , toText _gvnAccountId+ , "/vaults/"+ , toText _gvnVaultName+ , "/notification-configuration"+ ]++instance ToQuery GetVaultNotifications where+ toQuery = const mempty++instance ToHeaders GetVaultNotifications++instance ToJSON GetVaultNotifications where+ toJSON = const (toJSON Empty)++instance AWSRequest GetVaultNotifications where+ type Sv GetVaultNotifications = Glacier+ type Rs GetVaultNotifications = GetVaultNotificationsResponse++ request = get+ response = jsonResponse++instance FromJSON GetVaultNotificationsResponse where+ parseJSON = withObject "GetVaultNotificationsResponse" $ \o -> GetVaultNotificationsResponse+ <$> o .:? "vaultNotificationConfig"
+ gen/Network/AWS/Glacier/InitiateJob.hs view
@@ -0,0 +1,249 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.InitiateJob+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation initiates a job of the specified type. In this release, you+-- can initiate a job to retrieve either an archive or a vault inventory (a list+-- of archives in a vault).+--+-- Retrieving data from Amazon Glacier is a two-step process:+--+-- Initiate a retrieval job.+--+-- After the job completes, download the bytes.+--+-- The retrieval request is executed asynchronously. When you initiate a+-- retrieval job, Amazon Glacier creates a job and returns a job ID in the+-- response. When Amazon Glacier completes the job, you can get the job output+-- (archive or inventory data). For information about getting job output, see 'GetJobOutput' operation.+--+-- The job must complete before you can get its output. To determine when a job+-- is complete, you have the following options:+--+-- Use Amazon SNS Notification You can specify an Amazon Simple Notification+-- Service (Amazon SNS) topic to which Amazon Glacier can post a notification+-- after the job is completed. You can specify an SNS topic per job request. The+-- notification is sent only after Amazon Glacier completes the job. In addition+-- to specifying an SNS topic per job request, you can configure vault+-- notifications for a vault so that job notifications are always sent. For more+-- information, see 'SetVaultNotifications'.+--+-- Get job details You can make a 'DescribeJob' request to obtain job status+-- information while a job is in progress. However, it is more efficient to use+-- an Amazon SNS notification to determine when a job is complete.+--+-- The information you get via notification is same that you get by calling 'DescribeJob'.+--+-- If for a specific event, you add both the notification configuration on the+-- vault and also specify an SNS topic in your initiate job request, Amazon+-- Glacier sends both notifications. For more information, see 'SetVaultNotifications'.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- About the Vault Inventory+--+-- Amazon Glacier prepares an inventory for each vault periodically, every 24+-- hours. When you initiate a job for a vault inventory, Amazon Glacier returns+-- the last inventory for the vault. The inventory data you get might be up to a+-- day or two days old. Also, the initiate inventory job might take some time to+-- complete before you can download the vault inventory. So you do not want to+-- retrieve a vault inventory for each vault operation. However, in some+-- scenarios, you might find the vault inventory useful. For example, when you+-- upload an archive, you can provide an archive description but not an archive+-- name. Amazon Glacier provides you a unique archive ID, an opaque string of+-- characters. So, you might maintain your own database that maps archive names+-- to their corresponding Amazon Glacier assigned archive IDs. You might find+-- the vault inventory useful in the event you need to reconcile information in+-- your database with the actual vault inventory.+--+-- Range Inventory Retrieval+--+-- You can limit the number of inventory items retrieved by filtering on the+-- archive creation date or by setting a limit.+--+-- /Filtering by Archive Creation Date/+--+-- You can retrieve inventory items for archives created between 'StartDate' and 'EndDate' by specifying values for these parameters in the InitiateJob request.+-- Archives created on or after the 'StartDate' and before the 'EndDate' will be+-- returned. If you only provide the 'StartDate' without the 'EndDate', you will+-- retrieve the inventory for all archives created on or after the 'StartDate'. If+-- you only provide the 'EndDate' without the 'StartDate', you will get back the+-- inventory for all archives created before the 'EndDate'.+--+-- /Limiting Inventory Items per Retrieval/+--+-- You can limit the number of inventory items returned by setting the 'Limit'+-- parameter in the InitiateJob request. The inventory job output will contain+-- inventory items up to the specified 'Limit'. If there are more inventory items+-- available, the result is paginated. After a job is complete you can use the 'DescribeJob' operation to get a marker that you use in a subsequent InitiateJob request.+-- The marker will indicate the starting point to retrieve the next set of+-- inventory items. You can page through your entire inventory by repeatedly+-- making InitiateJob requests with the marker from the previous DescribeJob+-- output, until you get a marker from DescribeJob that returns null, indicating+-- that there are no more inventory items available.+--+-- You can use the 'Limit' parameter together with the date range parameters.+--+-- About Ranged Archive Retrieval+--+-- You can initiate an archive retrieval for the whole archive or a range of+-- the archive. In the case of ranged archive retrieval, you specify a byte+-- range to return or the whole archive. The range specified must be megabyte+-- (MB) aligned, that is the range start value must be divisible by 1 MB and+-- range end value plus 1 must be divisible by 1 MB or equal the end of the+-- archive. If the ranged archive retrieval is not megabyte aligned, this+-- operation returns a 400 response. Furthermore, to ensure you get checksum+-- values for data you download using Get Job Output API, the range must be tree+-- hash aligned.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and the underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html Initiate a Job>+-- and <http://docs.aws.amazon.com/amazonglacier/latest/dev/vault-inventory.html Downloading a Vault Inventory>+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-InitiateJob.html>+module Network.AWS.Glacier.InitiateJob+ (+ -- * Request+ InitiateJob+ -- ** Request constructor+ , initiateJob+ -- ** Request lenses+ , ijAccountId+ , ijJobParameters+ , ijVaultName++ -- * Response+ , InitiateJobResponse+ -- ** Response constructor+ , initiateJobResponse+ -- ** Response lenses+ , ijrJobId+ , ijrLocation+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data InitiateJob = InitiateJob+ { _ijAccountId :: Text+ , _ijJobParameters :: Maybe JobParameters+ , _ijVaultName :: Text+ } deriving (Eq, Read, Show)++-- | 'InitiateJob' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ijAccountId' @::@ 'Text'+--+-- * 'ijJobParameters' @::@ 'Maybe' 'JobParameters'+--+-- * 'ijVaultName' @::@ 'Text'+--+initiateJob :: Text -- ^ 'ijAccountId'+ -> Text -- ^ 'ijVaultName'+ -> InitiateJob+initiateJob p1 p2 = InitiateJob+ { _ijAccountId = p1+ , _ijVaultName = p2+ , _ijJobParameters = Nothing+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+ijAccountId :: Lens' InitiateJob Text+ijAccountId = lens _ijAccountId (\s a -> s { _ijAccountId = a })++-- | Provides options for specifying job information.+ijJobParameters :: Lens' InitiateJob (Maybe JobParameters)+ijJobParameters = lens _ijJobParameters (\s a -> s { _ijJobParameters = a })++-- | The name of the vault.+ijVaultName :: Lens' InitiateJob Text+ijVaultName = lens _ijVaultName (\s a -> s { _ijVaultName = a })++data InitiateJobResponse = InitiateJobResponse+ { _ijrJobId :: Maybe Text+ , _ijrLocation :: Maybe Text+ } deriving (Eq, Ord, Read, Show)++-- | 'InitiateJobResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ijrJobId' @::@ 'Maybe' 'Text'+--+-- * 'ijrLocation' @::@ 'Maybe' 'Text'+--+initiateJobResponse :: InitiateJobResponse+initiateJobResponse = InitiateJobResponse+ { _ijrLocation = Nothing+ , _ijrJobId = Nothing+ }++-- | The ID of the job.+ijrJobId :: Lens' InitiateJobResponse (Maybe Text)+ijrJobId = lens _ijrJobId (\s a -> s { _ijrJobId = a })++-- | The relative URI path of the job.+ijrLocation :: Lens' InitiateJobResponse (Maybe Text)+ijrLocation = lens _ijrLocation (\s a -> s { _ijrLocation = a })++instance ToPath InitiateJob where+ toPath InitiateJob{..} = mconcat+ [ "/"+ , toText _ijAccountId+ , "/vaults/"+ , toText _ijVaultName+ , "/jobs"+ ]++instance ToQuery InitiateJob where+ toQuery = const mempty++instance ToHeaders InitiateJob++instance ToJSON InitiateJob where+ toJSON InitiateJob{..} = object+ [ "jobParameters" .= _ijJobParameters+ ]++instance AWSRequest InitiateJob where+ type Sv InitiateJob = Glacier+ type Rs InitiateJob = InitiateJobResponse++ request = post+ response = headerResponse $ \h -> InitiateJobResponse+ <$> h ~:? "x-amz-job-id"+ <*> h ~:? "Location"
+ gen/Network/AWS/Glacier/InitiateMultipartUpload.hs view
@@ -0,0 +1,195 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.InitiateMultipartUpload+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation initiates a multipart upload. Amazon Glacier creates a+-- multipart upload resource and returns its ID in the response. The multipart+-- upload ID is used in subsequent requests to upload parts of an archive (see 'UploadMultipartPart').+--+-- When you initiate a multipart upload, you specify the part size in number of+-- bytes. The part size must be a megabyte (1024 KB) multiplied by a power of+-- 2-for example, 1048576 (1 MB), 2097152 (2 MB), 4194304 (4 MB), 8388608 (8+-- MB), and so on. The minimum allowable part size is 1 MB, and the maximum is 4+-- GB.+--+-- Every part you upload to this resource (see 'UploadMultipartPart'), except the+-- last one, must have the same size. The last one can be the same size or+-- smaller. For example, suppose you want to upload a 16.2 MB file. If you+-- initiate the multipart upload with a part size of 4 MB, you will upload four+-- parts of 4 MB each and one part of 0.2 MB.+--+-- You don't need to know the size of the archive when you start a multipart+-- upload because Amazon Glacier does not require you to specify the overall+-- archive size.+--+-- After you complete the multipart upload, Amazon Glacier removes the+-- multipart upload resource referenced by the ID. Amazon Glacier also removes+-- the multipart upload resource if you cancel the multipart upload or it may be+-- removed if there is no activity for a period of 24 hours.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/uploading-archive-mpu.html Uploading LargeArchives in Parts (Multipart Upload)> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-multipart-initiate-upload.html Initiate Multipart Upload> in the /Amazon Glacier Developer Guide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-InitiateMultipartUpload.html>+module Network.AWS.Glacier.InitiateMultipartUpload+ (+ -- * Request+ InitiateMultipartUpload+ -- ** Request constructor+ , initiateMultipartUpload+ -- ** Request lenses+ , imuAccountId+ , imuArchiveDescription+ , imuPartSize+ , imuVaultName++ -- * Response+ , InitiateMultipartUploadResponse+ -- ** Response constructor+ , initiateMultipartUploadResponse+ -- ** Response lenses+ , imurLocation+ , imurUploadId+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data InitiateMultipartUpload = InitiateMultipartUpload+ { _imuAccountId :: Text+ , _imuArchiveDescription :: Maybe Text+ , _imuPartSize :: Maybe Text+ , _imuVaultName :: Text+ } deriving (Eq, Ord, Read, Show)++-- | 'InitiateMultipartUpload' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'imuAccountId' @::@ 'Text'+--+-- * 'imuArchiveDescription' @::@ 'Maybe' 'Text'+--+-- * 'imuPartSize' @::@ 'Maybe' 'Text'+--+-- * 'imuVaultName' @::@ 'Text'+--+initiateMultipartUpload :: Text -- ^ 'imuAccountId'+ -> Text -- ^ 'imuVaultName'+ -> InitiateMultipartUpload+initiateMultipartUpload p1 p2 = InitiateMultipartUpload+ { _imuAccountId = p1+ , _imuVaultName = p2+ , _imuArchiveDescription = Nothing+ , _imuPartSize = Nothing+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+imuAccountId :: Lens' InitiateMultipartUpload Text+imuAccountId = lens _imuAccountId (\s a -> s { _imuAccountId = a })++-- | The archive description that you are uploading in parts.+--+-- The part size must be a megabyte (1024 KB) multiplied by a power of 2—for+-- example, 1048576 (1 MB), 2097152 (2 MB), 4194304 (4 MB), 8388608 (8 MB), and+-- so on. The minimum allowable part size is 1 MB, and the maximum is 4 GB (4096+-- MB).+imuArchiveDescription :: Lens' InitiateMultipartUpload (Maybe Text)+imuArchiveDescription =+ lens _imuArchiveDescription (\s a -> s { _imuArchiveDescription = a })++-- | The size of each part except the last, in bytes. The last part can be smaller+-- than this part size.+imuPartSize :: Lens' InitiateMultipartUpload (Maybe Text)+imuPartSize = lens _imuPartSize (\s a -> s { _imuPartSize = a })++-- | The name of the vault.+imuVaultName :: Lens' InitiateMultipartUpload Text+imuVaultName = lens _imuVaultName (\s a -> s { _imuVaultName = a })++data InitiateMultipartUploadResponse = InitiateMultipartUploadResponse+ { _imurLocation :: Maybe Text+ , _imurUploadId :: Maybe Text+ } deriving (Eq, Ord, Read, Show)++-- | 'InitiateMultipartUploadResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'imurLocation' @::@ 'Maybe' 'Text'+--+-- * 'imurUploadId' @::@ 'Maybe' 'Text'+--+initiateMultipartUploadResponse :: InitiateMultipartUploadResponse+initiateMultipartUploadResponse = InitiateMultipartUploadResponse+ { _imurLocation = Nothing+ , _imurUploadId = Nothing+ }++-- | The relative URI path of the multipart upload ID Amazon Glacier created.+imurLocation :: Lens' InitiateMultipartUploadResponse (Maybe Text)+imurLocation = lens _imurLocation (\s a -> s { _imurLocation = a })++-- | The ID of the multipart upload. This value is also included as part of the+-- location.+imurUploadId :: Lens' InitiateMultipartUploadResponse (Maybe Text)+imurUploadId = lens _imurUploadId (\s a -> s { _imurUploadId = a })++instance ToPath InitiateMultipartUpload where+ toPath InitiateMultipartUpload{..} = mconcat+ [ "/"+ , toText _imuAccountId+ , "/vaults/"+ , toText _imuVaultName+ , "/multipart-uploads"+ ]++instance ToQuery InitiateMultipartUpload where+ toQuery = const mempty++instance ToHeaders InitiateMultipartUpload where+ toHeaders InitiateMultipartUpload{..} = mconcat+ [ "x-amz-archive-description" =: _imuArchiveDescription+ , "x-amz-part-size" =: _imuPartSize+ ]++instance ToJSON InitiateMultipartUpload where+ toJSON = const (toJSON Empty)++instance AWSRequest InitiateMultipartUpload where+ type Sv InitiateMultipartUpload = Glacier+ type Rs InitiateMultipartUpload = InitiateMultipartUploadResponse++ request = post+ response = headerResponse $ \h -> InitiateMultipartUploadResponse+ <$> h ~:? "Location"+ <*> h ~:? "x-amz-multipart-upload-id"
+ gen/Network/AWS/Glacier/ListJobs.hs view
@@ -0,0 +1,224 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.ListJobs+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation lists jobs for a vault, including jobs that are in-progress+-- and jobs that have recently finished.+--+-- Amazon Glacier retains recently completed jobs for a period before deleting+-- them; however, it eventually removes completed jobs. The output of completed+-- jobs can be retrieved. Retaining completed jobs for a period of time after+-- they have completed enables you to get a job output in the event you miss the+-- job completion notification or your first attempt to download it fails. For+-- example, suppose you start an archive retrieval job to download an archive.+-- After the job completes, you start to download the archive but encounter a+-- network error. In this scenario, you can retry and download the archive while+-- the job exists.+--+-- To retrieve an archive or retrieve a vault inventory from Amazon Glacier,+-- you first initiate a job, and after the job completes, you download the data.+-- For an archive retrieval, the output is the archive data, and for an+-- inventory retrieval, it is the inventory list. The List Job operation returns+-- a list of these jobs sorted by job initiation time.+--+-- This List Jobs operation supports pagination. By default, this operation+-- returns up to 1,000 jobs in the response. You should always check the+-- response for a 'marker' at which to continue the list; if there are no more+-- items the 'marker' is 'null'. To return a list of jobs that begins at a specific+-- job, set the 'marker' request parameter to the value you obtained from a+-- previous List Jobs request. You can also limit the number of jobs returned in+-- the response by specifying the 'limit' parameter in the request.+--+-- Additionally, you can filter the jobs list returned by specifying an+-- optional 'statuscode' (InProgress, Succeeded, or Failed) and 'completed' (true,+-- false) parameter. The 'statuscode' allows you to specify that only jobs that+-- match a specified status are returned. The 'completed' parameter allows you to+-- specify that only jobs in a specific completion state are returned.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For the underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-jobs-get.html List Jobs >+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-ListJobs.html>+module Network.AWS.Glacier.ListJobs+ (+ -- * Request+ ListJobs+ -- ** Request constructor+ , listJobs+ -- ** Request lenses+ , ljAccountId+ , ljCompleted+ , ljLimit+ , ljMarker+ , ljStatuscode+ , ljVaultName++ -- * Response+ , ListJobsResponse+ -- ** Response constructor+ , listJobsResponse+ -- ** Response lenses+ , ljrJobList+ , ljrMarker+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data ListJobs = ListJobs+ { _ljAccountId :: Text+ , _ljCompleted :: Maybe Text+ , _ljLimit :: Maybe Text+ , _ljMarker :: Maybe Text+ , _ljStatuscode :: Maybe Text+ , _ljVaultName :: Text+ } deriving (Eq, Ord, Read, Show)++-- | 'ListJobs' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ljAccountId' @::@ 'Text'+--+-- * 'ljCompleted' @::@ 'Maybe' 'Text'+--+-- * 'ljLimit' @::@ 'Maybe' 'Text'+--+-- * 'ljMarker' @::@ 'Maybe' 'Text'+--+-- * 'ljStatuscode' @::@ 'Maybe' 'Text'+--+-- * 'ljVaultName' @::@ 'Text'+--+listJobs :: Text -- ^ 'ljAccountId'+ -> Text -- ^ 'ljVaultName'+ -> ListJobs+listJobs p1 p2 = ListJobs+ { _ljAccountId = p1+ , _ljVaultName = p2+ , _ljLimit = Nothing+ , _ljMarker = Nothing+ , _ljStatuscode = Nothing+ , _ljCompleted = Nothing+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+ljAccountId :: Lens' ListJobs Text+ljAccountId = lens _ljAccountId (\s a -> s { _ljAccountId = a })++-- | Specifies the state of the jobs to return. You can specify 'true' or 'false'.+ljCompleted :: Lens' ListJobs (Maybe Text)+ljCompleted = lens _ljCompleted (\s a -> s { _ljCompleted = a })++-- | Specifies that the response be limited to the specified number of items or+-- fewer. If not specified, the List Jobs operation returns up to 1,000 jobs.+ljLimit :: Lens' ListJobs (Maybe Text)+ljLimit = lens _ljLimit (\s a -> s { _ljLimit = a })++-- | An opaque string used for pagination. This value specifies the job at which+-- the listing of jobs should begin. Get the marker value from a previous List+-- Jobs response. You need only include the marker if you are continuing the+-- pagination of results started in a previous List Jobs request.+ljMarker :: Lens' ListJobs (Maybe Text)+ljMarker = lens _ljMarker (\s a -> s { _ljMarker = a })++-- | Specifies the type of job status to return. You can specify the following+-- values: "InProgress", "Succeeded", or "Failed".+ljStatuscode :: Lens' ListJobs (Maybe Text)+ljStatuscode = lens _ljStatuscode (\s a -> s { _ljStatuscode = a })++-- | The name of the vault.+ljVaultName :: Lens' ListJobs Text+ljVaultName = lens _ljVaultName (\s a -> s { _ljVaultName = a })++data ListJobsResponse = ListJobsResponse+ { _ljrJobList :: List "JobList" GlacierJobDescription+ , _ljrMarker :: Maybe Text+ } deriving (Eq, Read, Show)++-- | 'ListJobsResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ljrJobList' @::@ ['GlacierJobDescription']+--+-- * 'ljrMarker' @::@ 'Maybe' 'Text'+--+listJobsResponse :: ListJobsResponse+listJobsResponse = ListJobsResponse+ { _ljrJobList = mempty+ , _ljrMarker = Nothing+ }++-- | A list of job objects. Each job object contains metadata describing the job.+ljrJobList :: Lens' ListJobsResponse [GlacierJobDescription]+ljrJobList = lens _ljrJobList (\s a -> s { _ljrJobList = a }) . _List++-- | An opaque string that represents where to continue pagination of the results.+-- You use this value in a new List Jobs request to obtain more jobs in the+-- list. If there are no more jobs, this value is 'null'.+ljrMarker :: Lens' ListJobsResponse (Maybe Text)+ljrMarker = lens _ljrMarker (\s a -> s { _ljrMarker = a })++instance ToPath ListJobs where+ toPath ListJobs{..} = mconcat+ [ "/"+ , toText _ljAccountId+ , "/vaults/"+ , toText _ljVaultName+ , "/jobs"+ ]++instance ToQuery ListJobs where+ toQuery ListJobs{..} = mconcat+ [ "limit" =? _ljLimit+ , "marker" =? _ljMarker+ , "statuscode" =? _ljStatuscode+ , "completed" =? _ljCompleted+ ]++instance ToHeaders ListJobs++instance ToJSON ListJobs where+ toJSON = const (toJSON Empty)++instance AWSRequest ListJobs where+ type Sv ListJobs = Glacier+ type Rs ListJobs = ListJobsResponse++ request = get+ response = jsonResponse++instance FromJSON ListJobsResponse where+ parseJSON = withObject "ListJobsResponse" $ \o -> ListJobsResponse+ <$> o .:? "JobList" .!= mempty+ <*> o .:? "Marker"
+ gen/Network/AWS/Glacier/ListMultipartUploads.hs view
@@ -0,0 +1,191 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.ListMultipartUploads+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation lists in-progress multipart uploads for the specified vault.+-- An in-progress multipart upload is a multipart upload that has been initiated+-- by an 'InitiateMultipartUpload' request, but has not yet been completed or+-- aborted. The list returned in the List Multipart Upload response has no+-- guaranteed order.+--+-- The List Multipart Uploads operation supports pagination. By default, this+-- operation returns up to 1,000 multipart uploads in the response. You should+-- always check the response for a 'marker' at which to continue the list; if+-- there are no more items the 'marker' is 'null'. To return a list of multipart+-- uploads that begins at a specific upload, set the 'marker' request parameter to+-- the value you obtained from a previous List Multipart Upload request. You can+-- also limit the number of uploads returned in the response by specifying the 'limit' parameter in the request.+--+-- Note the difference between this operation and listing parts ('ListParts').+-- The List Multipart Uploads operation lists all multipart uploads for a vault+-- and does not require a multipart upload ID. The List Parts operation requires+-- a multipart upload ID since parts are associated with a single upload.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and the underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/working-with-archives.html Working withArchives in Amazon Glacier> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-multipart-list-uploads.html List Multipart Uploads > in the /Amazon GlacierDeveloper Guide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-ListMultipartUploads.html>+module Network.AWS.Glacier.ListMultipartUploads+ (+ -- * Request+ ListMultipartUploads+ -- ** Request constructor+ , listMultipartUploads+ -- ** Request lenses+ , lmuAccountId+ , lmuLimit+ , lmuMarker+ , lmuVaultName++ -- * Response+ , ListMultipartUploadsResponse+ -- ** Response constructor+ , listMultipartUploadsResponse+ -- ** Response lenses+ , lmurMarker+ , lmurUploadsList+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data ListMultipartUploads = ListMultipartUploads+ { _lmuAccountId :: Text+ , _lmuLimit :: Maybe Text+ , _lmuMarker :: Maybe Text+ , _lmuVaultName :: Text+ } deriving (Eq, Ord, Read, Show)++-- | 'ListMultipartUploads' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lmuAccountId' @::@ 'Text'+--+-- * 'lmuLimit' @::@ 'Maybe' 'Text'+--+-- * 'lmuMarker' @::@ 'Maybe' 'Text'+--+-- * 'lmuVaultName' @::@ 'Text'+--+listMultipartUploads :: Text -- ^ 'lmuAccountId'+ -> Text -- ^ 'lmuVaultName'+ -> ListMultipartUploads+listMultipartUploads p1 p2 = ListMultipartUploads+ { _lmuAccountId = p1+ , _lmuVaultName = p2+ , _lmuMarker = Nothing+ , _lmuLimit = Nothing+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+lmuAccountId :: Lens' ListMultipartUploads Text+lmuAccountId = lens _lmuAccountId (\s a -> s { _lmuAccountId = a })++-- | Specifies the maximum number of uploads returned in the response body. If+-- this value is not specified, the List Uploads operation returns up to 1,000+-- uploads.+lmuLimit :: Lens' ListMultipartUploads (Maybe Text)+lmuLimit = lens _lmuLimit (\s a -> s { _lmuLimit = a })++-- | An opaque string used for pagination. This value specifies the upload at+-- which the listing of uploads should begin. Get the marker value from a+-- previous List Uploads response. You need only include the marker if you are+-- continuing the pagination of results started in a previous List Uploads+-- request.+lmuMarker :: Lens' ListMultipartUploads (Maybe Text)+lmuMarker = lens _lmuMarker (\s a -> s { _lmuMarker = a })++-- | The name of the vault.+lmuVaultName :: Lens' ListMultipartUploads Text+lmuVaultName = lens _lmuVaultName (\s a -> s { _lmuVaultName = a })++data ListMultipartUploadsResponse = ListMultipartUploadsResponse+ { _lmurMarker :: Maybe Text+ , _lmurUploadsList :: List "UploadsList" UploadListElement+ } deriving (Eq, Read, Show)++-- | 'ListMultipartUploadsResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lmurMarker' @::@ 'Maybe' 'Text'+--+-- * 'lmurUploadsList' @::@ ['UploadListElement']+--+listMultipartUploadsResponse :: ListMultipartUploadsResponse+listMultipartUploadsResponse = ListMultipartUploadsResponse+ { _lmurUploadsList = mempty+ , _lmurMarker = Nothing+ }++-- | An opaque string that represents where to continue pagination of the results.+-- You use the marker in a new List Multipart Uploads request to obtain more+-- uploads in the list. If there are no more uploads, this value is 'null'.+lmurMarker :: Lens' ListMultipartUploadsResponse (Maybe Text)+lmurMarker = lens _lmurMarker (\s a -> s { _lmurMarker = a })++-- | A list of in-progress multipart uploads.+lmurUploadsList :: Lens' ListMultipartUploadsResponse [UploadListElement]+lmurUploadsList = lens _lmurUploadsList (\s a -> s { _lmurUploadsList = a }) . _List++instance ToPath ListMultipartUploads where+ toPath ListMultipartUploads{..} = mconcat+ [ "/"+ , toText _lmuAccountId+ , "/vaults/"+ , toText _lmuVaultName+ , "/multipart-uploads"+ ]++instance ToQuery ListMultipartUploads where+ toQuery ListMultipartUploads{..} = mconcat+ [ "marker" =? _lmuMarker+ , "limit" =? _lmuLimit+ ]++instance ToHeaders ListMultipartUploads++instance ToJSON ListMultipartUploads where+ toJSON = const (toJSON Empty)++instance AWSRequest ListMultipartUploads where+ type Sv ListMultipartUploads = Glacier+ type Rs ListMultipartUploads = ListMultipartUploadsResponse++ request = get+ response = jsonResponse++instance FromJSON ListMultipartUploadsResponse where+ parseJSON = withObject "ListMultipartUploadsResponse" $ \o -> ListMultipartUploadsResponse+ <$> o .:? "Marker"+ <*> o .:? "UploadsList" .!= mempty
+ gen/Network/AWS/Glacier/ListParts.hs view
@@ -0,0 +1,249 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.ListParts+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation lists the parts of an archive that have been uploaded in a+-- specific multipart upload. You can make this request at any time during an+-- in-progress multipart upload before you complete the upload (see 'CompleteMultipartUpload'. List Parts returns an error for completed uploads. The list returned in the+-- List Parts response is sorted by part range.+--+-- The List Parts operation supports pagination. By default, this operation+-- returns up to 1,000 uploaded parts in the response. You should always check+-- the response for a 'marker' at which to continue the list; if there are no more+-- items the 'marker' is 'null'. To return a list of parts that begins at a specific+-- part, set the 'marker' request parameter to the value you obtained from a+-- previous List Parts request. You can also limit the number of parts returned+-- in the response by specifying the 'limit' parameter in the request.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and the underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/working-with-archives.html Working withArchives in Amazon Glacier> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-multipart-list-parts.html List Parts> in the /Amazon Glacier DeveloperGuide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-ListParts.html>+module Network.AWS.Glacier.ListParts+ (+ -- * Request+ ListParts+ -- ** Request constructor+ , listParts+ -- ** Request lenses+ , lpAccountId+ , lpLimit+ , lpMarker+ , lpUploadId+ , lpVaultName++ -- * Response+ , ListPartsResponse+ -- ** Response constructor+ , listPartsResponse+ -- ** Response lenses+ , lprArchiveDescription+ , lprCreationDate+ , lprMarker+ , lprMultipartUploadId+ , lprPartSizeInBytes+ , lprParts+ , lprVaultARN+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data ListParts = ListParts+ { _lpAccountId :: Text+ , _lpLimit :: Maybe Text+ , _lpMarker :: Maybe Text+ , _lpUploadId :: Text+ , _lpVaultName :: Text+ } deriving (Eq, Ord, Read, Show)++-- | 'ListParts' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lpAccountId' @::@ 'Text'+--+-- * 'lpLimit' @::@ 'Maybe' 'Text'+--+-- * 'lpMarker' @::@ 'Maybe' 'Text'+--+-- * 'lpUploadId' @::@ 'Text'+--+-- * 'lpVaultName' @::@ 'Text'+--+listParts :: Text -- ^ 'lpAccountId'+ -> Text -- ^ 'lpVaultName'+ -> Text -- ^ 'lpUploadId'+ -> ListParts+listParts p1 p2 p3 = ListParts+ { _lpAccountId = p1+ , _lpVaultName = p2+ , _lpUploadId = p3+ , _lpMarker = Nothing+ , _lpLimit = Nothing+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+lpAccountId :: Lens' ListParts Text+lpAccountId = lens _lpAccountId (\s a -> s { _lpAccountId = a })++-- | Specifies the maximum number of parts returned in the response body. If this+-- value is not specified, the List Parts operation returns up to 1,000 uploads.+lpLimit :: Lens' ListParts (Maybe Text)+lpLimit = lens _lpLimit (\s a -> s { _lpLimit = a })++-- | An opaque string used for pagination. This value specifies the part at which+-- the listing of parts should begin. Get the marker value from the response of+-- a previous List Parts response. You need only include the marker if you are+-- continuing the pagination of results started in a previous List Parts request.+lpMarker :: Lens' ListParts (Maybe Text)+lpMarker = lens _lpMarker (\s a -> s { _lpMarker = a })++-- | The upload ID of the multipart upload.+lpUploadId :: Lens' ListParts Text+lpUploadId = lens _lpUploadId (\s a -> s { _lpUploadId = a })++-- | The name of the vault.+lpVaultName :: Lens' ListParts Text+lpVaultName = lens _lpVaultName (\s a -> s { _lpVaultName = a })++data ListPartsResponse = ListPartsResponse+ { _lprArchiveDescription :: Maybe Text+ , _lprCreationDate :: Maybe Text+ , _lprMarker :: Maybe Text+ , _lprMultipartUploadId :: Maybe Text+ , _lprPartSizeInBytes :: Maybe Integer+ , _lprParts :: List "Parts" PartListElement+ , _lprVaultARN :: Maybe Text+ } deriving (Eq, Read, Show)++-- | 'ListPartsResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lprArchiveDescription' @::@ 'Maybe' 'Text'+--+-- * 'lprCreationDate' @::@ 'Maybe' 'Text'+--+-- * 'lprMarker' @::@ 'Maybe' 'Text'+--+-- * 'lprMultipartUploadId' @::@ 'Maybe' 'Text'+--+-- * 'lprPartSizeInBytes' @::@ 'Maybe' 'Integer'+--+-- * 'lprParts' @::@ ['PartListElement']+--+-- * 'lprVaultARN' @::@ 'Maybe' 'Text'+--+listPartsResponse :: ListPartsResponse+listPartsResponse = ListPartsResponse+ { _lprMultipartUploadId = Nothing+ , _lprVaultARN = Nothing+ , _lprArchiveDescription = Nothing+ , _lprPartSizeInBytes = Nothing+ , _lprCreationDate = Nothing+ , _lprParts = mempty+ , _lprMarker = Nothing+ }++-- | The description of the archive that was specified in the Initiate Multipart+-- Upload request.+lprArchiveDescription :: Lens' ListPartsResponse (Maybe Text)+lprArchiveDescription =+ lens _lprArchiveDescription (\s a -> s { _lprArchiveDescription = a })++-- | The UTC time at which the multipart upload was initiated.+lprCreationDate :: Lens' ListPartsResponse (Maybe Text)+lprCreationDate = lens _lprCreationDate (\s a -> s { _lprCreationDate = a })++-- | An opaque string that represents where to continue pagination of the results.+-- You use the marker in a new List Parts request to obtain more jobs in the+-- list. If there are no more parts, this value is 'null'.+lprMarker :: Lens' ListPartsResponse (Maybe Text)+lprMarker = lens _lprMarker (\s a -> s { _lprMarker = a })++-- | The ID of the upload to which the parts are associated.+lprMultipartUploadId :: Lens' ListPartsResponse (Maybe Text)+lprMultipartUploadId =+ lens _lprMultipartUploadId (\s a -> s { _lprMultipartUploadId = a })++-- | The part size in bytes.+lprPartSizeInBytes :: Lens' ListPartsResponse (Maybe Integer)+lprPartSizeInBytes =+ lens _lprPartSizeInBytes (\s a -> s { _lprPartSizeInBytes = a })++-- | A list of the part sizes of the multipart upload.+lprParts :: Lens' ListPartsResponse [PartListElement]+lprParts = lens _lprParts (\s a -> s { _lprParts = a }) . _List++-- | The Amazon Resource Name (ARN) of the vault to which the multipart upload was+-- initiated.+lprVaultARN :: Lens' ListPartsResponse (Maybe Text)+lprVaultARN = lens _lprVaultARN (\s a -> s { _lprVaultARN = a })++instance ToPath ListParts where+ toPath ListParts{..} = mconcat+ [ "/"+ , toText _lpAccountId+ , "/vaults/"+ , toText _lpVaultName+ , "/multipart-uploads/"+ , toText _lpUploadId+ ]++instance ToQuery ListParts where+ toQuery ListParts{..} = mconcat+ [ "marker" =? _lpMarker+ , "limit" =? _lpLimit+ ]++instance ToHeaders ListParts++instance ToJSON ListParts where+ toJSON = const (toJSON Empty)++instance AWSRequest ListParts where+ type Sv ListParts = Glacier+ type Rs ListParts = ListPartsResponse++ request = get+ response = jsonResponse++instance FromJSON ListPartsResponse where+ parseJSON = withObject "ListPartsResponse" $ \o -> ListPartsResponse+ <$> o .:? "ArchiveDescription"+ <*> o .:? "CreationDate"+ <*> o .:? "Marker"+ <*> o .:? "MultipartUploadId"+ <*> o .:? "PartSizeInBytes"+ <*> o .:? "Parts" .!= mempty+ <*> o .:? "VaultARN"
+ gen/Network/AWS/Glacier/ListVaults.hs view
@@ -0,0 +1,167 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.ListVaults+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation lists all vaults owned by the calling user's account. The list+-- returned in the response is ASCII-sorted by vault name.+--+-- By default, this operation returns up to 1,000 items. If there are more+-- vaults to list, the response 'marker' field contains the vault Amazon Resource+-- Name (ARN) at which to continue the list with a new List Vaults request;+-- otherwise, the 'marker' field is 'null'. To return a list of vaults that begins+-- at a specific vault, set the 'marker' request parameter to the vault ARN you+-- obtained from a previous List Vaults request. You can also limit the number+-- of vaults returned in the response by specifying the 'limit' parameter in the+-- request.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/retrieving-vault-info.html Retrieving VaultMetadata in Amazon Glacier> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vaults-get.html List Vaults > in the /Amazon Glacier DeveloperGuide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-ListVaults.html>+module Network.AWS.Glacier.ListVaults+ (+ -- * Request+ ListVaults+ -- ** Request constructor+ , listVaults+ -- ** Request lenses+ , lvAccountId+ , lvLimit+ , lvMarker++ -- * Response+ , ListVaultsResponse+ -- ** Response constructor+ , listVaultsResponse+ -- ** Response lenses+ , lvrMarker+ , lvrVaultList+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data ListVaults = ListVaults+ { _lvAccountId :: Text+ , _lvLimit :: Maybe Text+ , _lvMarker :: Maybe Text+ } deriving (Eq, Ord, Read, Show)++-- | 'ListVaults' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lvAccountId' @::@ 'Text'+--+-- * 'lvLimit' @::@ 'Maybe' 'Text'+--+-- * 'lvMarker' @::@ 'Maybe' 'Text'+--+listVaults :: Text -- ^ 'lvAccountId'+ -> ListVaults+listVaults p1 = ListVaults+ { _lvAccountId = p1+ , _lvMarker = Nothing+ , _lvLimit = Nothing+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+lvAccountId :: Lens' ListVaults Text+lvAccountId = lens _lvAccountId (\s a -> s { _lvAccountId = a })++-- | The maximum number of items returned in the response. If you don't specify a+-- value, the List Vaults operation returns up to 1,000 items.+lvLimit :: Lens' ListVaults (Maybe Text)+lvLimit = lens _lvLimit (\s a -> s { _lvLimit = a })++-- | A string used for pagination. The marker specifies the vault ARN after which+-- the listing of vaults should begin.+lvMarker :: Lens' ListVaults (Maybe Text)+lvMarker = lens _lvMarker (\s a -> s { _lvMarker = a })++data ListVaultsResponse = ListVaultsResponse+ { _lvrMarker :: Maybe Text+ , _lvrVaultList :: List "VaultList" DescribeVaultOutput+ } deriving (Eq, Read, Show)++-- | 'ListVaultsResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lvrMarker' @::@ 'Maybe' 'Text'+--+-- * 'lvrVaultList' @::@ ['DescribeVaultOutput']+--+listVaultsResponse :: ListVaultsResponse+listVaultsResponse = ListVaultsResponse+ { _lvrVaultList = mempty+ , _lvrMarker = Nothing+ }++-- | The vault ARN at which to continue pagination of the results. You use the+-- marker in another List Vaults request to obtain more vaults in the list.+lvrMarker :: Lens' ListVaultsResponse (Maybe Text)+lvrMarker = lens _lvrMarker (\s a -> s { _lvrMarker = a })++-- | List of vaults.+lvrVaultList :: Lens' ListVaultsResponse [DescribeVaultOutput]+lvrVaultList = lens _lvrVaultList (\s a -> s { _lvrVaultList = a }) . _List++instance ToPath ListVaults where+ toPath ListVaults{..} = mconcat+ [ "/"+ , toText _lvAccountId+ , "/vaults"+ ]++instance ToQuery ListVaults where+ toQuery ListVaults{..} = mconcat+ [ "marker" =? _lvMarker+ , "limit" =? _lvLimit+ ]++instance ToHeaders ListVaults++instance ToJSON ListVaults where+ toJSON = const (toJSON Empty)++instance AWSRequest ListVaults where+ type Sv ListVaults = Glacier+ type Rs ListVaults = ListVaultsResponse++ request = get+ response = jsonResponse++instance FromJSON ListVaultsResponse where+ parseJSON = withObject "ListVaultsResponse" $ \o -> ListVaultsResponse+ <$> o .:? "Marker"+ <*> o .:? "VaultList" .!= mempty
+ gen/Network/AWS/Glacier/SetDataRetrievalPolicy.hs view
@@ -0,0 +1,102 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.SetDataRetrievalPolicy+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-SetDataRetrievalPolicy.html>+module Network.AWS.Glacier.SetDataRetrievalPolicy+ (+ -- * Request+ SetDataRetrievalPolicy+ -- ** Request constructor+ , setDataRetrievalPolicy+ -- ** Request lenses+ , sdrpAccountId+ , sdrpPolicy++ -- * Response+ , SetDataRetrievalPolicyResponse+ -- ** Response constructor+ , setDataRetrievalPolicyResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data SetDataRetrievalPolicy = SetDataRetrievalPolicy+ { _sdrpAccountId :: Text+ , _sdrpPolicy :: Maybe DataRetrievalPolicy+ } deriving (Eq, Read, Show)++-- | 'SetDataRetrievalPolicy' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'sdrpAccountId' @::@ 'Text'+--+-- * 'sdrpPolicy' @::@ 'Maybe' 'DataRetrievalPolicy'+--+setDataRetrievalPolicy :: Text -- ^ 'sdrpAccountId'+ -> SetDataRetrievalPolicy+setDataRetrievalPolicy p1 = SetDataRetrievalPolicy+ { _sdrpAccountId = p1+ , _sdrpPolicy = Nothing+ }++sdrpAccountId :: Lens' SetDataRetrievalPolicy Text+sdrpAccountId = lens _sdrpAccountId (\s a -> s { _sdrpAccountId = a })++sdrpPolicy :: Lens' SetDataRetrievalPolicy (Maybe DataRetrievalPolicy)+sdrpPolicy = lens _sdrpPolicy (\s a -> s { _sdrpPolicy = a })++data SetDataRetrievalPolicyResponse = SetDataRetrievalPolicyResponse+ deriving (Eq, Ord, Read, Show, Generic)++-- | 'SetDataRetrievalPolicyResponse' constructor.+setDataRetrievalPolicyResponse :: SetDataRetrievalPolicyResponse+setDataRetrievalPolicyResponse = SetDataRetrievalPolicyResponse++instance ToPath SetDataRetrievalPolicy where+ toPath SetDataRetrievalPolicy{..} = mconcat+ [ "/"+ , toText _sdrpAccountId+ , "/policies/data-retrieval"+ ]++instance ToQuery SetDataRetrievalPolicy where+ toQuery = const mempty++instance ToHeaders SetDataRetrievalPolicy++instance ToJSON SetDataRetrievalPolicy where+ toJSON SetDataRetrievalPolicy{..} = object+ [ "Policy" .= _sdrpPolicy+ ]++instance AWSRequest SetDataRetrievalPolicy where+ type Sv SetDataRetrievalPolicy = Glacier+ type Rs SetDataRetrievalPolicy = SetDataRetrievalPolicyResponse++ request = put+ response = nullResponse SetDataRetrievalPolicyResponse
+ gen/Network/AWS/Glacier/SetVaultNotifications.hs view
@@ -0,0 +1,147 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.SetVaultNotifications+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation configures notifications that will be sent when specific+-- events happen to a vault. By default, you don't get any notifications.+--+-- To configure vault notifications, send a PUT request to the 'notification-configuration' subresource of the vault. The request should include a JSON document that+-- provides an Amazon SNS topic and specific events for which you want Amazon+-- Glacier to send notifications to the topic.+--+-- Amazon SNS topics must grant permission to the vault to be allowed to+-- publish notifications to the topic. You can configure a vault to publish a+-- notification for the following vault events:+--+-- ArchiveRetrievalCompleted This event occurs when a job that was initiated+-- for an archive retrieval is completed ('InitiateJob'). The status of the+-- completed job can be "Succeeded" or "Failed". The notification sent to the+-- SNS topic is the same output as returned from 'DescribeJob'. InventoryRetrievalCompleted+-- This event occurs when a job that was initiated for an inventory retrieval+-- is completed ('InitiateJob'). The status of the completed job can be+-- "Succeeded" or "Failed". The notification sent to the SNS topic is the same+-- output as returned from 'DescribeJob'. An AWS account has full permission to+-- perform all operations (actions). However, AWS Identity and Access Management+-- (IAM) users don't have any permissions by default. You must grant them+-- explicit permission to perform specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identity and Access Management (IAM)>.+--+-- For conceptual information and underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/configuring-notifications.html Configuring VaultNotifications in Amazon Glacier> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-notifications-put.html Set Vault Notification Configuration > in+-- the /Amazon Glacier Developer Guide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-SetVaultNotifications.html>+module Network.AWS.Glacier.SetVaultNotifications+ (+ -- * Request+ SetVaultNotifications+ -- ** Request constructor+ , setVaultNotifications+ -- ** Request lenses+ , svnAccountId+ , svnVaultName+ , svnVaultNotificationConfig++ -- * Response+ , SetVaultNotificationsResponse+ -- ** Response constructor+ , setVaultNotificationsResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data SetVaultNotifications = SetVaultNotifications+ { _svnAccountId :: Text+ , _svnVaultName :: Text+ , _svnVaultNotificationConfig :: Maybe VaultNotificationConfig+ } deriving (Eq, Read, Show)++-- | 'SetVaultNotifications' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'svnAccountId' @::@ 'Text'+--+-- * 'svnVaultName' @::@ 'Text'+--+-- * 'svnVaultNotificationConfig' @::@ 'Maybe' 'VaultNotificationConfig'+--+setVaultNotifications :: Text -- ^ 'svnAccountId'+ -> Text -- ^ 'svnVaultName'+ -> SetVaultNotifications+setVaultNotifications p1 p2 = SetVaultNotifications+ { _svnAccountId = p1+ , _svnVaultName = p2+ , _svnVaultNotificationConfig = Nothing+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+svnAccountId :: Lens' SetVaultNotifications Text+svnAccountId = lens _svnAccountId (\s a -> s { _svnAccountId = a })++-- | The name of the vault.+svnVaultName :: Lens' SetVaultNotifications Text+svnVaultName = lens _svnVaultName (\s a -> s { _svnVaultName = a })++-- | Provides options for specifying notification configuration.+svnVaultNotificationConfig :: Lens' SetVaultNotifications (Maybe VaultNotificationConfig)+svnVaultNotificationConfig =+ lens _svnVaultNotificationConfig+ (\s a -> s { _svnVaultNotificationConfig = a })++data SetVaultNotificationsResponse = SetVaultNotificationsResponse+ deriving (Eq, Ord, Read, Show, Generic)++-- | 'SetVaultNotificationsResponse' constructor.+setVaultNotificationsResponse :: SetVaultNotificationsResponse+setVaultNotificationsResponse = SetVaultNotificationsResponse++instance ToPath SetVaultNotifications where+ toPath SetVaultNotifications{..} = mconcat+ [ "/"+ , toText _svnAccountId+ , "/vaults/"+ , toText _svnVaultName+ , "/notification-configuration"+ ]++instance ToQuery SetVaultNotifications where+ toQuery = const mempty++instance ToHeaders SetVaultNotifications++instance ToJSON SetVaultNotifications where+ toJSON SetVaultNotifications{..} = object+ [ "vaultNotificationConfig" .= _svnVaultNotificationConfig+ ]++instance AWSRequest SetVaultNotifications where+ type Sv SetVaultNotifications = Glacier+ type Rs SetVaultNotifications = SetVaultNotificationsResponse++ request = put+ response = nullResponse SetVaultNotificationsResponse
+ gen/Network/AWS/Glacier/Types.hs view
@@ -0,0 +1,1082 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE ViewPatterns #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.Types+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++module Network.AWS.Glacier.Types+ (+ -- * Service+ Glacier+ -- ** Error+ , JSONError++ -- * ArchiveCreationOutput+ , ArchiveCreationOutput+ , archiveCreationOutput+ , acoArchiveId+ , acoChecksum+ , acoLocation++ -- * UploadListElement+ , UploadListElement+ , uploadListElement+ , uleArchiveDescription+ , uleCreationDate+ , uleMultipartUploadId+ , ulePartSizeInBytes+ , uleVaultARN++ -- * InventoryRetrievalJobDescription+ , InventoryRetrievalJobDescription+ , inventoryRetrievalJobDescription+ , irjdEndDate+ , irjdFormat+ , irjdLimit+ , irjdMarker+ , irjdStartDate++ -- * JobParameters+ , JobParameters+ , jobParameters+ , jpArchiveId+ , jpDescription+ , jpFormat+ , jpInventoryRetrievalParameters+ , jpRetrievalByteRange+ , jpSNSTopic+ , jpType++ -- * DescribeVaultOutput+ , DescribeVaultOutput+ , describeVaultOutput+ , dvoCreationDate+ , dvoLastInventoryDate+ , dvoNumberOfArchives+ , dvoSizeInBytes+ , dvoVaultARN+ , dvoVaultName++ -- * DataRetrievalRule+ , DataRetrievalRule+ , dataRetrievalRule+ , drrBytesPerHour+ , drrStrategy++ -- * ActionCode+ , ActionCode (..)++ -- * VaultNotificationConfig+ , VaultNotificationConfig+ , vaultNotificationConfig+ , vncEvents+ , vncSNSTopic++ -- * InventoryRetrievalJobInput+ , InventoryRetrievalJobInput+ , inventoryRetrievalJobInput+ , irjiEndDate+ , irjiLimit+ , irjiMarker+ , irjiStartDate++ -- * PartListElement+ , PartListElement+ , partListElement+ , pleRangeInBytes+ , pleSHA256TreeHash++ -- * DataRetrievalPolicy+ , DataRetrievalPolicy+ , dataRetrievalPolicy+ , drpRules++ -- * GlacierJobDescription+ , GlacierJobDescription+ , glacierJobDescription+ , gjdAction+ , gjdArchiveId+ , gjdArchiveSHA256TreeHash+ , gjdArchiveSizeInBytes+ , gjdCompleted+ , gjdCompletionDate+ , gjdCreationDate+ , gjdInventoryRetrievalParameters+ , gjdInventorySizeInBytes+ , gjdJobDescription+ , gjdJobId+ , gjdRetrievalByteRange+ , gjdSHA256TreeHash+ , gjdSNSTopic+ , gjdStatusCode+ , gjdStatusMessage+ , gjdVaultARN++ -- * StatusCode+ , StatusCode (..)+ ) where++import Network.AWS.Prelude+import Network.AWS.Signing+import qualified GHC.Exts++-- | Version @2012-06-01@ of the Amazon Glacier service.+data Glacier++instance AWSService Glacier where+ type Sg Glacier = V4+ type Er Glacier = JSONError++ service = service'+ where+ service' :: Service Glacier+ service' = Service+ { _svcAbbrev = "Glacier"+ , _svcPrefix = "glacier"+ , _svcVersion = "2012-06-01"+ , _svcTargetPrefix = Nothing+ , _svcJSONVersion = Nothing+ , _svcHandle = handle+ , _svcRetry = retry+ }++ handle :: Status+ -> Maybe (LazyByteString -> ServiceError JSONError)+ handle = jsonError statusSuccess service'++ retry :: Retry Glacier+ retry = Exponential+ { _retryBase = 0.05+ , _retryGrowth = 2+ , _retryAttempts = 5+ , _retryCheck = check+ }++ check :: Status+ -> JSONError+ -> Bool+ check (statusCode -> s) (awsErrorCode -> e)+ | s == 400 && "ThrottlingException" == e = True -- Throttling+ | s == 500 = True -- General Server Error+ | s == 509 = True -- Limit Exceeded+ | s == 503 = True -- Service Unavailable+ | otherwise = False++data ArchiveCreationOutput = ArchiveCreationOutput+ { _acoArchiveId :: Maybe Text+ , _acoChecksum :: Maybe Text+ , _acoLocation :: Maybe Text+ } deriving (Eq, Ord, Read, Show)++-- | 'ArchiveCreationOutput' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'acoArchiveId' @::@ 'Maybe' 'Text'+--+-- * 'acoChecksum' @::@ 'Maybe' 'Text'+--+-- * 'acoLocation' @::@ 'Maybe' 'Text'+--+archiveCreationOutput :: ArchiveCreationOutput+archiveCreationOutput = ArchiveCreationOutput+ { _acoLocation = Nothing+ , _acoChecksum = Nothing+ , _acoArchiveId = Nothing+ }++-- | The ID of the archive. This value is also included as part of the location.+acoArchiveId :: Lens' ArchiveCreationOutput (Maybe Text)+acoArchiveId = lens _acoArchiveId (\s a -> s { _acoArchiveId = a })++-- | The checksum of the archive computed by Amazon Glacier.+acoChecksum :: Lens' ArchiveCreationOutput (Maybe Text)+acoChecksum = lens _acoChecksum (\s a -> s { _acoChecksum = a })++-- | The relative URI path of the newly added archive resource.+acoLocation :: Lens' ArchiveCreationOutput (Maybe Text)+acoLocation = lens _acoLocation (\s a -> s { _acoLocation = a })++instance FromJSON ArchiveCreationOutput where+ parseJSON = withObject "ArchiveCreationOutput" $ \o -> ArchiveCreationOutput+ <$> o .:? "x-amz-archive-id"+ <*> o .:? "x-amz-sha256-tree-hash"+ <*> o .:? "Location"++instance ToJSON ArchiveCreationOutput where+ toJSON = const (toJSON Empty)++data UploadListElement = UploadListElement+ { _uleArchiveDescription :: Maybe Text+ , _uleCreationDate :: Maybe Text+ , _uleMultipartUploadId :: Maybe Text+ , _ulePartSizeInBytes :: Maybe Integer+ , _uleVaultARN :: Maybe Text+ } deriving (Eq, Ord, Read, Show)++-- | 'UploadListElement' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'uleArchiveDescription' @::@ 'Maybe' 'Text'+--+-- * 'uleCreationDate' @::@ 'Maybe' 'Text'+--+-- * 'uleMultipartUploadId' @::@ 'Maybe' 'Text'+--+-- * 'ulePartSizeInBytes' @::@ 'Maybe' 'Integer'+--+-- * 'uleVaultARN' @::@ 'Maybe' 'Text'+--+uploadListElement :: UploadListElement+uploadListElement = UploadListElement+ { _uleMultipartUploadId = Nothing+ , _uleVaultARN = Nothing+ , _uleArchiveDescription = Nothing+ , _ulePartSizeInBytes = Nothing+ , _uleCreationDate = Nothing+ }++-- | The description of the archive that was specified in the Initiate Multipart+-- Upload request.+uleArchiveDescription :: Lens' UploadListElement (Maybe Text)+uleArchiveDescription =+ lens _uleArchiveDescription (\s a -> s { _uleArchiveDescription = a })++-- | The UTC time at which the multipart upload was initiated.+uleCreationDate :: Lens' UploadListElement (Maybe Text)+uleCreationDate = lens _uleCreationDate (\s a -> s { _uleCreationDate = a })++-- | The ID of a multipart upload.+uleMultipartUploadId :: Lens' UploadListElement (Maybe Text)+uleMultipartUploadId =+ lens _uleMultipartUploadId (\s a -> s { _uleMultipartUploadId = a })++-- | The part size, in bytes, specified in the Initiate Multipart Upload request.+-- This is the size of all the parts in the upload except the last part, which+-- may be smaller than this size.+ulePartSizeInBytes :: Lens' UploadListElement (Maybe Integer)+ulePartSizeInBytes =+ lens _ulePartSizeInBytes (\s a -> s { _ulePartSizeInBytes = a })++-- | The Amazon Resource Name (ARN) of the vault that contains the archive.+uleVaultARN :: Lens' UploadListElement (Maybe Text)+uleVaultARN = lens _uleVaultARN (\s a -> s { _uleVaultARN = a })++instance FromJSON UploadListElement where+ parseJSON = withObject "UploadListElement" $ \o -> UploadListElement+ <$> o .:? "ArchiveDescription"+ <*> o .:? "CreationDate"+ <*> o .:? "MultipartUploadId"+ <*> o .:? "PartSizeInBytes"+ <*> o .:? "VaultARN"++instance ToJSON UploadListElement where+ toJSON UploadListElement{..} = object+ [ "MultipartUploadId" .= _uleMultipartUploadId+ , "VaultARN" .= _uleVaultARN+ , "ArchiveDescription" .= _uleArchiveDescription+ , "PartSizeInBytes" .= _ulePartSizeInBytes+ , "CreationDate" .= _uleCreationDate+ ]++data InventoryRetrievalJobDescription = InventoryRetrievalJobDescription+ { _irjdEndDate :: Maybe Text+ , _irjdFormat :: Maybe Text+ , _irjdLimit :: Maybe Text+ , _irjdMarker :: Maybe Text+ , _irjdStartDate :: Maybe Text+ } deriving (Eq, Ord, Read, Show)++-- | 'InventoryRetrievalJobDescription' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'irjdEndDate' @::@ 'Maybe' 'Text'+--+-- * 'irjdFormat' @::@ 'Maybe' 'Text'+--+-- * 'irjdLimit' @::@ 'Maybe' 'Text'+--+-- * 'irjdMarker' @::@ 'Maybe' 'Text'+--+-- * 'irjdStartDate' @::@ 'Maybe' 'Text'+--+inventoryRetrievalJobDescription :: InventoryRetrievalJobDescription+inventoryRetrievalJobDescription = InventoryRetrievalJobDescription+ { _irjdFormat = Nothing+ , _irjdStartDate = Nothing+ , _irjdEndDate = Nothing+ , _irjdLimit = Nothing+ , _irjdMarker = Nothing+ }++-- | The end of the date range in UTC for vault inventory retrieval that includes+-- archives created before this date. A string representation of ISO 8601 date+-- format, for example, 2013-03-20T17:03:43Z.+irjdEndDate :: Lens' InventoryRetrievalJobDescription (Maybe Text)+irjdEndDate = lens _irjdEndDate (\s a -> s { _irjdEndDate = a })++-- | The output format for the vault inventory list, which is set by the InitiateJob+-- request when initiating a job to retrieve a vault inventory. Valid values+-- are "CSV" and "JSON".+irjdFormat :: Lens' InventoryRetrievalJobDescription (Maybe Text)+irjdFormat = lens _irjdFormat (\s a -> s { _irjdFormat = a })++-- | Specifies the maximum number of inventory items returned per vault inventory+-- retrieval request. This limit is set when initiating the job with the a InitiateJob+-- request.+irjdLimit :: Lens' InventoryRetrievalJobDescription (Maybe Text)+irjdLimit = lens _irjdLimit (\s a -> s { _irjdLimit = a })++-- | An opaque string that represents where to continue pagination of the vault+-- inventory retrieval results. You use the marker in a new InitiateJob request+-- to obtain additional inventory items. If there are no more inventory items,+-- this value is 'null'. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html#api-initiate-job-post-vault-inventory-list-filtering Range Inventory Retrieval>.+irjdMarker :: Lens' InventoryRetrievalJobDescription (Maybe Text)+irjdMarker = lens _irjdMarker (\s a -> s { _irjdMarker = a })++-- | The start of the date range in UTC for vault inventory retrieval that+-- includes archives created on or after this date. A string representation of+-- ISO 8601 date format, for example, 2013-03-20T17:03:43Z.+irjdStartDate :: Lens' InventoryRetrievalJobDescription (Maybe Text)+irjdStartDate = lens _irjdStartDate (\s a -> s { _irjdStartDate = a })++instance FromJSON InventoryRetrievalJobDescription where+ parseJSON = withObject "InventoryRetrievalJobDescription" $ \o -> InventoryRetrievalJobDescription+ <$> o .:? "EndDate"+ <*> o .:? "Format"+ <*> o .:? "Limit"+ <*> o .:? "Marker"+ <*> o .:? "StartDate"++instance ToJSON InventoryRetrievalJobDescription where+ toJSON InventoryRetrievalJobDescription{..} = object+ [ "Format" .= _irjdFormat+ , "StartDate" .= _irjdStartDate+ , "EndDate" .= _irjdEndDate+ , "Limit" .= _irjdLimit+ , "Marker" .= _irjdMarker+ ]++data JobParameters = JobParameters+ { _jpArchiveId :: Maybe Text+ , _jpDescription :: Maybe Text+ , _jpFormat :: Maybe Text+ , _jpInventoryRetrievalParameters :: Maybe InventoryRetrievalJobInput+ , _jpRetrievalByteRange :: Maybe Text+ , _jpSNSTopic :: Maybe Text+ , _jpType :: Maybe Text+ } deriving (Eq, Read, Show)++-- | 'JobParameters' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'jpArchiveId' @::@ 'Maybe' 'Text'+--+-- * 'jpDescription' @::@ 'Maybe' 'Text'+--+-- * 'jpFormat' @::@ 'Maybe' 'Text'+--+-- * 'jpInventoryRetrievalParameters' @::@ 'Maybe' 'InventoryRetrievalJobInput'+--+-- * 'jpRetrievalByteRange' @::@ 'Maybe' 'Text'+--+-- * 'jpSNSTopic' @::@ 'Maybe' 'Text'+--+-- * 'jpType' @::@ 'Maybe' 'Text'+--+jobParameters :: JobParameters+jobParameters = JobParameters+ { _jpFormat = Nothing+ , _jpType = Nothing+ , _jpArchiveId = Nothing+ , _jpDescription = Nothing+ , _jpSNSTopic = Nothing+ , _jpRetrievalByteRange = Nothing+ , _jpInventoryRetrievalParameters = Nothing+ }++-- | The ID of the archive that you want to retrieve. This field is required only+-- if 'Type' is set to archive-retrieval. An error occurs if you specify this+-- request parameter for an inventory retrieval job request.+jpArchiveId :: Lens' JobParameters (Maybe Text)+jpArchiveId = lens _jpArchiveId (\s a -> s { _jpArchiveId = a })++-- | The optional description for the job. The description must be less than or+-- equal to 1,024 bytes. The allowable characters are 7-bit ASCII without+-- control codes-specifically, ASCII values 32-126 decimal or 0x20-0x7E+-- hexadecimal.+jpDescription :: Lens' JobParameters (Maybe Text)+jpDescription = lens _jpDescription (\s a -> s { _jpDescription = a })++-- | When initiating a job to retrieve a vault inventory, you can optionally add+-- this parameter to your request to specify the output format. If you are+-- initiating an inventory job and do not specify a Format field, JSON is the+-- default format. Valid values are "CSV" and "JSON".+jpFormat :: Lens' JobParameters (Maybe Text)+jpFormat = lens _jpFormat (\s a -> s { _jpFormat = a })++-- | Input parameters used for range inventory retrieval.+jpInventoryRetrievalParameters :: Lens' JobParameters (Maybe InventoryRetrievalJobInput)+jpInventoryRetrievalParameters =+ lens _jpInventoryRetrievalParameters+ (\s a -> s { _jpInventoryRetrievalParameters = a })++-- | The byte range to retrieve for an archive retrieval. in the form "/StartByteValue/-/EndByteValue/" If not specified, the whole archive is retrieved. If+-- specified, the byte range must be megabyte (1024*1024) aligned which means+-- that /StartByteValue/ must be divisible by 1 MB and /EndByteValue/ plus 1 must be+-- divisible by 1 MB or be the end of the archive specified as the archive byte+-- size value minus 1. If RetrievalByteRange is not megabyte aligned, this+-- operation returns a 400 response.+--+-- An error occurs if you specify this field for an inventory retrieval job+-- request.+jpRetrievalByteRange :: Lens' JobParameters (Maybe Text)+jpRetrievalByteRange =+ lens _jpRetrievalByteRange (\s a -> s { _jpRetrievalByteRange = a })++-- | The Amazon SNS topic ARN to which Amazon Glacier sends a notification when+-- the job is completed and the output is ready for you to download. The+-- specified topic publishes the notification to its subscribers. The SNS topic+-- must exist.+jpSNSTopic :: Lens' JobParameters (Maybe Text)+jpSNSTopic = lens _jpSNSTopic (\s a -> s { _jpSNSTopic = a })++-- | The job type. You can initiate a job to retrieve an archive or get an+-- inventory of a vault. Valid values are "archive-retrieval" and+-- "inventory-retrieval".+jpType :: Lens' JobParameters (Maybe Text)+jpType = lens _jpType (\s a -> s { _jpType = a })++instance FromJSON JobParameters where+ parseJSON = withObject "JobParameters" $ \o -> JobParameters+ <$> o .:? "ArchiveId"+ <*> o .:? "Description"+ <*> o .:? "Format"+ <*> o .:? "InventoryRetrievalParameters"+ <*> o .:? "RetrievalByteRange"+ <*> o .:? "SNSTopic"+ <*> o .:? "Type"++instance ToJSON JobParameters where+ toJSON JobParameters{..} = object+ [ "Format" .= _jpFormat+ , "Type" .= _jpType+ , "ArchiveId" .= _jpArchiveId+ , "Description" .= _jpDescription+ , "SNSTopic" .= _jpSNSTopic+ , "RetrievalByteRange" .= _jpRetrievalByteRange+ , "InventoryRetrievalParameters" .= _jpInventoryRetrievalParameters+ ]++data DescribeVaultOutput = DescribeVaultOutput+ { _dvoCreationDate :: Maybe Text+ , _dvoLastInventoryDate :: Maybe Text+ , _dvoNumberOfArchives :: Maybe Integer+ , _dvoSizeInBytes :: Maybe Integer+ , _dvoVaultARN :: Maybe Text+ , _dvoVaultName :: Maybe Text+ } deriving (Eq, Ord, Read, Show)++-- | 'DescribeVaultOutput' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dvoCreationDate' @::@ 'Maybe' 'Text'+--+-- * 'dvoLastInventoryDate' @::@ 'Maybe' 'Text'+--+-- * 'dvoNumberOfArchives' @::@ 'Maybe' 'Integer'+--+-- * 'dvoSizeInBytes' @::@ 'Maybe' 'Integer'+--+-- * 'dvoVaultARN' @::@ 'Maybe' 'Text'+--+-- * 'dvoVaultName' @::@ 'Maybe' 'Text'+--+describeVaultOutput :: DescribeVaultOutput+describeVaultOutput = DescribeVaultOutput+ { _dvoVaultARN = Nothing+ , _dvoVaultName = Nothing+ , _dvoCreationDate = Nothing+ , _dvoLastInventoryDate = Nothing+ , _dvoNumberOfArchives = Nothing+ , _dvoSizeInBytes = Nothing+ }++-- | The UTC date when the vault was created. A string representation of ISO 8601+-- date format, for example, "2012-03-20T17:03:43.221Z".+dvoCreationDate :: Lens' DescribeVaultOutput (Maybe Text)+dvoCreationDate = lens _dvoCreationDate (\s a -> s { _dvoCreationDate = a })++-- | The UTC date when Amazon Glacier completed the last vault inventory. A string+-- representation of ISO 8601 date format, for example,+-- "2012-03-20T17:03:43.221Z".+dvoLastInventoryDate :: Lens' DescribeVaultOutput (Maybe Text)+dvoLastInventoryDate =+ lens _dvoLastInventoryDate (\s a -> s { _dvoLastInventoryDate = a })++-- | The number of archives in the vault as of the last inventory date. This field+-- will return 'null' if an inventory has not yet run on the vault, for example,+-- if you just created the vault.+dvoNumberOfArchives :: Lens' DescribeVaultOutput (Maybe Integer)+dvoNumberOfArchives =+ lens _dvoNumberOfArchives (\s a -> s { _dvoNumberOfArchives = a })++-- | Total size, in bytes, of the archives in the vault as of the last inventory+-- date. This field will return null if an inventory has not yet run on the+-- vault, for example, if you just created the vault.+dvoSizeInBytes :: Lens' DescribeVaultOutput (Maybe Integer)+dvoSizeInBytes = lens _dvoSizeInBytes (\s a -> s { _dvoSizeInBytes = a })++-- | The Amazon Resource Name (ARN) of the vault.+dvoVaultARN :: Lens' DescribeVaultOutput (Maybe Text)+dvoVaultARN = lens _dvoVaultARN (\s a -> s { _dvoVaultARN = a })++-- | The name of the vault.+dvoVaultName :: Lens' DescribeVaultOutput (Maybe Text)+dvoVaultName = lens _dvoVaultName (\s a -> s { _dvoVaultName = a })++instance FromJSON DescribeVaultOutput where+ parseJSON = withObject "DescribeVaultOutput" $ \o -> DescribeVaultOutput+ <$> o .:? "CreationDate"+ <*> o .:? "LastInventoryDate"+ <*> o .:? "NumberOfArchives"+ <*> o .:? "SizeInBytes"+ <*> o .:? "VaultARN"+ <*> o .:? "VaultName"++instance ToJSON DescribeVaultOutput where+ toJSON DescribeVaultOutput{..} = object+ [ "VaultARN" .= _dvoVaultARN+ , "VaultName" .= _dvoVaultName+ , "CreationDate" .= _dvoCreationDate+ , "LastInventoryDate" .= _dvoLastInventoryDate+ , "NumberOfArchives" .= _dvoNumberOfArchives+ , "SizeInBytes" .= _dvoSizeInBytes+ ]++data DataRetrievalRule = DataRetrievalRule+ { _drrBytesPerHour :: Maybe Integer+ , _drrStrategy :: Maybe Text+ } deriving (Eq, Ord, Read, Show)++-- | 'DataRetrievalRule' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'drrBytesPerHour' @::@ 'Maybe' 'Integer'+--+-- * 'drrStrategy' @::@ 'Maybe' 'Text'+--+dataRetrievalRule :: DataRetrievalRule+dataRetrievalRule = DataRetrievalRule+ { _drrStrategy = Nothing+ , _drrBytesPerHour = Nothing+ }++drrBytesPerHour :: Lens' DataRetrievalRule (Maybe Integer)+drrBytesPerHour = lens _drrBytesPerHour (\s a -> s { _drrBytesPerHour = a })++drrStrategy :: Lens' DataRetrievalRule (Maybe Text)+drrStrategy = lens _drrStrategy (\s a -> s { _drrStrategy = a })++instance FromJSON DataRetrievalRule where+ parseJSON = withObject "DataRetrievalRule" $ \o -> DataRetrievalRule+ <$> o .:? "BytesPerHour"+ <*> o .:? "Strategy"++instance ToJSON DataRetrievalRule where+ toJSON DataRetrievalRule{..} = object+ [ "Strategy" .= _drrStrategy+ , "BytesPerHour" .= _drrBytesPerHour+ ]++data ActionCode+ = ArchiveRetrieval -- ^ ArchiveRetrieval+ | InventoryRetrieval -- ^ InventoryRetrieval+ deriving (Eq, Ord, Read, Show, Generic, Enum)++instance Hashable ActionCode++instance FromText ActionCode where+ parser = takeLowerText >>= \case+ "archiveretrieval" -> pure ArchiveRetrieval+ "inventoryretrieval" -> pure InventoryRetrieval+ e -> fail $+ "Failure parsing ActionCode from " ++ show e++instance ToText ActionCode where+ toText = \case+ ArchiveRetrieval -> "ArchiveRetrieval"+ InventoryRetrieval -> "InventoryRetrieval"++instance ToByteString ActionCode+instance ToHeader ActionCode+instance ToQuery ActionCode++instance FromJSON ActionCode where+ parseJSON = parseJSONText "ActionCode"++instance ToJSON ActionCode where+ toJSON = toJSONText++data VaultNotificationConfig = VaultNotificationConfig+ { _vncEvents :: List "Events" Text+ , _vncSNSTopic :: Maybe Text+ } deriving (Eq, Ord, Read, Show)++-- | 'VaultNotificationConfig' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'vncEvents' @::@ ['Text']+--+-- * 'vncSNSTopic' @::@ 'Maybe' 'Text'+--+vaultNotificationConfig :: VaultNotificationConfig+vaultNotificationConfig = VaultNotificationConfig+ { _vncSNSTopic = Nothing+ , _vncEvents = mempty+ }++-- | A list of one or more events for which Amazon Glacier will send a+-- notification to the specified Amazon SNS topic.+vncEvents :: Lens' VaultNotificationConfig [Text]+vncEvents = lens _vncEvents (\s a -> s { _vncEvents = a }) . _List++-- | The Amazon Simple Notification Service (Amazon SNS) topic Amazon Resource+-- Name (ARN).+vncSNSTopic :: Lens' VaultNotificationConfig (Maybe Text)+vncSNSTopic = lens _vncSNSTopic (\s a -> s { _vncSNSTopic = a })++instance FromJSON VaultNotificationConfig where+ parseJSON = withObject "VaultNotificationConfig" $ \o -> VaultNotificationConfig+ <$> o .:? "Events" .!= mempty+ <*> o .:? "SNSTopic"++instance ToJSON VaultNotificationConfig where+ toJSON VaultNotificationConfig{..} = object+ [ "SNSTopic" .= _vncSNSTopic+ , "Events" .= _vncEvents+ ]++data InventoryRetrievalJobInput = InventoryRetrievalJobInput+ { _irjiEndDate :: Maybe Text+ , _irjiLimit :: Maybe Text+ , _irjiMarker :: Maybe Text+ , _irjiStartDate :: Maybe Text+ } deriving (Eq, Ord, Read, Show)++-- | 'InventoryRetrievalJobInput' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'irjiEndDate' @::@ 'Maybe' 'Text'+--+-- * 'irjiLimit' @::@ 'Maybe' 'Text'+--+-- * 'irjiMarker' @::@ 'Maybe' 'Text'+--+-- * 'irjiStartDate' @::@ 'Maybe' 'Text'+--+inventoryRetrievalJobInput :: InventoryRetrievalJobInput+inventoryRetrievalJobInput = InventoryRetrievalJobInput+ { _irjiStartDate = Nothing+ , _irjiEndDate = Nothing+ , _irjiLimit = Nothing+ , _irjiMarker = Nothing+ }++-- | The end of the date range in UTC for vault inventory retrieval that includes+-- archives created before this date. A string representation of ISO 8601 date+-- format, for example, 2013-03-20T17:03:43Z.+irjiEndDate :: Lens' InventoryRetrievalJobInput (Maybe Text)+irjiEndDate = lens _irjiEndDate (\s a -> s { _irjiEndDate = a })++-- | Specifies the maximum number of inventory items returned per vault inventory+-- retrieval request. Valid values are greater than or equal to 1.+irjiLimit :: Lens' InventoryRetrievalJobInput (Maybe Text)+irjiLimit = lens _irjiLimit (\s a -> s { _irjiLimit = a })++-- | An opaque string that represents where to continue pagination of the vault+-- inventory retrieval results. You use the marker in a new InitiateJob request+-- to obtain additional inventory items. If there are no more inventory items,+-- this value is 'null'.+irjiMarker :: Lens' InventoryRetrievalJobInput (Maybe Text)+irjiMarker = lens _irjiMarker (\s a -> s { _irjiMarker = a })++-- | The start of the date range in UTC for vault inventory retrieval that+-- includes archives created on or after this date. A string representation of+-- ISO 8601 date format, for example, 2013-03-20T17:03:43Z.+irjiStartDate :: Lens' InventoryRetrievalJobInput (Maybe Text)+irjiStartDate = lens _irjiStartDate (\s a -> s { _irjiStartDate = a })++instance FromJSON InventoryRetrievalJobInput where+ parseJSON = withObject "InventoryRetrievalJobInput" $ \o -> InventoryRetrievalJobInput+ <$> o .:? "EndDate"+ <*> o .:? "Limit"+ <*> o .:? "Marker"+ <*> o .:? "StartDate"++instance ToJSON InventoryRetrievalJobInput where+ toJSON InventoryRetrievalJobInput{..} = object+ [ "StartDate" .= _irjiStartDate+ , "EndDate" .= _irjiEndDate+ , "Limit" .= _irjiLimit+ , "Marker" .= _irjiMarker+ ]++data PartListElement = PartListElement+ { _pleRangeInBytes :: Maybe Text+ , _pleSHA256TreeHash :: Maybe Text+ } deriving (Eq, Ord, Read, Show)++-- | 'PartListElement' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'pleRangeInBytes' @::@ 'Maybe' 'Text'+--+-- * 'pleSHA256TreeHash' @::@ 'Maybe' 'Text'+--+partListElement :: PartListElement+partListElement = PartListElement+ { _pleRangeInBytes = Nothing+ , _pleSHA256TreeHash = Nothing+ }++-- | The byte range of a part, inclusive of the upper value of the range.+pleRangeInBytes :: Lens' PartListElement (Maybe Text)+pleRangeInBytes = lens _pleRangeInBytes (\s a -> s { _pleRangeInBytes = a })++-- | The SHA256 tree hash value that Amazon Glacier calculated for the part. This+-- field is never 'null'.+pleSHA256TreeHash :: Lens' PartListElement (Maybe Text)+pleSHA256TreeHash =+ lens _pleSHA256TreeHash (\s a -> s { _pleSHA256TreeHash = a })++instance FromJSON PartListElement where+ parseJSON = withObject "PartListElement" $ \o -> PartListElement+ <$> o .:? "RangeInBytes"+ <*> o .:? "SHA256TreeHash"++instance ToJSON PartListElement where+ toJSON PartListElement{..} = object+ [ "RangeInBytes" .= _pleRangeInBytes+ , "SHA256TreeHash" .= _pleSHA256TreeHash+ ]++newtype DataRetrievalPolicy = DataRetrievalPolicy+ { _drpRules :: List "Rules" DataRetrievalRule+ } deriving (Eq, Read, Show, Monoid, Semigroup)++instance GHC.Exts.IsList DataRetrievalPolicy where+ type Item DataRetrievalPolicy = DataRetrievalRule++ fromList = DataRetrievalPolicy . GHC.Exts.fromList+ toList = GHC.Exts.toList . _drpRules++-- | 'DataRetrievalPolicy' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'drpRules' @::@ ['DataRetrievalRule']+--+dataRetrievalPolicy :: DataRetrievalPolicy+dataRetrievalPolicy = DataRetrievalPolicy+ { _drpRules = mempty+ }++drpRules :: Lens' DataRetrievalPolicy [DataRetrievalRule]+drpRules = lens _drpRules (\s a -> s { _drpRules = a }) . _List++instance FromJSON DataRetrievalPolicy where+ parseJSON = withObject "DataRetrievalPolicy" $ \o -> DataRetrievalPolicy+ <$> o .:? "Rules" .!= mempty++instance ToJSON DataRetrievalPolicy where+ toJSON DataRetrievalPolicy{..} = object+ [ "Rules" .= _drpRules+ ]++data GlacierJobDescription = GlacierJobDescription+ { _gjdAction :: Maybe ActionCode+ , _gjdArchiveId :: Maybe Text+ , _gjdArchiveSHA256TreeHash :: Maybe Text+ , _gjdArchiveSizeInBytes :: Maybe Integer+ , _gjdCompleted :: Maybe Bool+ , _gjdCompletionDate :: Maybe Text+ , _gjdCreationDate :: Maybe Text+ , _gjdInventoryRetrievalParameters :: Maybe InventoryRetrievalJobDescription+ , _gjdInventorySizeInBytes :: Maybe Integer+ , _gjdJobDescription :: Maybe Text+ , _gjdJobId :: Maybe Text+ , _gjdRetrievalByteRange :: Maybe Text+ , _gjdSHA256TreeHash :: Maybe Text+ , _gjdSNSTopic :: Maybe Text+ , _gjdStatusCode :: Maybe StatusCode+ , _gjdStatusMessage :: Maybe Text+ , _gjdVaultARN :: Maybe Text+ } deriving (Eq, Read, Show)++-- | 'GlacierJobDescription' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gjdAction' @::@ 'Maybe' 'ActionCode'+--+-- * 'gjdArchiveId' @::@ 'Maybe' 'Text'+--+-- * 'gjdArchiveSHA256TreeHash' @::@ 'Maybe' 'Text'+--+-- * 'gjdArchiveSizeInBytes' @::@ 'Maybe' 'Integer'+--+-- * 'gjdCompleted' @::@ 'Maybe' 'Bool'+--+-- * 'gjdCompletionDate' @::@ 'Maybe' 'Text'+--+-- * 'gjdCreationDate' @::@ 'Maybe' 'Text'+--+-- * 'gjdInventoryRetrievalParameters' @::@ 'Maybe' 'InventoryRetrievalJobDescription'+--+-- * 'gjdInventorySizeInBytes' @::@ 'Maybe' 'Integer'+--+-- * 'gjdJobDescription' @::@ 'Maybe' 'Text'+--+-- * 'gjdJobId' @::@ 'Maybe' 'Text'+--+-- * 'gjdRetrievalByteRange' @::@ 'Maybe' 'Text'+--+-- * 'gjdSHA256TreeHash' @::@ 'Maybe' 'Text'+--+-- * 'gjdSNSTopic' @::@ 'Maybe' 'Text'+--+-- * 'gjdStatusCode' @::@ 'Maybe' 'StatusCode'+--+-- * 'gjdStatusMessage' @::@ 'Maybe' 'Text'+--+-- * 'gjdVaultARN' @::@ 'Maybe' 'Text'+--+glacierJobDescription :: GlacierJobDescription+glacierJobDescription = GlacierJobDescription+ { _gjdJobId = Nothing+ , _gjdJobDescription = Nothing+ , _gjdAction = Nothing+ , _gjdArchiveId = Nothing+ , _gjdVaultARN = Nothing+ , _gjdCreationDate = Nothing+ , _gjdCompleted = Nothing+ , _gjdStatusCode = Nothing+ , _gjdStatusMessage = Nothing+ , _gjdArchiveSizeInBytes = Nothing+ , _gjdInventorySizeInBytes = Nothing+ , _gjdSNSTopic = Nothing+ , _gjdCompletionDate = Nothing+ , _gjdSHA256TreeHash = Nothing+ , _gjdArchiveSHA256TreeHash = Nothing+ , _gjdRetrievalByteRange = Nothing+ , _gjdInventoryRetrievalParameters = Nothing+ }++-- | The job type. It is either ArchiveRetrieval or InventoryRetrieval.+gjdAction :: Lens' GlacierJobDescription (Maybe ActionCode)+gjdAction = lens _gjdAction (\s a -> s { _gjdAction = a })++-- | For an ArchiveRetrieval job, this is the archive ID requested for download.+-- Otherwise, this field is null.+gjdArchiveId :: Lens' GlacierJobDescription (Maybe Text)+gjdArchiveId = lens _gjdArchiveId (\s a -> s { _gjdArchiveId = a })++-- | The SHA256 tree hash of the entire archive for an archive retrieval. For+-- inventory retrieval jobs, this field is null.+gjdArchiveSHA256TreeHash :: Lens' GlacierJobDescription (Maybe Text)+gjdArchiveSHA256TreeHash =+ lens _gjdArchiveSHA256TreeHash+ (\s a -> s { _gjdArchiveSHA256TreeHash = a })++-- | For an ArchiveRetrieval job, this is the size in bytes of the archive being+-- requested for download. For the InventoryRetrieval job, the value is null.+gjdArchiveSizeInBytes :: Lens' GlacierJobDescription (Maybe Integer)+gjdArchiveSizeInBytes =+ lens _gjdArchiveSizeInBytes (\s a -> s { _gjdArchiveSizeInBytes = a })++-- | The job status. When a job is completed, you get the job's output.+gjdCompleted :: Lens' GlacierJobDescription (Maybe Bool)+gjdCompleted = lens _gjdCompleted (\s a -> s { _gjdCompleted = a })++-- | The UTC time that the archive retrieval request completed. While the job is+-- in progress, the value will be null.+gjdCompletionDate :: Lens' GlacierJobDescription (Maybe Text)+gjdCompletionDate =+ lens _gjdCompletionDate (\s a -> s { _gjdCompletionDate = a })++-- | The UTC date when the job was created. A string representation of ISO 8601+-- date format, for example, "2012-03-20T17:03:43.221Z".+gjdCreationDate :: Lens' GlacierJobDescription (Maybe Text)+gjdCreationDate = lens _gjdCreationDate (\s a -> s { _gjdCreationDate = a })++-- | Parameters used for range inventory retrieval.+gjdInventoryRetrievalParameters :: Lens' GlacierJobDescription (Maybe InventoryRetrievalJobDescription)+gjdInventoryRetrievalParameters =+ lens _gjdInventoryRetrievalParameters+ (\s a -> s { _gjdInventoryRetrievalParameters = a })++-- | For an InventoryRetrieval job, this is the size in bytes of the inventory+-- requested for download. For the ArchiveRetrieval job, the value is null.+gjdInventorySizeInBytes :: Lens' GlacierJobDescription (Maybe Integer)+gjdInventorySizeInBytes =+ lens _gjdInventorySizeInBytes (\s a -> s { _gjdInventorySizeInBytes = a })++-- | The job description you provided when you initiated the job.+gjdJobDescription :: Lens' GlacierJobDescription (Maybe Text)+gjdJobDescription =+ lens _gjdJobDescription (\s a -> s { _gjdJobDescription = a })++-- | An opaque string that identifies an Amazon Glacier job.+gjdJobId :: Lens' GlacierJobDescription (Maybe Text)+gjdJobId = lens _gjdJobId (\s a -> s { _gjdJobId = a })++-- | The retrieved byte range for archive retrieval jobs in the form "/StartByteValue/-/EndByteValue/" If no range was specified in the archive retrieval, then the+-- whole archive is retrieved and /StartByteValue/ equals 0 and /EndByteValue/+-- equals the size of the archive minus 1. For inventory retrieval jobs this+-- field is null.+gjdRetrievalByteRange :: Lens' GlacierJobDescription (Maybe Text)+gjdRetrievalByteRange =+ lens _gjdRetrievalByteRange (\s a -> s { _gjdRetrievalByteRange = a })++-- | For an ArchiveRetrieval job, it is the checksum of the archive. Otherwise,+-- the value is null.+--+-- The SHA256 tree hash value for the requested range of an archive. If the+-- Initiate a Job request for an archive specified a tree-hash aligned range,+-- then this field returns a value.+--+-- For the specific case when the whole archive is retrieved, this value is+-- the same as the ArchiveSHA256TreeHash value.+--+-- This field is null in the following situations: Archive retrieval jobs+-- that specify a range that is not tree-hash aligned.+--+-- Archival jobs that specify a range that is equal to the whole archive and+-- the job status is InProgress.+--+-- Inventory jobs.+--+--+gjdSHA256TreeHash :: Lens' GlacierJobDescription (Maybe Text)+gjdSHA256TreeHash =+ lens _gjdSHA256TreeHash (\s a -> s { _gjdSHA256TreeHash = a })++-- | An Amazon Simple Notification Service (Amazon SNS) topic that receives+-- notification.+gjdSNSTopic :: Lens' GlacierJobDescription (Maybe Text)+gjdSNSTopic = lens _gjdSNSTopic (\s a -> s { _gjdSNSTopic = a })++-- | The status code can be InProgress, Succeeded, or Failed, and indicates the+-- status of the job.+gjdStatusCode :: Lens' GlacierJobDescription (Maybe StatusCode)+gjdStatusCode = lens _gjdStatusCode (\s a -> s { _gjdStatusCode = a })++-- | A friendly message that describes the job status.+gjdStatusMessage :: Lens' GlacierJobDescription (Maybe Text)+gjdStatusMessage = lens _gjdStatusMessage (\s a -> s { _gjdStatusMessage = a })++-- | The Amazon Resource Name (ARN) of the vault from which the archive retrieval+-- was requested.+gjdVaultARN :: Lens' GlacierJobDescription (Maybe Text)+gjdVaultARN = lens _gjdVaultARN (\s a -> s { _gjdVaultARN = a })++instance FromJSON GlacierJobDescription where+ parseJSON = withObject "GlacierJobDescription" $ \o -> GlacierJobDescription+ <$> o .:? "Action"+ <*> o .:? "ArchiveId"+ <*> o .:? "ArchiveSHA256TreeHash"+ <*> o .:? "ArchiveSizeInBytes"+ <*> o .:? "Completed"+ <*> o .:? "CompletionDate"+ <*> o .:? "CreationDate"+ <*> o .:? "InventoryRetrievalParameters"+ <*> o .:? "InventorySizeInBytes"+ <*> o .:? "JobDescription"+ <*> o .:? "JobId"+ <*> o .:? "RetrievalByteRange"+ <*> o .:? "SHA256TreeHash"+ <*> o .:? "SNSTopic"+ <*> o .:? "StatusCode"+ <*> o .:? "StatusMessage"+ <*> o .:? "VaultARN"++instance ToJSON GlacierJobDescription where+ toJSON GlacierJobDescription{..} = object+ [ "JobId" .= _gjdJobId+ , "JobDescription" .= _gjdJobDescription+ , "Action" .= _gjdAction+ , "ArchiveId" .= _gjdArchiveId+ , "VaultARN" .= _gjdVaultARN+ , "CreationDate" .= _gjdCreationDate+ , "Completed" .= _gjdCompleted+ , "StatusCode" .= _gjdStatusCode+ , "StatusMessage" .= _gjdStatusMessage+ , "ArchiveSizeInBytes" .= _gjdArchiveSizeInBytes+ , "InventorySizeInBytes" .= _gjdInventorySizeInBytes+ , "SNSTopic" .= _gjdSNSTopic+ , "CompletionDate" .= _gjdCompletionDate+ , "SHA256TreeHash" .= _gjdSHA256TreeHash+ , "ArchiveSHA256TreeHash" .= _gjdArchiveSHA256TreeHash+ , "RetrievalByteRange" .= _gjdRetrievalByteRange+ , "InventoryRetrievalParameters" .= _gjdInventoryRetrievalParameters+ ]++data StatusCode+ = Failed -- ^ Failed+ | InProgress -- ^ InProgress+ | Succeeded -- ^ Succeeded+ deriving (Eq, Ord, Read, Show, Generic, Enum)++instance Hashable StatusCode++instance FromText StatusCode where+ parser = takeLowerText >>= \case+ "failed" -> pure Failed+ "inprogress" -> pure InProgress+ "succeeded" -> pure Succeeded+ e -> fail $+ "Failure parsing StatusCode from " ++ show e++instance ToText StatusCode where+ toText = \case+ Failed -> "Failed"+ InProgress -> "InProgress"+ Succeeded -> "Succeeded"++instance ToByteString StatusCode+instance ToHeader StatusCode+instance ToQuery StatusCode++instance FromJSON StatusCode where+ parseJSON = parseJSONText "StatusCode"++instance ToJSON StatusCode where+ toJSON = toJSONText
+ gen/Network/AWS/Glacier/UploadArchive.hs view
@@ -0,0 +1,208 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.UploadArchive+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation adds an archive to a vault. This is a synchronous operation,+-- and for a successful upload, your data is durably persisted. Amazon Glacier+-- returns the archive ID in the 'x-amz-archive-id' header of the response.+--+-- You must use the archive ID to access your data in Amazon Glacier. After you+-- upload an archive, you should save the archive ID returned so that you can+-- retrieve or delete the archive later. Besides saving the archive ID, you can+-- also index it and give it a friendly name to allow for better searching. You+-- can also use the optional archive description field to specify how the+-- archive is referred to in an external index of archives, such as you might+-- create in Amazon DynamoDB. You can also get the vault inventory to obtain a+-- list of archive IDs in a vault. For more information, see 'InitiateJob'.+--+-- You must provide a SHA256 tree hash of the data you are uploading. For+-- information about computing a SHA256 tree hash, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html Computing Checksums>.+--+-- You can optionally specify an archive description of up to 1,024 printable+-- ASCII characters. You can get the archive description when you either+-- retrieve the archive or get the vault inventory. For more information, see 'InitiateJob'. Amazon Glacier does not interpret the description in any way. An archive+-- description does not need to be unique. You cannot use the description to+-- retrieve or sort the archive list.+--+-- Archives are immutable. After you upload an archive, you cannot edit the+-- archive or its description.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/uploading-an-archive.html Uploading anArchive in Amazon Glacier> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-archive-post.html Upload Archive> in the /Amazon Glacier DeveloperGuide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-UploadArchive.html>+module Network.AWS.Glacier.UploadArchive+ (+ -- * Request+ UploadArchive+ -- ** Request constructor+ , uploadArchive+ -- ** Request lenses+ , uaAccountId+ , uaArchiveDescription+ , uaBody+ , uaChecksum+ , uaVaultName++ -- * Response+ , UploadArchiveResponse+ -- ** Response constructor+ , uploadArchiveResponse+ -- ** Response lenses+ , uarArchiveId+ , uarChecksum+ , uarLocation+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data UploadArchive = UploadArchive+ { _uaAccountId :: Text+ , _uaArchiveDescription :: Maybe Text+ , _uaBody :: RqBody+ , _uaChecksum :: Maybe Text+ , _uaVaultName :: Text+ } deriving (Show)++-- | 'UploadArchive' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'uaAccountId' @::@ 'Text'+--+-- * 'uaArchiveDescription' @::@ 'Maybe' 'Text'+--+-- * 'uaBody' @::@ 'RqBody'+--+-- * 'uaChecksum' @::@ 'Maybe' 'Text'+--+-- * 'uaVaultName' @::@ 'Text'+--+uploadArchive :: Text -- ^ 'uaVaultName'+ -> Text -- ^ 'uaAccountId'+ -> RqBody -- ^ 'uaBody'+ -> UploadArchive+uploadArchive p1 p2 p3 = UploadArchive+ { _uaVaultName = p1+ , _uaAccountId = p2+ , _uaBody = p3+ , _uaArchiveDescription = Nothing+ , _uaChecksum = Nothing+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+uaAccountId :: Lens' UploadArchive Text+uaAccountId = lens _uaAccountId (\s a -> s { _uaAccountId = a })++-- | The optional description of the archive you are uploading.+uaArchiveDescription :: Lens' UploadArchive (Maybe Text)+uaArchiveDescription =+ lens _uaArchiveDescription (\s a -> s { _uaArchiveDescription = a })++-- | The data to upload.+uaBody :: Lens' UploadArchive RqBody+uaBody = lens _uaBody (\s a -> s { _uaBody = a })++-- | The SHA256 checksum (a linear hash) of the payload.+uaChecksum :: Lens' UploadArchive (Maybe Text)+uaChecksum = lens _uaChecksum (\s a -> s { _uaChecksum = a })++-- | The name of the vault.+uaVaultName :: Lens' UploadArchive Text+uaVaultName = lens _uaVaultName (\s a -> s { _uaVaultName = a })++data UploadArchiveResponse = UploadArchiveResponse+ { _uarArchiveId :: Maybe Text+ , _uarChecksum :: Maybe Text+ , _uarLocation :: Maybe Text+ } deriving (Eq, Ord, Read, Show)++-- | 'UploadArchiveResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'uarArchiveId' @::@ 'Maybe' 'Text'+--+-- * 'uarChecksum' @::@ 'Maybe' 'Text'+--+-- * 'uarLocation' @::@ 'Maybe' 'Text'+--+uploadArchiveResponse :: UploadArchiveResponse+uploadArchiveResponse = UploadArchiveResponse+ { _uarLocation = Nothing+ , _uarChecksum = Nothing+ , _uarArchiveId = Nothing+ }++-- | The ID of the archive. This value is also included as part of the location.+uarArchiveId :: Lens' UploadArchiveResponse (Maybe Text)+uarArchiveId = lens _uarArchiveId (\s a -> s { _uarArchiveId = a })++-- | The checksum of the archive computed by Amazon Glacier.+uarChecksum :: Lens' UploadArchiveResponse (Maybe Text)+uarChecksum = lens _uarChecksum (\s a -> s { _uarChecksum = a })++-- | The relative URI path of the newly added archive resource.+uarLocation :: Lens' UploadArchiveResponse (Maybe Text)+uarLocation = lens _uarLocation (\s a -> s { _uarLocation = a })++instance ToPath UploadArchive where+ toPath UploadArchive{..} = mconcat+ [ "/"+ , toText _uaAccountId+ , "/vaults/"+ , toText _uaVaultName+ , "/archives"+ ]++instance ToQuery UploadArchive where+ toQuery = const mempty++instance ToHeaders UploadArchive where+ toHeaders UploadArchive{..} = mconcat+ [ "x-amz-archive-description" =: _uaArchiveDescription+ , "x-amz-sha256-tree-hash" =: _uaChecksum+ ]++instance ToBody UploadArchive where+ toBody = toBody . _uaBody++instance AWSRequest UploadArchive where+ type Sv UploadArchive = Glacier+ type Rs UploadArchive = UploadArchiveResponse++ request = stream POST+ response = headerResponse $ \h -> UploadArchiveResponse+ <$> h ~:? "x-amz-archive-id"+ <*> h ~:? "x-amz-sha256-tree-hash"+ <*> h ~:? "Location"
+ gen/Network/AWS/Glacier/UploadMultipartPart.hs view
@@ -0,0 +1,208 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Glacier.UploadMultipartPart+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | This operation uploads a part of an archive. You can upload archive parts in+-- any order. You can also upload them in parallel. You can upload up to 10,000+-- parts for a multipart upload.+--+-- Amazon Glacier rejects your upload part request if any of the following+-- conditions is true:+--+-- SHA256 tree hash does not matchTo ensure that part data is not corrupted+-- in transmission, you compute a SHA256 tree hash of the part and include it in+-- your request. Upon receiving the part data, Amazon Glacier also computes a+-- SHA256 tree hash. If these hash values don't match, the operation fails. For+-- information about computing a SHA256 tree hash, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html Computing Checksums>.+--+-- Part size does not matchThe size of each part except the last must match+-- the size specified in the corresponding 'InitiateMultipartUpload' request. The+-- size of the last part must be the same size as, or smaller than, the+-- specified size.+--+-- If you upload a part whose size is smaller than the part size you specified+-- in your initiate multipart upload request and that part is not the last part,+-- then the upload part request will succeed. However, the subsequent Complete+-- Multipart Upload request will fail.+--+-- Range does not alignThe byte range value in the request does not align+-- with the part size specified in the corresponding initiate request. For+-- example, if you specify a part size of 4194304 bytes (4 MB), then 0 to+-- 4194303 bytes (4 MB - 1) and 4194304 (4 MB) to 8388607 (8 MB - 1) are valid+-- part ranges. However, if you set a range value of 2 MB to 6 MB, the range+-- does not align with the part size and the upload will fail. This operation+-- is idempotent. If you upload the same part multiple times, the data included+-- in the most recent request overwrites the previously uploaded data.+--+-- An AWS account has full permission to perform all operations (actions).+-- However, AWS Identity and Access Management (IAM) users don't have any+-- permissions by default. You must grant them explicit permission to perform+-- specific actions. For more information, see <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identityand Access Management (IAM)>.+--+-- For conceptual information and underlying REST API, go to <http://docs.aws.amazon.com/amazonglacier/latest/dev/uploading-archive-mpu.html Uploading LargeArchives in Parts (Multipart Upload)> and <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-upload-part.html Upload Part > in the /Amazon GlacierDeveloper Guide/.+--+-- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-UploadMultipartPart.html>+module Network.AWS.Glacier.UploadMultipartPart+ (+ -- * Request+ UploadMultipartPart+ -- ** Request constructor+ , uploadMultipartPart+ -- ** Request lenses+ , umpAccountId+ , umpBody+ , umpChecksum+ , umpRange+ , umpUploadId+ , umpVaultName++ -- * Response+ , UploadMultipartPartResponse+ -- ** Response constructor+ , uploadMultipartPartResponse+ -- ** Response lenses+ , umprChecksum+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.RestJSON+import Network.AWS.Glacier.Types+import qualified GHC.Exts++data UploadMultipartPart = UploadMultipartPart+ { _umpAccountId :: Text+ , _umpBody :: RqBody+ , _umpChecksum :: Maybe Text+ , _umpRange :: Maybe Text+ , _umpUploadId :: Text+ , _umpVaultName :: Text+ } deriving (Show)++-- | 'UploadMultipartPart' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'umpAccountId' @::@ 'Text'+--+-- * 'umpBody' @::@ 'RqBody'+--+-- * 'umpChecksum' @::@ 'Maybe' 'Text'+--+-- * 'umpRange' @::@ 'Maybe' 'Text'+--+-- * 'umpUploadId' @::@ 'Text'+--+-- * 'umpVaultName' @::@ 'Text'+--+uploadMultipartPart :: Text -- ^ 'umpAccountId'+ -> Text -- ^ 'umpVaultName'+ -> Text -- ^ 'umpUploadId'+ -> RqBody -- ^ 'umpBody'+ -> UploadMultipartPart+uploadMultipartPart p1 p2 p3 p4 = UploadMultipartPart+ { _umpAccountId = p1+ , _umpVaultName = p2+ , _umpUploadId = p3+ , _umpBody = p4+ , _umpChecksum = Nothing+ , _umpRange = Nothing+ }++-- | The 'AccountId' is the AWS Account ID. You can specify either the AWS Account+-- ID or optionally a '-', in which case Amazon Glacier uses the AWS Account ID+-- associated with the credentials used to sign the request. If you specify your+-- Account ID, do not include hyphens in it.+umpAccountId :: Lens' UploadMultipartPart Text+umpAccountId = lens _umpAccountId (\s a -> s { _umpAccountId = a })++-- | The data to upload.+umpBody :: Lens' UploadMultipartPart RqBody+umpBody = lens _umpBody (\s a -> s { _umpBody = a })++-- | The SHA256 tree hash of the data being uploaded.+umpChecksum :: Lens' UploadMultipartPart (Maybe Text)+umpChecksum = lens _umpChecksum (\s a -> s { _umpChecksum = a })++-- | Identifies the range of bytes in the assembled archive that will be uploaded+-- in this part. Amazon Glacier uses this information to assemble the archive in+-- the proper sequence. The format of this header follows RFC 2616. An example+-- header is Content-Range:bytes 0-4194303/*.+umpRange :: Lens' UploadMultipartPart (Maybe Text)+umpRange = lens _umpRange (\s a -> s { _umpRange = a })++-- | The upload ID of the multipart upload.+umpUploadId :: Lens' UploadMultipartPart Text+umpUploadId = lens _umpUploadId (\s a -> s { _umpUploadId = a })++-- | The name of the vault.+umpVaultName :: Lens' UploadMultipartPart Text+umpVaultName = lens _umpVaultName (\s a -> s { _umpVaultName = a })++newtype UploadMultipartPartResponse = UploadMultipartPartResponse+ { _umprChecksum :: Maybe Text+ } deriving (Eq, Ord, Read, Show, Monoid)++-- | 'UploadMultipartPartResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'umprChecksum' @::@ 'Maybe' 'Text'+--+uploadMultipartPartResponse :: UploadMultipartPartResponse+uploadMultipartPartResponse = UploadMultipartPartResponse+ { _umprChecksum = Nothing+ }++-- | The SHA256 tree hash that Amazon Glacier computed for the uploaded part.+umprChecksum :: Lens' UploadMultipartPartResponse (Maybe Text)+umprChecksum = lens _umprChecksum (\s a -> s { _umprChecksum = a })++instance ToPath UploadMultipartPart where+ toPath UploadMultipartPart{..} = mconcat+ [ "/"+ , toText _umpAccountId+ , "/vaults/"+ , toText _umpVaultName+ , "/multipart-uploads/"+ , toText _umpUploadId+ ]++instance ToQuery UploadMultipartPart where+ toQuery = const mempty++instance ToHeaders UploadMultipartPart where+ toHeaders UploadMultipartPart{..} = mconcat+ [ "x-amz-sha256-tree-hash" =: _umpChecksum+ , "Content-Range" =: _umpRange+ ]++instance ToBody UploadMultipartPart where+ toBody = toBody . _umpBody++instance AWSRequest UploadMultipartPart where+ type Sv UploadMultipartPart = Glacier+ type Rs UploadMultipartPart = UploadMultipartPartResponse++ request = stream PUT+ response = headerResponse $ \h -> UploadMultipartPartResponse+ <$> h ~:? "x-amz-sha256-tree-hash"