amazonka-sqs (empty) → 0.0.0
raw patch · 22 files changed
+3387/−0 lines, 22 filesdep +amazonka-coredep +basesetup-changed
Dependencies added: amazonka-core, base
Files
- LICENSE +373/−0
- README.md +26/−0
- Setup.hs +2/−0
- amazonka-sqs.cabal +64/−0
- gen/Network/AWS/SQS.hs +54/−0
- gen/Network/AWS/SQS/AddPermission.hs +139/−0
- gen/Network/AWS/SQS/ChangeMessageVisibility.hs +133/−0
- gen/Network/AWS/SQS/ChangeMessageVisibilityBatch.hs +137/−0
- gen/Network/AWS/SQS/CreateQueue.hs +147/−0
- gen/Network/AWS/SQS/DeleteMessage.hs +110/−0
- gen/Network/AWS/SQS/DeleteMessageBatch.hs +134/−0
- gen/Network/AWS/SQS/DeleteQueue.hs +99/−0
- gen/Network/AWS/SQS/GetQueueAttributes.hs +144/−0
- gen/Network/AWS/SQS/GetQueueUrl.hs +125/−0
- gen/Network/AWS/SQS/ListDeadLetterSourceQueues.hs +110/−0
- gen/Network/AWS/SQS/ListQueues.hs +111/−0
- gen/Network/AWS/SQS/ReceiveMessage.hs +206/−0
- gen/Network/AWS/SQS/RemovePermission.hs +101/−0
- gen/Network/AWS/SQS/SendMessage.hs +185/−0
- gen/Network/AWS/SQS/SendMessageBatch.hs +144/−0
- gen/Network/AWS/SQS/SetQueueAttributes.hs +125/−0
- gen/Network/AWS/SQS/Types.hs +718/−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,26 @@+# Amazon Simple Queue Service 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 Simple Queue Service (SQS) is a fast, reliable, scalable, fully managed message queuing service. SQS makes it simple and cost-effective to decouple the components of a cloud application. You can use SQS to transmit any volume of data, at any level of throughput, without losing messages or requiring other services to be always available. With SQS, you can offload the administrative burden of operating and scaling a highly available messaging cluster, while paying a low price for only what you use.++Documentation is available via [Hackage](http://hackage.haskell.org/package/amazonka-sqs)+and [AWS API Reference](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/Welcome.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-sqs` is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/).
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ amazonka-sqs.cabal view
@@ -0,0 +1,64 @@+name: amazonka-sqs+version: 0.0.0+synopsis: Amazon Simple Queue Service 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+build-type: Simple+extra-source-files: README.md+cabal-version: >= 1.10++description:+ Amazon Simple Queue Service (SQS) is a fast, reliable, scalable, fully+ managed message queuing service. SQS makes it simple and cost-effective+ to decouple the components of a cloud application. You can use SQS to+ transmit any volume of data, at any level of throughput, without losing+ messages or requiring other services to be always available. With SQS,+ you can offload the administrative burden of operating and scaling a+ highly available messaging cluster, while paying a low price for only+ what you use.+ .+ /See:/ <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/Welcome.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.SQS+ , Network.AWS.SQS.AddPermission+ , Network.AWS.SQS.ChangeMessageVisibility+ , Network.AWS.SQS.ChangeMessageVisibilityBatch+ , Network.AWS.SQS.CreateQueue+ , Network.AWS.SQS.DeleteMessage+ , Network.AWS.SQS.DeleteMessageBatch+ , Network.AWS.SQS.DeleteQueue+ , Network.AWS.SQS.GetQueueAttributes+ , Network.AWS.SQS.GetQueueUrl+ , Network.AWS.SQS.ListDeadLetterSourceQueues+ , Network.AWS.SQS.ListQueues+ , Network.AWS.SQS.ReceiveMessage+ , Network.AWS.SQS.RemovePermission+ , Network.AWS.SQS.SendMessage+ , Network.AWS.SQS.SendMessageBatch+ , Network.AWS.SQS.SetQueueAttributes+ , Network.AWS.SQS.Types++ other-modules:++ build-depends:+ amazonka-core+ , base >= 4.7 && < 5
+ gen/Network/AWS/SQS.hs view
@@ -0,0 +1,54 @@+-- Module : Network.AWS.SQS+-- 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)++-- | Amazon Simple Queue Service (SQS) is a fast, reliable, scalable, fully+-- managed message queuing service. SQS makes it simple and cost-effective to+-- decouple the components of a cloud application. You can use SQS to transmit+-- any volume of data, at any level of throughput, without losing messages or+-- requiring other services to be always available. With SQS, you can offload+-- the administrative burden of operating and scaling a highly available+-- messaging cluster, while paying a low price for only what you use.+module Network.AWS.SQS+ ( module Network.AWS.SQS.AddPermission+ , module Network.AWS.SQS.ChangeMessageVisibility+ , module Network.AWS.SQS.ChangeMessageVisibilityBatch+ , module Network.AWS.SQS.CreateQueue+ , module Network.AWS.SQS.DeleteMessage+ , module Network.AWS.SQS.DeleteMessageBatch+ , module Network.AWS.SQS.DeleteQueue+ , module Network.AWS.SQS.GetQueueAttributes+ , module Network.AWS.SQS.GetQueueUrl+ , module Network.AWS.SQS.ListDeadLetterSourceQueues+ , module Network.AWS.SQS.ListQueues+ , module Network.AWS.SQS.ReceiveMessage+ , module Network.AWS.SQS.RemovePermission+ , module Network.AWS.SQS.SendMessage+ , module Network.AWS.SQS.SendMessageBatch+ , module Network.AWS.SQS.SetQueueAttributes+ , module Network.AWS.SQS.Types+ ) where++import Network.AWS.SQS.AddPermission+import Network.AWS.SQS.ChangeMessageVisibility+import Network.AWS.SQS.ChangeMessageVisibilityBatch+import Network.AWS.SQS.CreateQueue+import Network.AWS.SQS.DeleteMessage+import Network.AWS.SQS.DeleteMessageBatch+import Network.AWS.SQS.DeleteQueue+import Network.AWS.SQS.GetQueueAttributes+import Network.AWS.SQS.GetQueueUrl+import Network.AWS.SQS.ListDeadLetterSourceQueues+import Network.AWS.SQS.ListQueues+import Network.AWS.SQS.ReceiveMessage+import Network.AWS.SQS.RemovePermission+import Network.AWS.SQS.SendMessage+import Network.AWS.SQS.SendMessageBatch+import Network.AWS.SQS.SetQueueAttributes+import Network.AWS.SQS.Types
+ gen/Network/AWS/SQS/AddPermission.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.SQS.AddPermission+-- 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)++-- | Adds a permission to a queue for a specific principal. This allows for+-- sharing access to the queue. When you create a queue, you have full control+-- access rights for the queue. Only you (as owner of the queue) can grant or+-- deny permissions to the queue. For more information about these+-- permissions, see Shared Queues in the Amazon SQS Developer Guide.+-- &Attribute.1=this &Attribute.2=that.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_AddPermission.html>+module Network.AWS.SQS.AddPermission+ (+ -- * Request+ AddPermission+ -- ** Request constructor+ , addPermission+ -- ** Request lenses+ , apAWSAccountIds+ , apActions+ , apLabel+ , apQueueUrl++ -- * Response+ , AddPermissionResponse+ -- ** Response constructor+ , addPermissionResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++data AddPermission = AddPermission+ { _apAWSAccountIds :: List "AWSAccountId" Text+ , _apActions :: List "ActionName" Text+ , _apLabel :: Text+ , _apQueueUrl :: Text+ } deriving (Eq, Ord, Show)++-- | 'AddPermission' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'apAWSAccountIds' @::@ ['Text']+--+-- * 'apActions' @::@ ['Text']+--+-- * 'apLabel' @::@ 'Text'+--+-- * 'apQueueUrl' @::@ 'Text'+--+addPermission :: Text -- ^ 'apQueueUrl'+ -> Text -- ^ 'apLabel'+ -> [Text] -- ^ 'apAWSAccountIds'+ -> [Text] -- ^ 'apActions'+ -> AddPermission+addPermission p1 p2 p3 p4 = AddPermission+ { _apQueueUrl = p1+ , _apLabel = p2+ , _apAWSAccountIds = withIso _List (const id) p3+ , _apActions = withIso _List (const id) p4+ }++-- | The AWS account number of the principal who will be given permission. The+-- principal must have an AWS account, but does not need to be signed up for+-- Amazon SQS. For information about locating the AWS account+-- identification, see Your AWS Identifiers in the Amazon SQS Developer+-- Guide.+apAWSAccountIds :: Lens' AddPermission [Text]+apAWSAccountIds = lens _apAWSAccountIds (\s a -> s { _apAWSAccountIds = a }) . _List++-- | The action the client wants to allow for the specified principal. The+-- following are valid values: * | SendMessage | ReceiveMessage |+-- DeleteMessage | ChangeMessageVisibility | GetQueueAttributes |+-- GetQueueUrl. For more information about these actions, see Understanding+-- Permissions in the Amazon SQS Developer Guide. Specifying SendMessage,+-- DeleteMessage, or ChangeMessageVisibility for the ActionName.n also+-- grants permissions for the corresponding batch versions of those actions:+-- SendMessageBatch, DeleteMessageBatch, and ChangeMessageVisibilityBatch.+apActions :: Lens' AddPermission [Text]+apActions = lens _apActions (\s a -> s { _apActions = a }) . _List++-- | The unique identification of the permission you're setting (e.g.,+-- AliceSendMessage). Constraints: Maximum 80 characters; alphanumeric+-- characters, hyphens (-), and underscores (_) are allowed.+apLabel :: Lens' AddPermission Text+apLabel = lens _apLabel (\s a -> s { _apLabel = a })++-- | The URL of the Amazon SQS queue to take action on.+apQueueUrl :: Lens' AddPermission Text+apQueueUrl = lens _apQueueUrl (\s a -> s { _apQueueUrl = a })++data AddPermissionResponse = AddPermissionResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'AddPermissionResponse' constructor.+addPermissionResponse :: AddPermissionResponse+addPermissionResponse = AddPermissionResponse++instance ToPath AddPermission where+ toPath = const "/"++instance ToQuery AddPermission where+ toQuery AddPermission{..} = mconcat+ [ toQuery _apAWSAccountIds+ , toQuery _apActions+ , "Label" =? _apLabel+ , "QueueUrl" =? _apQueueUrl+ ]++instance ToHeaders AddPermission++instance AWSRequest AddPermission where+ type Sv AddPermission = SQS+ type Rs AddPermission = AddPermissionResponse++ request = post "AddPermission"+ response = nullResponse AddPermissionResponse
+ gen/Network/AWS/SQS/ChangeMessageVisibility.hs view
@@ -0,0 +1,133 @@+{-# 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.SQS.ChangeMessageVisibility+-- 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)++-- | Changes the visibility timeout of a specified message in a queue to a new+-- value. The maximum allowed timeout value you can set the value to is 12+-- hours. This means you can't extend the timeout of a message in an existing+-- queue to more than a total visibility timeout of 12 hours. (For more+-- information visibility timeout, see Visibility Timeout in the Amazon SQS+-- Developer Guide.) For example, let's say you have a message and its default+-- message visibility timeout is 30 minutes. You could call+-- ChangeMessageVisiblity with a value of two hours and the effective timeout+-- would be two hours and 30 minutes. When that time comes near you could+-- again extend the time out by calling ChangeMessageVisiblity, but this time+-- the maximum allowed timeout would be 9 hours and 30 minutes. If you attempt+-- to set the VisibilityTimeout to an amount more than the maximum time left,+-- Amazon SQS returns an error. It will not automatically recalculate and+-- increase the timeout to the maximum time remaining. Unlike with a queue,+-- when you change the visibility timeout for a specific message, that timeout+-- value is applied immediately but is not saved in memory for that message.+-- If you don't delete a message after it is received, the visibility timeout+-- for the message the next time it is received reverts to the original+-- timeout value, not the value you set with the ChangeMessageVisibility+-- action.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ChangeMessageVisibility.html>+module Network.AWS.SQS.ChangeMessageVisibility+ (+ -- * Request+ ChangeMessageVisibility+ -- ** Request constructor+ , changeMessageVisibility+ -- ** Request lenses+ , cmvQueueUrl+ , cmvReceiptHandle+ , cmvVisibilityTimeout++ -- * Response+ , ChangeMessageVisibilityResponse+ -- ** Response constructor+ , changeMessageVisibilityResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++data ChangeMessageVisibility = ChangeMessageVisibility+ { _cmvQueueUrl :: Text+ , _cmvReceiptHandle :: Text+ , _cmvVisibilityTimeout :: Int+ } deriving (Eq, Ord, Show)++-- | 'ChangeMessageVisibility' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cmvQueueUrl' @::@ 'Text'+--+-- * 'cmvReceiptHandle' @::@ 'Text'+--+-- * 'cmvVisibilityTimeout' @::@ 'Int'+--+changeMessageVisibility :: Text -- ^ 'cmvQueueUrl'+ -> Text -- ^ 'cmvReceiptHandle'+ -> Int -- ^ 'cmvVisibilityTimeout'+ -> ChangeMessageVisibility+changeMessageVisibility p1 p2 p3 = ChangeMessageVisibility+ { _cmvQueueUrl = p1+ , _cmvReceiptHandle = p2+ , _cmvVisibilityTimeout = p3+ }++-- | The URL of the Amazon SQS queue to take action on.+cmvQueueUrl :: Lens' ChangeMessageVisibility Text+cmvQueueUrl = lens _cmvQueueUrl (\s a -> s { _cmvQueueUrl = a })++-- | The receipt handle associated with the message whose visibility timeout+-- should be changed. This parameter is returned by the ReceiveMessage+-- action.+cmvReceiptHandle :: Lens' ChangeMessageVisibility Text+cmvReceiptHandle = lens _cmvReceiptHandle (\s a -> s { _cmvReceiptHandle = a })++-- | The new value (in seconds - from 0 to 43200 - maximum 12 hours) for the+-- message's visibility timeout.+cmvVisibilityTimeout :: Lens' ChangeMessageVisibility Int+cmvVisibilityTimeout =+ lens _cmvVisibilityTimeout (\s a -> s { _cmvVisibilityTimeout = a })++data ChangeMessageVisibilityResponse = ChangeMessageVisibilityResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'ChangeMessageVisibilityResponse' constructor.+changeMessageVisibilityResponse :: ChangeMessageVisibilityResponse+changeMessageVisibilityResponse = ChangeMessageVisibilityResponse++instance ToPath ChangeMessageVisibility where+ toPath = const "/"++instance ToQuery ChangeMessageVisibility where+ toQuery ChangeMessageVisibility{..} = mconcat+ [ "QueueUrl" =? _cmvQueueUrl+ , "ReceiptHandle" =? _cmvReceiptHandle+ , "VisibilityTimeout" =? _cmvVisibilityTimeout+ ]++instance ToHeaders ChangeMessageVisibility++instance AWSRequest ChangeMessageVisibility where+ type Sv ChangeMessageVisibility = SQS+ type Rs ChangeMessageVisibility = ChangeMessageVisibilityResponse++ request = post "ChangeMessageVisibility"+ response = nullResponse ChangeMessageVisibilityResponse
+ gen/Network/AWS/SQS/ChangeMessageVisibilityBatch.hs view
@@ -0,0 +1,137 @@+{-# 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.SQS.ChangeMessageVisibilityBatch+-- 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)++-- | Changes the visibility timeout of multiple messages. This is a batch+-- version of ChangeMessageVisibility. The result of the action on each+-- message is reported individually in the response. You can send up to 10+-- ChangeMessageVisibility requests with each ChangeMessageVisibilityBatch+-- action. Because the batch request can result in a combination of successful+-- and unsuccessful actions, you should check for batch errors even when the+-- call returns an HTTP status code of 200. &Attribute.1=this+-- &Attribute.2=that.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ChangeMessageVisibilityBatch.html>+module Network.AWS.SQS.ChangeMessageVisibilityBatch+ (+ -- * Request+ ChangeMessageVisibilityBatch+ -- ** Request constructor+ , changeMessageVisibilityBatch+ -- ** Request lenses+ , cmvbEntries+ , cmvbQueueUrl++ -- * Response+ , ChangeMessageVisibilityBatchResponse+ -- ** Response constructor+ , changeMessageVisibilityBatchResponse+ -- ** Response lenses+ , cmvbrFailed+ , cmvbrSuccessful+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++data ChangeMessageVisibilityBatch = ChangeMessageVisibilityBatch+ { _cmvbEntries :: List "ChangeMessageVisibilityBatchRequestEntry" ChangeMessageVisibilityBatchRequestEntry+ , _cmvbQueueUrl :: Text+ } deriving (Eq, Show)++-- | 'ChangeMessageVisibilityBatch' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cmvbEntries' @::@ ['ChangeMessageVisibilityBatchRequestEntry']+--+-- * 'cmvbQueueUrl' @::@ 'Text'+--+changeMessageVisibilityBatch :: Text -- ^ 'cmvbQueueUrl'+ -> [ChangeMessageVisibilityBatchRequestEntry] -- ^ 'cmvbEntries'+ -> ChangeMessageVisibilityBatch+changeMessageVisibilityBatch p1 p2 = ChangeMessageVisibilityBatch+ { _cmvbQueueUrl = p1+ , _cmvbEntries = withIso _List (const id) p2+ }++-- | A list of receipt handles of the messages for which the visibility+-- timeout must be changed.+cmvbEntries :: Lens' ChangeMessageVisibilityBatch [ChangeMessageVisibilityBatchRequestEntry]+cmvbEntries = lens _cmvbEntries (\s a -> s { _cmvbEntries = a }) . _List++-- | The URL of the Amazon SQS queue to take action on.+cmvbQueueUrl :: Lens' ChangeMessageVisibilityBatch Text+cmvbQueueUrl = lens _cmvbQueueUrl (\s a -> s { _cmvbQueueUrl = a })++data ChangeMessageVisibilityBatchResponse = ChangeMessageVisibilityBatchResponse+ { _cmvbrFailed :: List "BatchResultErrorEntry" BatchResultErrorEntry+ , _cmvbrSuccessful :: List "ChangeMessageVisibilityBatchResultEntry" ChangeMessageVisibilityBatchResultEntry+ } deriving (Eq, Show)++-- | 'ChangeMessageVisibilityBatchResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cmvbrFailed' @::@ ['BatchResultErrorEntry']+--+-- * 'cmvbrSuccessful' @::@ ['ChangeMessageVisibilityBatchResultEntry']+--+changeMessageVisibilityBatchResponse :: [ChangeMessageVisibilityBatchResultEntry] -- ^ 'cmvbrSuccessful'+ -> [BatchResultErrorEntry] -- ^ 'cmvbrFailed'+ -> ChangeMessageVisibilityBatchResponse+changeMessageVisibilityBatchResponse p1 p2 = ChangeMessageVisibilityBatchResponse+ { _cmvbrSuccessful = withIso _List (const id) p1+ , _cmvbrFailed = withIso _List (const id) p2+ }++-- | A list of BatchResultErrorEntry items.+cmvbrFailed :: Lens' ChangeMessageVisibilityBatchResponse [BatchResultErrorEntry]+cmvbrFailed = lens _cmvbrFailed (\s a -> s { _cmvbrFailed = a }) . _List++-- | A list of ChangeMessageVisibilityBatchResultEntry items.+cmvbrSuccessful :: Lens' ChangeMessageVisibilityBatchResponse [ChangeMessageVisibilityBatchResultEntry]+cmvbrSuccessful = lens _cmvbrSuccessful (\s a -> s { _cmvbrSuccessful = a }) . _List++instance ToPath ChangeMessageVisibilityBatch where+ toPath = const "/"++instance ToQuery ChangeMessageVisibilityBatch where+ toQuery ChangeMessageVisibilityBatch{..} = mconcat+ [ toQuery _cmvbEntries+ , "QueueUrl" =? _cmvbQueueUrl+ ]++instance ToHeaders ChangeMessageVisibilityBatch++instance AWSRequest ChangeMessageVisibilityBatch where+ type Sv ChangeMessageVisibilityBatch = SQS+ type Rs ChangeMessageVisibilityBatch = ChangeMessageVisibilityBatchResponse++ request = post "ChangeMessageVisibilityBatch"+ response = xmlResponse++instance FromXML ChangeMessageVisibilityBatchResponse where+ parseXML = withElement "ChangeMessageVisibilityBatchResult" $ \x -> ChangeMessageVisibilityBatchResponse+ <$> parseXML x+ <*> parseXML x
+ gen/Network/AWS/SQS/CreateQueue.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.SQS.CreateQueue+-- 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)++-- | Creates a new queue, or returns the URL of an existing one. When you+-- request CreateQueue, you provide a name for the queue. To successfully+-- create a new queue, you must provide a name that is unique within the scope+-- of your own queues. You may pass one or more attributes in the request. If+-- you do not provide a value for any attribute, the queue will have the+-- default value for that attribute. Permitted attributes are the same that+-- can be set using SetQueueAttributes. If you provide the name of an existing+-- queue, along with the exact names and values of all the queue's attributes,+-- CreateQueue returns the queue URL for the existing queue. If the queue+-- name, attribute names, or attribute values do not match an existing queue,+-- CreateQueue returns an error. &Attribute.1=this &Attribute.2=that.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html>+module Network.AWS.SQS.CreateQueue+ (+ -- * Request+ CreateQueue+ -- ** Request constructor+ , createQueue+ -- ** Request lenses+ , cqAttributes+ , cqQueueName++ -- * Response+ , CreateQueueResponse+ -- ** Response constructor+ , createQueueResponse+ -- ** Response lenses+ , cqrQueueUrl+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++data CreateQueue = CreateQueue+ { _cqAttributes :: EMap "Attribute" "Name" "Value" Text Text+ , _cqQueueName :: Text+ } deriving (Eq, Show)++-- | 'CreateQueue' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cqAttributes' @::@ 'HashMap' 'Text' 'Text'+--+-- * 'cqQueueName' @::@ 'Text'+--+createQueue :: Text -- ^ 'cqQueueName'+ -> HashMap Text Text -- ^ 'cqAttributes'+ -> CreateQueue+createQueue p1 p2 = CreateQueue+ { _cqQueueName = p1+ , _cqAttributes = withIso _EMap (const id) p2+ }++-- | A map of attributes with their corresponding values. The following lists+-- the names, descriptions, and values of the special request parameters the+-- CreateQueue action uses: DelaySeconds - The time in seconds that the+-- delivery of all messages in the queue will be delayed. An integer from 0+-- to 900 (15 minutes). The default for this attribute is 0 (zero).+-- MaximumMessageSize - The limit of how many bytes a message can contain+-- before Amazon SQS rejects it. An integer from 1024 bytes (1 KiB) up to+-- 262144 bytes (256 KiB). The default for this attribute is 262144 (256+-- KiB). MessageRetentionPeriod - The number of seconds Amazon SQS retains a+-- message. Integer representing seconds, from 60 (1 minute) to 1209600 (14+-- days). The default for this attribute is 345600 (4 days). Policy - The+-- queue's policy. A valid form-url-encoded policy. For more information+-- about policy structure, see Basic Policy Structure in the Amazon SQS+-- Developer Guide. For more information about form-url-encoding, see+-- http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1.+-- ReceiveMessageWaitTimeSeconds - The time for which a ReceiveMessage call+-- will wait for a message to arrive. An integer from 0 to 20 (seconds). The+-- default for this attribute is 0. VisibilityTimeout - The visibility+-- timeout for the queue. An integer from 0 to 43200 (12 hours). The default+-- for this attribute is 30. For more information about visibility timeout,+-- see Visibility Timeout in the Amazon SQS Developer Guide.+cqAttributes :: Lens' CreateQueue (HashMap Text Text)+cqAttributes = lens _cqAttributes (\s a -> s { _cqAttributes = a }) . _EMap++-- | The name for the queue to be created.+cqQueueName :: Lens' CreateQueue Text+cqQueueName = lens _cqQueueName (\s a -> s { _cqQueueName = a })++newtype CreateQueueResponse = CreateQueueResponse+ { _cqrQueueUrl :: Maybe Text+ } deriving (Eq, Ord, Show, Monoid)++-- | 'CreateQueueResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cqrQueueUrl' @::@ 'Maybe' 'Text'+--+createQueueResponse :: CreateQueueResponse+createQueueResponse = CreateQueueResponse+ { _cqrQueueUrl = Nothing+ }++-- | The URL for the created Amazon SQS queue.+cqrQueueUrl :: Lens' CreateQueueResponse (Maybe Text)+cqrQueueUrl = lens _cqrQueueUrl (\s a -> s { _cqrQueueUrl = a })++instance ToPath CreateQueue where+ toPath = const "/"++instance ToQuery CreateQueue where+ toQuery CreateQueue{..} = mconcat+ [ toQuery _cqAttributes+ , "QueueName" =? _cqQueueName+ ]++instance ToHeaders CreateQueue++instance AWSRequest CreateQueue where+ type Sv CreateQueue = SQS+ type Rs CreateQueue = CreateQueueResponse++ request = post "CreateQueue"+ response = xmlResponse++instance FromXML CreateQueueResponse where+ parseXML = withElement "CreateQueueResult" $ \x -> CreateQueueResponse+ <$> x .@? "QueueUrl"
+ gen/Network/AWS/SQS/DeleteMessage.hs view
@@ -0,0 +1,110 @@+{-# 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.SQS.DeleteMessage+-- 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)++-- | Deletes the specified message from the specified queue. You specify the+-- message by using the message's receipt handle and not the message ID you+-- received when you sent the message. Even if the message is locked by+-- another reader due to the visibility timeout setting, it is still deleted+-- from the queue. If you leave a message in the queue for longer than the+-- queue's configured retention period, Amazon SQS automatically deletes it.+-- It is possible you will receive a message even after you have deleted it.+-- This might happen on rare occasions if one of the servers storing a copy of+-- the message is unavailable when you request to delete the message. The copy+-- remains on the server and might be returned to you again on a subsequent+-- receive request. You should create your system to be idempotent so that+-- receiving a particular message more than once is not a problem.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteMessage.html>+module Network.AWS.SQS.DeleteMessage+ (+ -- * Request+ DeleteMessage+ -- ** Request constructor+ , deleteMessage+ -- ** Request lenses+ , dmQueueUrl+ , dmReceiptHandle++ -- * Response+ , DeleteMessageResponse+ -- ** Response constructor+ , deleteMessageResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++data DeleteMessage = DeleteMessage+ { _dmQueueUrl :: Text+ , _dmReceiptHandle :: Text+ } deriving (Eq, Ord, Show)++-- | 'DeleteMessage' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dmQueueUrl' @::@ 'Text'+--+-- * 'dmReceiptHandle' @::@ 'Text'+--+deleteMessage :: Text -- ^ 'dmQueueUrl'+ -> Text -- ^ 'dmReceiptHandle'+ -> DeleteMessage+deleteMessage p1 p2 = DeleteMessage+ { _dmQueueUrl = p1+ , _dmReceiptHandle = p2+ }++-- | The URL of the Amazon SQS queue to take action on.+dmQueueUrl :: Lens' DeleteMessage Text+dmQueueUrl = lens _dmQueueUrl (\s a -> s { _dmQueueUrl = a })++-- | The receipt handle associated with the message to delete.+dmReceiptHandle :: Lens' DeleteMessage Text+dmReceiptHandle = lens _dmReceiptHandle (\s a -> s { _dmReceiptHandle = a })++data DeleteMessageResponse = DeleteMessageResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'DeleteMessageResponse' constructor.+deleteMessageResponse :: DeleteMessageResponse+deleteMessageResponse = DeleteMessageResponse++instance ToPath DeleteMessage where+ toPath = const "/"++instance ToQuery DeleteMessage where+ toQuery DeleteMessage{..} = mconcat+ [ "QueueUrl" =? _dmQueueUrl+ , "ReceiptHandle" =? _dmReceiptHandle+ ]++instance ToHeaders DeleteMessage++instance AWSRequest DeleteMessage where+ type Sv DeleteMessage = SQS+ type Rs DeleteMessage = DeleteMessageResponse++ request = post "DeleteMessage"+ response = nullResponse DeleteMessageResponse
+ gen/Network/AWS/SQS/DeleteMessageBatch.hs view
@@ -0,0 +1,134 @@+{-# 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.SQS.DeleteMessageBatch+-- 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)++-- | Deletes multiple messages. This is a batch version of DeleteMessage. The+-- result of the delete action on each message is reported individually in the+-- response. Because the batch request can result in a combination of+-- successful and unsuccessful actions, you should check for batch errors even+-- when the call returns an HTTP status code of 200. &Attribute.1=this+-- &Attribute.2=that.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteMessageBatch.html>+module Network.AWS.SQS.DeleteMessageBatch+ (+ -- * Request+ DeleteMessageBatch+ -- ** Request constructor+ , deleteMessageBatch+ -- ** Request lenses+ , dmbEntries+ , dmbQueueUrl++ -- * Response+ , DeleteMessageBatchResponse+ -- ** Response constructor+ , deleteMessageBatchResponse+ -- ** Response lenses+ , dmbrFailed+ , dmbrSuccessful+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++data DeleteMessageBatch = DeleteMessageBatch+ { _dmbEntries :: List "DeleteMessageBatchRequestEntry" DeleteMessageBatchRequestEntry+ , _dmbQueueUrl :: Text+ } deriving (Eq, Show)++-- | 'DeleteMessageBatch' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dmbEntries' @::@ ['DeleteMessageBatchRequestEntry']+--+-- * 'dmbQueueUrl' @::@ 'Text'+--+deleteMessageBatch :: Text -- ^ 'dmbQueueUrl'+ -> [DeleteMessageBatchRequestEntry] -- ^ 'dmbEntries'+ -> DeleteMessageBatch+deleteMessageBatch p1 p2 = DeleteMessageBatch+ { _dmbQueueUrl = p1+ , _dmbEntries = withIso _List (const id) p2+ }++-- | A list of receipt handles for the messages to be deleted.+dmbEntries :: Lens' DeleteMessageBatch [DeleteMessageBatchRequestEntry]+dmbEntries = lens _dmbEntries (\s a -> s { _dmbEntries = a }) . _List++-- | The URL of the Amazon SQS queue to take action on.+dmbQueueUrl :: Lens' DeleteMessageBatch Text+dmbQueueUrl = lens _dmbQueueUrl (\s a -> s { _dmbQueueUrl = a })++data DeleteMessageBatchResponse = DeleteMessageBatchResponse+ { _dmbrFailed :: List "BatchResultErrorEntry" BatchResultErrorEntry+ , _dmbrSuccessful :: List "DeleteMessageBatchResultEntry" DeleteMessageBatchResultEntry+ } deriving (Eq, Show)++-- | 'DeleteMessageBatchResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dmbrFailed' @::@ ['BatchResultErrorEntry']+--+-- * 'dmbrSuccessful' @::@ ['DeleteMessageBatchResultEntry']+--+deleteMessageBatchResponse :: [DeleteMessageBatchResultEntry] -- ^ 'dmbrSuccessful'+ -> [BatchResultErrorEntry] -- ^ 'dmbrFailed'+ -> DeleteMessageBatchResponse+deleteMessageBatchResponse p1 p2 = DeleteMessageBatchResponse+ { _dmbrSuccessful = withIso _List (const id) p1+ , _dmbrFailed = withIso _List (const id) p2+ }++-- | A list of BatchResultErrorEntry items.+dmbrFailed :: Lens' DeleteMessageBatchResponse [BatchResultErrorEntry]+dmbrFailed = lens _dmbrFailed (\s a -> s { _dmbrFailed = a }) . _List++-- | A list of DeleteMessageBatchResultEntry items.+dmbrSuccessful :: Lens' DeleteMessageBatchResponse [DeleteMessageBatchResultEntry]+dmbrSuccessful = lens _dmbrSuccessful (\s a -> s { _dmbrSuccessful = a }) . _List++instance ToPath DeleteMessageBatch where+ toPath = const "/"++instance ToQuery DeleteMessageBatch where+ toQuery DeleteMessageBatch{..} = mconcat+ [ toQuery _dmbEntries+ , "QueueUrl" =? _dmbQueueUrl+ ]++instance ToHeaders DeleteMessageBatch++instance AWSRequest DeleteMessageBatch where+ type Sv DeleteMessageBatch = SQS+ type Rs DeleteMessageBatch = DeleteMessageBatchResponse++ request = post "DeleteMessageBatch"+ response = xmlResponse++instance FromXML DeleteMessageBatchResponse where+ parseXML = withElement "DeleteMessageBatchResult" $ \x -> DeleteMessageBatchResponse+ <$> parseXML x+ <*> parseXML x
+ gen/Network/AWS/SQS/DeleteQueue.hs view
@@ -0,0 +1,99 @@+{-# 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.SQS.DeleteQueue+-- 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)++-- | Deletes the queue specified by the queue URL, regardless of whether the+-- queue is empty. If the specified queue does not exist, Amazon SQS returns a+-- successful response. Use DeleteQueue with care; once you delete your queue,+-- any messages in the queue are no longer available. When you delete a queue,+-- the deletion process takes up to 60 seconds. Requests you send involving+-- that queue during the 60 seconds might succeed. For example, a SendMessage+-- request might succeed, but after the 60 seconds, the queue and that message+-- you sent no longer exist. Also, when you delete a queue, you must wait at+-- least 60 seconds before creating a queue with the same name. We reserve the+-- right to delete queues that have had no activity for more than 30 days. For+-- more information, see How Amazon SQS Queues Work in the Amazon SQS+-- Developer Guide.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteQueue.html>+module Network.AWS.SQS.DeleteQueue+ (+ -- * Request+ DeleteQueue+ -- ** Request constructor+ , deleteQueue+ -- ** Request lenses+ , dqQueueUrl++ -- * Response+ , DeleteQueueResponse+ -- ** Response constructor+ , deleteQueueResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++newtype DeleteQueue = DeleteQueue+ { _dqQueueUrl :: Text+ } deriving (Eq, Ord, Show, Monoid, IsString)++-- | 'DeleteQueue' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dqQueueUrl' @::@ 'Text'+--+deleteQueue :: Text -- ^ 'dqQueueUrl'+ -> DeleteQueue+deleteQueue p1 = DeleteQueue+ { _dqQueueUrl = p1+ }++-- | The URL of the Amazon SQS queue to take action on.+dqQueueUrl :: Lens' DeleteQueue Text+dqQueueUrl = lens _dqQueueUrl (\s a -> s { _dqQueueUrl = a })++data DeleteQueueResponse = DeleteQueueResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'DeleteQueueResponse' constructor.+deleteQueueResponse :: DeleteQueueResponse+deleteQueueResponse = DeleteQueueResponse++instance ToPath DeleteQueue where+ toPath = const "/"++instance ToQuery DeleteQueue where+ toQuery DeleteQueue{..} = mconcat+ [ "QueueUrl" =? _dqQueueUrl+ ]++instance ToHeaders DeleteQueue++instance AWSRequest DeleteQueue where+ type Sv DeleteQueue = SQS+ type Rs DeleteQueue = DeleteQueueResponse++ request = post "DeleteQueue"+ response = nullResponse DeleteQueueResponse
+ gen/Network/AWS/SQS/GetQueueAttributes.hs view
@@ -0,0 +1,144 @@+{-# 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.SQS.GetQueueAttributes+-- 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)++-- | Gets attributes for the specified queue. The following attributes are+-- supported: All - returns all values. ApproximateNumberOfMessages - returns+-- the approximate number of visible messages in a queue. For more+-- information, see Resources Required to Process Messages in the Amazon SQS+-- Developer Guide. ApproximateNumberOfMessagesNotVisible - returns the+-- approximate number of messages that are not timed-out and not deleted. For+-- more information, see Resources Required to Process Messages in the Amazon+-- SQS Developer Guide. VisibilityTimeout - returns the visibility timeout for+-- the queue. For more information about visibility timeout, see Visibility+-- Timeout in the Amazon SQS Developer Guide. CreatedTimestamp - returns the+-- time when the queue was created (epoch time in seconds).+-- LastModifiedTimestamp - returns the time when the queue was last changed+-- (epoch time in seconds). Policy - returns the queue's policy.+-- MaximumMessageSize - returns the limit of how many bytes a message can+-- contain before Amazon SQS rejects it. MessageRetentionPeriod - returns the+-- number of seconds Amazon SQS retains a message. QueueArn - returns the+-- queue's Amazon resource name (ARN). ApproximateNumberOfMessagesDelayed -+-- returns the approximate number of messages that are pending to be added to+-- the queue. DelaySeconds - returns the default delay on the queue in+-- seconds. ReceiveMessageWaitTimeSeconds - returns the time for which a+-- ReceiveMessage call will wait for a message to arrive. RedrivePolicy -+-- returns the parameters for dead letter queue functionality of the source+-- queue. For more information about RedrivePolicy and dead letter queues, see+-- Using Amazon SQS Dead Letter Queues in the Amazon SQS Developer Guide.+-- &Attribute.1=this &Attribute.2=that.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_GetQueueAttributes.html>+module Network.AWS.SQS.GetQueueAttributes+ (+ -- * Request+ GetQueueAttributes+ -- ** Request constructor+ , getQueueAttributes+ -- ** Request lenses+ , gqaAttributeNames+ , gqaQueueUrl++ -- * Response+ , GetQueueAttributesResponse+ -- ** Response constructor+ , getQueueAttributesResponse+ -- ** Response lenses+ , gqarAttributes+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++data GetQueueAttributes = GetQueueAttributes+ { _gqaAttributeNames :: List "AttributeName" Text+ , _gqaQueueUrl :: Text+ } deriving (Eq, Ord, Show)++-- | 'GetQueueAttributes' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gqaAttributeNames' @::@ ['Text']+--+-- * 'gqaQueueUrl' @::@ 'Text'+--+getQueueAttributes :: Text -- ^ 'gqaQueueUrl'+ -> [Text] -- ^ 'gqaAttributeNames'+ -> GetQueueAttributes+getQueueAttributes p1 p2 = GetQueueAttributes+ { _gqaQueueUrl = p1+ , _gqaAttributeNames = withIso _List (const id) p2+ }++-- | A list of attributes to retrieve information for.+gqaAttributeNames :: Lens' GetQueueAttributes [Text]+gqaAttributeNames =+ lens _gqaAttributeNames (\s a -> s { _gqaAttributeNames = a })+ . _List++-- | The URL of the Amazon SQS queue to take action on.+gqaQueueUrl :: Lens' GetQueueAttributes Text+gqaQueueUrl = lens _gqaQueueUrl (\s a -> s { _gqaQueueUrl = a })++newtype GetQueueAttributesResponse = GetQueueAttributesResponse+ { _gqarAttributes :: EMap "Attribute" "Name" "Value" Text Text+ } deriving (Eq, Show, Monoid, Semigroup)++-- | 'GetQueueAttributesResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gqarAttributes' @::@ 'HashMap' 'Text' 'Text'+--+getQueueAttributesResponse :: HashMap Text Text -- ^ 'gqarAttributes'+ -> GetQueueAttributesResponse+getQueueAttributesResponse p1 = GetQueueAttributesResponse+ { _gqarAttributes = withIso _EMap (const id) p1+ }++-- | A map of attributes to the respective values.+gqarAttributes :: Lens' GetQueueAttributesResponse (HashMap Text Text)+gqarAttributes = lens _gqarAttributes (\s a -> s { _gqarAttributes = a }) . _EMap++instance ToPath GetQueueAttributes where+ toPath = const "/"++instance ToQuery GetQueueAttributes where+ toQuery GetQueueAttributes{..} = mconcat+ [ toQuery _gqaAttributeNames+ , "QueueUrl" =? _gqaQueueUrl+ ]++instance ToHeaders GetQueueAttributes++instance AWSRequest GetQueueAttributes where+ type Sv GetQueueAttributes = SQS+ type Rs GetQueueAttributes = GetQueueAttributesResponse++ request = post "GetQueueAttributes"+ response = xmlResponse++instance FromXML GetQueueAttributesResponse where+ parseXML = withElement "GetQueueAttributesResult" $ \x -> GetQueueAttributesResponse+ <$> parseXML x
+ gen/Network/AWS/SQS/GetQueueUrl.hs view
@@ -0,0 +1,125 @@+{-# 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.SQS.GetQueueUrl+-- 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)++-- | Returns the URL of an existing queue. This action provides a simple way to+-- retrieve the URL of an Amazon SQS queue. To access a queue that belongs to+-- another AWS account, use the QueueOwnerAWSAccountId parameter to specify+-- the account ID of the queue's owner. The queue's owner must grant you+-- permission to access the queue. For more information about shared queue+-- access, see AddPermission or go to Shared Queues in the Amazon SQS+-- Developer Guide.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_GetQueueUrl.html>+module Network.AWS.SQS.GetQueueUrl+ (+ -- * Request+ GetQueueUrl+ -- ** Request constructor+ , getQueueUrl+ -- ** Request lenses+ , gquQueueName+ , gquQueueOwnerAWSAccountId++ -- * Response+ , GetQueueUrlResponse+ -- ** Response constructor+ , getQueueUrlResponse+ -- ** Response lenses+ , gqurQueueUrl+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++data GetQueueUrl = GetQueueUrl+ { _gquQueueName :: Text+ , _gquQueueOwnerAWSAccountId :: Maybe Text+ } deriving (Eq, Ord, Show)++-- | 'GetQueueUrl' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gquQueueName' @::@ 'Text'+--+-- * 'gquQueueOwnerAWSAccountId' @::@ 'Maybe' 'Text'+--+getQueueUrl :: Text -- ^ 'gquQueueName'+ -> GetQueueUrl+getQueueUrl p1 = GetQueueUrl+ { _gquQueueName = p1+ , _gquQueueOwnerAWSAccountId = Nothing+ }++-- | The name of the queue whose URL must be fetched. Maximum 80 characters;+-- alphanumeric characters, hyphens (-), and underscores (_) are allowed.+gquQueueName :: Lens' GetQueueUrl Text+gquQueueName = lens _gquQueueName (\s a -> s { _gquQueueName = a })++-- | The AWS account ID of the account that created the queue.+gquQueueOwnerAWSAccountId :: Lens' GetQueueUrl (Maybe Text)+gquQueueOwnerAWSAccountId =+ lens _gquQueueOwnerAWSAccountId+ (\s a -> s { _gquQueueOwnerAWSAccountId = a })++newtype GetQueueUrlResponse = GetQueueUrlResponse+ { _gqurQueueUrl :: Maybe Text+ } deriving (Eq, Ord, Show, Monoid)++-- | 'GetQueueUrlResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gqurQueueUrl' @::@ 'Maybe' 'Text'+--+getQueueUrlResponse :: GetQueueUrlResponse+getQueueUrlResponse = GetQueueUrlResponse+ { _gqurQueueUrl = Nothing+ }++-- | The URL for the queue.+gqurQueueUrl :: Lens' GetQueueUrlResponse (Maybe Text)+gqurQueueUrl = lens _gqurQueueUrl (\s a -> s { _gqurQueueUrl = a })++instance ToPath GetQueueUrl where+ toPath = const "/"++instance ToQuery GetQueueUrl where+ toQuery GetQueueUrl{..} = mconcat+ [ "QueueName" =? _gquQueueName+ , "QueueOwnerAWSAccountId" =? _gquQueueOwnerAWSAccountId+ ]++instance ToHeaders GetQueueUrl++instance AWSRequest GetQueueUrl where+ type Sv GetQueueUrl = SQS+ type Rs GetQueueUrl = GetQueueUrlResponse++ request = post "GetQueueUrl"+ response = xmlResponse++instance FromXML GetQueueUrlResponse where+ parseXML = withElement "GetQueueUrlResult" $ \x -> GetQueueUrlResponse+ <$> x .@? "QueueUrl"
+ gen/Network/AWS/SQS/ListDeadLetterSourceQueues.hs view
@@ -0,0 +1,110 @@+{-# 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.SQS.ListDeadLetterSourceQueues+-- 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)++-- | Returns a list of your queues that have the RedrivePolicy queue attribute+-- configured with a dead letter queue. For more information about using dead+-- letter queues, see Using Amazon SQS Dead Letter Queues.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ListDeadLetterSourceQueues.html>+module Network.AWS.SQS.ListDeadLetterSourceQueues+ (+ -- * Request+ ListDeadLetterSourceQueues+ -- ** Request constructor+ , listDeadLetterSourceQueues+ -- ** Request lenses+ , ldlsqQueueUrl++ -- * Response+ , ListDeadLetterSourceQueuesResponse+ -- ** Response constructor+ , listDeadLetterSourceQueuesResponse+ -- ** Response lenses+ , ldlsqrQueueUrls+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++newtype ListDeadLetterSourceQueues = ListDeadLetterSourceQueues+ { _ldlsqQueueUrl :: Text+ } deriving (Eq, Ord, Show, Monoid, IsString)++-- | 'ListDeadLetterSourceQueues' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ldlsqQueueUrl' @::@ 'Text'+--+listDeadLetterSourceQueues :: Text -- ^ 'ldlsqQueueUrl'+ -> ListDeadLetterSourceQueues+listDeadLetterSourceQueues p1 = ListDeadLetterSourceQueues+ { _ldlsqQueueUrl = p1+ }++-- | The queue URL of a dead letter queue.+ldlsqQueueUrl :: Lens' ListDeadLetterSourceQueues Text+ldlsqQueueUrl = lens _ldlsqQueueUrl (\s a -> s { _ldlsqQueueUrl = a })++newtype ListDeadLetterSourceQueuesResponse = ListDeadLetterSourceQueuesResponse+ { _ldlsqrQueueUrls :: List "QueueUrl" Text+ } deriving (Eq, Ord, Show, Monoid, Semigroup)++-- | 'ListDeadLetterSourceQueuesResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ldlsqrQueueUrls' @::@ ['Text']+--+listDeadLetterSourceQueuesResponse :: [Text] -- ^ 'ldlsqrQueueUrls'+ -> ListDeadLetterSourceQueuesResponse+listDeadLetterSourceQueuesResponse p1 = ListDeadLetterSourceQueuesResponse+ { _ldlsqrQueueUrls = withIso _List (const id) p1+ }++-- | A list of source queue URLs that have the RedrivePolicy queue attribute+-- configured with a dead letter queue.+ldlsqrQueueUrls :: Lens' ListDeadLetterSourceQueuesResponse [Text]+ldlsqrQueueUrls = lens _ldlsqrQueueUrls (\s a -> s { _ldlsqrQueueUrls = a }) . _List++instance ToPath ListDeadLetterSourceQueues where+ toPath = const "/"++instance ToQuery ListDeadLetterSourceQueues where+ toQuery ListDeadLetterSourceQueues{..} = mconcat+ [ "QueueUrl" =? _ldlsqQueueUrl+ ]++instance ToHeaders ListDeadLetterSourceQueues++instance AWSRequest ListDeadLetterSourceQueues where+ type Sv ListDeadLetterSourceQueues = SQS+ type Rs ListDeadLetterSourceQueues = ListDeadLetterSourceQueuesResponse++ request = post "ListDeadLetterSourceQueues"+ response = xmlResponse++instance FromXML ListDeadLetterSourceQueuesResponse where+ parseXML = withElement "ListDeadLetterSourceQueuesResult" $ \x -> ListDeadLetterSourceQueuesResponse+ <$> parseXML x
+ gen/Network/AWS/SQS/ListQueues.hs view
@@ -0,0 +1,111 @@+{-# 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.SQS.ListQueues+-- 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)++-- | Returns a list of your queues. The maximum number of queues that can be+-- returned is 1000. If you specify a value for the optional QueueNamePrefix+-- parameter, only queues with a name beginning with the specified value are+-- returned.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ListQueues.html>+module Network.AWS.SQS.ListQueues+ (+ -- * Request+ ListQueues+ -- ** Request constructor+ , listQueues+ -- ** Request lenses+ , lqQueueNamePrefix++ -- * Response+ , ListQueuesResponse+ -- ** Response constructor+ , listQueuesResponse+ -- ** Response lenses+ , lqrQueueUrls+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++newtype ListQueues = ListQueues+ { _lqQueueNamePrefix :: Maybe Text+ } deriving (Eq, Ord, Show, Monoid)++-- | 'ListQueues' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lqQueueNamePrefix' @::@ 'Maybe' 'Text'+--+listQueues :: ListQueues+listQueues = ListQueues+ { _lqQueueNamePrefix = Nothing+ }++-- | A string to use for filtering the list results. Only those queues whose+-- name begins with the specified string are returned.+lqQueueNamePrefix :: Lens' ListQueues (Maybe Text)+lqQueueNamePrefix =+ lens _lqQueueNamePrefix (\s a -> s { _lqQueueNamePrefix = a })++newtype ListQueuesResponse = ListQueuesResponse+ { _lqrQueueUrls :: List "QueueUrl" Text+ } deriving (Eq, Ord, Show, Monoid, Semigroup)++-- | 'ListQueuesResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lqrQueueUrls' @::@ ['Text']+--+listQueuesResponse :: [Text] -- ^ 'lqrQueueUrls'+ -> ListQueuesResponse+listQueuesResponse p1 = ListQueuesResponse+ { _lqrQueueUrls = withIso _List (const id) p1+ }++-- | A list of queue URLs, up to 1000 entries.+lqrQueueUrls :: Lens' ListQueuesResponse [Text]+lqrQueueUrls = lens _lqrQueueUrls (\s a -> s { _lqrQueueUrls = a }) . _List++instance ToPath ListQueues where+ toPath = const "/"++instance ToQuery ListQueues where+ toQuery ListQueues{..} = mconcat+ [ "QueueNamePrefix" =? _lqQueueNamePrefix+ ]++instance ToHeaders ListQueues++instance AWSRequest ListQueues where+ type Sv ListQueues = SQS+ type Rs ListQueues = ListQueuesResponse++ request = post "ListQueues"+ response = xmlResponse++instance FromXML ListQueuesResponse where+ parseXML = withElement "ListQueuesResult" $ \x -> ListQueuesResponse+ <$> parseXML x
+ gen/Network/AWS/SQS/ReceiveMessage.hs view
@@ -0,0 +1,206 @@+{-# 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.SQS.ReceiveMessage+-- 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)++-- | Retrieves one or more messages, with a maximum limit of 10 messages, from+-- the specified queue. Long poll support is enabled by using the+-- WaitTimeSeconds parameter. For more information, see Amazon SQS Long Poll+-- in the Amazon SQS Developer Guide. Short poll is the default behavior where+-- a weighted random set of machines is sampled on a ReceiveMessage call. This+-- means only the messages on the sampled machines are returned. If the number+-- of messages in the queue is small (less than 1000), it is likely you will+-- get fewer messages than you requested per ReceiveMessage call. If the+-- number of messages in the queue is extremely small, you might not receive+-- any messages in a particular ReceiveMessage response; in which case you+-- should repeat the request. For each message returned, the response includes+-- the following: Message body MD5 digest of the message body. For information+-- about MD5, go to http://www.faqs.org/rfcs/rfc1321.html. Message ID you+-- received when you sent the message to the queue. Receipt handle. Message+-- attributes. MD5 digest of the message attributes. The receipt handle is the+-- identifier you must provide when deleting the message. For more+-- information, see Queue and Message Identifiers in the Amazon SQS Developer+-- Guide. You can provide the VisibilityTimeout parameter in your request,+-- which will be applied to the messages that Amazon SQS returns in the+-- response. If you do not include the parameter, the overall visibility+-- timeout for the queue is used for the returned messages. For more+-- information, see Visibility Timeout in the Amazon SQS Developer Guide.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html>+module Network.AWS.SQS.ReceiveMessage+ (+ -- * Request+ ReceiveMessage+ -- ** Request constructor+ , receiveMessage+ -- ** Request lenses+ , rmAttributeNames+ , rmMaxNumberOfMessages+ , rmMessageAttributeNames+ , rmQueueUrl+ , rmVisibilityTimeout+ , rmWaitTimeSeconds++ -- * Response+ , ReceiveMessageResponse+ -- ** Response constructor+ , receiveMessageResponse+ -- ** Response lenses+ , rmrMessages+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++data ReceiveMessage = ReceiveMessage+ { _rmAttributeNames :: List "AttributeName" Text+ , _rmMaxNumberOfMessages :: Maybe Int+ , _rmMessageAttributeNames :: List "MessageAttributeName" Text+ , _rmQueueUrl :: Text+ , _rmVisibilityTimeout :: Maybe Int+ , _rmWaitTimeSeconds :: Maybe Int+ } deriving (Eq, Ord, Show)++-- | 'ReceiveMessage' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'rmAttributeNames' @::@ ['Text']+--+-- * 'rmMaxNumberOfMessages' @::@ 'Maybe' 'Int'+--+-- * 'rmMessageAttributeNames' @::@ ['Text']+--+-- * 'rmQueueUrl' @::@ 'Text'+--+-- * 'rmVisibilityTimeout' @::@ 'Maybe' 'Int'+--+-- * 'rmWaitTimeSeconds' @::@ 'Maybe' 'Int'+--+receiveMessage :: Text -- ^ 'rmQueueUrl'+ -> [Text] -- ^ 'rmAttributeNames'+ -> [Text] -- ^ 'rmMessageAttributeNames'+ -> ReceiveMessage+receiveMessage p1 p2 p3 = ReceiveMessage+ { _rmQueueUrl = p1+ , _rmAttributeNames = withIso _List (const id) p2+ , _rmMessageAttributeNames = withIso _List (const id) p3+ , _rmMaxNumberOfMessages = Nothing+ , _rmVisibilityTimeout = Nothing+ , _rmWaitTimeSeconds = Nothing+ }++-- | A list of attributes that need to be returned along with each message.+-- The following lists the names and descriptions of the attributes that can+-- be returned: All - returns all values. ApproximateFirstReceiveTimestamp -+-- returns the time when the message was first received (epoch time in+-- milliseconds). ApproximateReceiveCount - returns the number of times a+-- message has been received but not deleted. SenderId - returns the AWS+-- account number (or the IP address, if anonymous access is allowed) of the+-- sender. SentTimestamp - returns the time when the message was sent (epoch+-- time in milliseconds).+rmAttributeNames :: Lens' ReceiveMessage [Text]+rmAttributeNames = lens _rmAttributeNames (\s a -> s { _rmAttributeNames = a }) . _List++-- | The maximum number of messages to return. Amazon SQS never returns more+-- messages than this value but may return fewer. Values can be from 1 to+-- 10. Default is 1. All of the messages are not necessarily returned.+rmMaxNumberOfMessages :: Lens' ReceiveMessage (Maybe Int)+rmMaxNumberOfMessages =+ lens _rmMaxNumberOfMessages (\s a -> s { _rmMaxNumberOfMessages = a })++-- | The message attribute Name can contain the following characters: A-Z,+-- a-z, 0-9, underscore(_), hyphen(-), and period (.). The message attribute+-- name must not start or end with a period, and it should not have+-- successive periods. The message attribute name is case sensitive and must+-- be unique among all attribute names for the message. The message+-- attribute name can be up to 256 characters long. Attribute names cannot+-- start with "AWS." or "Amazon." because these prefixes are reserved for+-- use by Amazon Web Services.+rmMessageAttributeNames :: Lens' ReceiveMessage [Text]+rmMessageAttributeNames =+ lens _rmMessageAttributeNames (\s a -> s { _rmMessageAttributeNames = a })+ . _List++-- | The URL of the Amazon SQS queue to take action on.+rmQueueUrl :: Lens' ReceiveMessage Text+rmQueueUrl = lens _rmQueueUrl (\s a -> s { _rmQueueUrl = a })++-- | The duration (in seconds) that the received messages are hidden from+-- subsequent retrieve requests after being retrieved by a ReceiveMessage+-- request.+rmVisibilityTimeout :: Lens' ReceiveMessage (Maybe Int)+rmVisibilityTimeout =+ lens _rmVisibilityTimeout (\s a -> s { _rmVisibilityTimeout = a })++-- | The duration (in seconds) for which the call will wait for a message to+-- arrive in the queue before returning. If a message is available, the call+-- will return sooner than WaitTimeSeconds.+rmWaitTimeSeconds :: Lens' ReceiveMessage (Maybe Int)+rmWaitTimeSeconds =+ lens _rmWaitTimeSeconds (\s a -> s { _rmWaitTimeSeconds = a })++newtype ReceiveMessageResponse = ReceiveMessageResponse+ { _rmrMessages :: List "Message" Message+ } deriving (Eq, Show, Monoid, Semigroup)++-- | 'ReceiveMessageResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'rmrMessages' @::@ ['Message']+--+receiveMessageResponse :: [Message] -- ^ 'rmrMessages'+ -> ReceiveMessageResponse+receiveMessageResponse p1 = ReceiveMessageResponse+ { _rmrMessages = withIso _List (const id) p1+ }++-- | A list of messages.+rmrMessages :: Lens' ReceiveMessageResponse [Message]+rmrMessages = lens _rmrMessages (\s a -> s { _rmrMessages = a }) . _List++instance ToPath ReceiveMessage where+ toPath = const "/"++instance ToQuery ReceiveMessage where+ toQuery ReceiveMessage{..} = mconcat+ [ toQuery _rmAttributeNames+ , "MaxNumberOfMessages" =? _rmMaxNumberOfMessages+ , toQuery _rmMessageAttributeNames+ , "QueueUrl" =? _rmQueueUrl+ , "VisibilityTimeout" =? _rmVisibilityTimeout+ , "WaitTimeSeconds" =? _rmWaitTimeSeconds+ ]++instance ToHeaders ReceiveMessage++instance AWSRequest ReceiveMessage where+ type Sv ReceiveMessage = SQS+ type Rs ReceiveMessage = ReceiveMessageResponse++ request = post "ReceiveMessage"+ response = xmlResponse++instance FromXML ReceiveMessageResponse where+ parseXML = withElement "ReceiveMessageResult" $ \x -> ReceiveMessageResponse+ <$> parseXML x
+ gen/Network/AWS/SQS/RemovePermission.hs view
@@ -0,0 +1,101 @@+{-# 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.SQS.RemovePermission+-- 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)++-- | Revokes any permissions in the queue policy that matches the specified+-- Label parameter. Only the owner of the queue can remove permissions.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_RemovePermission.html>+module Network.AWS.SQS.RemovePermission+ (+ -- * Request+ RemovePermission+ -- ** Request constructor+ , removePermission+ -- ** Request lenses+ , rpLabel+ , rpQueueUrl++ -- * Response+ , RemovePermissionResponse+ -- ** Response constructor+ , removePermissionResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++data RemovePermission = RemovePermission+ { _rpLabel :: Text+ , _rpQueueUrl :: Text+ } deriving (Eq, Ord, Show)++-- | 'RemovePermission' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'rpLabel' @::@ 'Text'+--+-- * 'rpQueueUrl' @::@ 'Text'+--+removePermission :: Text -- ^ 'rpQueueUrl'+ -> Text -- ^ 'rpLabel'+ -> RemovePermission+removePermission p1 p2 = RemovePermission+ { _rpQueueUrl = p1+ , _rpLabel = p2+ }++-- | The identification of the permission to remove. This is the label added+-- with the AddPermission action.+rpLabel :: Lens' RemovePermission Text+rpLabel = lens _rpLabel (\s a -> s { _rpLabel = a })++-- | The URL of the Amazon SQS queue to take action on.+rpQueueUrl :: Lens' RemovePermission Text+rpQueueUrl = lens _rpQueueUrl (\s a -> s { _rpQueueUrl = a })++data RemovePermissionResponse = RemovePermissionResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'RemovePermissionResponse' constructor.+removePermissionResponse :: RemovePermissionResponse+removePermissionResponse = RemovePermissionResponse++instance ToPath RemovePermission where+ toPath = const "/"++instance ToQuery RemovePermission where+ toQuery RemovePermission{..} = mconcat+ [ "Label" =? _rpLabel+ , "QueueUrl" =? _rpQueueUrl+ ]++instance ToHeaders RemovePermission++instance AWSRequest RemovePermission where+ type Sv RemovePermission = SQS+ type Rs RemovePermission = RemovePermissionResponse++ request = post "RemovePermission"+ response = nullResponse RemovePermissionResponse
+ gen/Network/AWS/SQS/SendMessage.hs view
@@ -0,0 +1,185 @@+{-# 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.SQS.SendMessage+-- 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)++-- | Delivers a message to the specified queue. With Amazon SQS, you now have+-- the ability to send large payload messages that are up to 256KB (262,144+-- bytes) in size. To send large payloads, you must use an AWS SDK that+-- supports SigV4 signing. To verify whether SigV4 is supported for an AWS+-- SDK, check the SDK release notes. The following list shows the characters+-- (in Unicode) allowed in your message, according to the W3C XML+-- specification. For more information, go to+-- http://www.w3.org/TR/REC-xml/#charsets If you send any characters not+-- included in the list, your request will be rejected. #x9 | #xA | #xD |+-- [#x20 to #xD7FF] | [#xE000 to #xFFFD] | [#x10000 to #x10FFFF].+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html>+module Network.AWS.SQS.SendMessage+ (+ -- * Request+ SendMessage+ -- ** Request constructor+ , sendMessage+ -- ** Request lenses+ , smDelaySeconds+ , smMessageAttributes+ , smMessageBody+ , smQueueUrl++ -- * Response+ , SendMessageResponse+ -- ** Response constructor+ , sendMessageResponse+ -- ** Response lenses+ , smrMD5OfMessageAttributes+ , smrMD5OfMessageBody+ , smrMessageId+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++data SendMessage = SendMessage+ { _smDelaySeconds :: Maybe Int+ , _smMessageAttributes :: EMap "MessageAttribute" "Name" "Value" Text MessageAttributeValue+ , _smMessageBody :: Text+ , _smQueueUrl :: Text+ } deriving (Eq, Show)++-- | 'SendMessage' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'smDelaySeconds' @::@ 'Maybe' 'Int'+--+-- * 'smMessageAttributes' @::@ 'HashMap' 'Text' 'MessageAttributeValue'+--+-- * 'smMessageBody' @::@ 'Text'+--+-- * 'smQueueUrl' @::@ 'Text'+--+sendMessage :: Text -- ^ 'smQueueUrl'+ -> Text -- ^ 'smMessageBody'+ -> HashMap Text MessageAttributeValue -- ^ 'smMessageAttributes'+ -> SendMessage+sendMessage p1 p2 p3 = SendMessage+ { _smQueueUrl = p1+ , _smMessageBody = p2+ , _smMessageAttributes = withIso _EMap (const id) p3+ , _smDelaySeconds = Nothing+ }++-- | The number of seconds (0 to 900 - 15 minutes) to delay a specific+-- message. Messages with a positive DelaySeconds value become available for+-- processing after the delay time is finished. If you don't specify a+-- value, the default value for the queue applies.+smDelaySeconds :: Lens' SendMessage (Maybe Int)+smDelaySeconds = lens _smDelaySeconds (\s a -> s { _smDelaySeconds = a })++-- | Each message attribute consists of a Name, Type, and Value. For more+-- information, see Message Attribute Items.+smMessageAttributes :: Lens' SendMessage (HashMap Text MessageAttributeValue)+smMessageAttributes =+ lens _smMessageAttributes (\s a -> s { _smMessageAttributes = a })+ . _EMap++-- | The message to send. String maximum 256 KB in size. For a list of allowed+-- characters, see the preceding important note.+smMessageBody :: Lens' SendMessage Text+smMessageBody = lens _smMessageBody (\s a -> s { _smMessageBody = a })++-- | The URL of the Amazon SQS queue to take action on.+smQueueUrl :: Lens' SendMessage Text+smQueueUrl = lens _smQueueUrl (\s a -> s { _smQueueUrl = a })++data SendMessageResponse = SendMessageResponse+ { _smrMD5OfMessageAttributes :: Maybe Text+ , _smrMD5OfMessageBody :: Maybe Text+ , _smrMessageId :: Maybe Text+ } deriving (Eq, Ord, Show)++-- | 'SendMessageResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'smrMD5OfMessageAttributes' @::@ 'Maybe' 'Text'+--+-- * 'smrMD5OfMessageBody' @::@ 'Maybe' 'Text'+--+-- * 'smrMessageId' @::@ 'Maybe' 'Text'+--+sendMessageResponse :: SendMessageResponse+sendMessageResponse = SendMessageResponse+ { _smrMD5OfMessageBody = Nothing+ , _smrMD5OfMessageAttributes = Nothing+ , _smrMessageId = Nothing+ }++-- | An MD5 digest of the non-URL-encoded message attribute string. This can+-- be used to verify that Amazon SQS received the message correctly. Amazon+-- SQS first URL decodes the message before creating the MD5 digest. For+-- information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.+smrMD5OfMessageAttributes :: Lens' SendMessageResponse (Maybe Text)+smrMD5OfMessageAttributes =+ lens _smrMD5OfMessageAttributes+ (\s a -> s { _smrMD5OfMessageAttributes = a })++-- | An MD5 digest of the non-URL-encoded message body string. This can be+-- used to verify that Amazon SQS received the message correctly. Amazon SQS+-- first URL decodes the message before creating the MD5 digest. For+-- information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.+smrMD5OfMessageBody :: Lens' SendMessageResponse (Maybe Text)+smrMD5OfMessageBody =+ lens _smrMD5OfMessageBody (\s a -> s { _smrMD5OfMessageBody = a })++-- | An element containing the message ID of the message sent to the queue.+-- For more information, see Queue and Message Identifiers in the Amazon SQS+-- Developer Guide.+smrMessageId :: Lens' SendMessageResponse (Maybe Text)+smrMessageId = lens _smrMessageId (\s a -> s { _smrMessageId = a })++instance ToPath SendMessage where+ toPath = const "/"++instance ToQuery SendMessage where+ toQuery SendMessage{..} = mconcat+ [ "DelaySeconds" =? _smDelaySeconds+ , toQuery _smMessageAttributes+ , "MessageBody" =? _smMessageBody+ , "QueueUrl" =? _smQueueUrl+ ]++instance ToHeaders SendMessage++instance AWSRequest SendMessage where+ type Sv SendMessage = SQS+ type Rs SendMessage = SendMessageResponse++ request = post "SendMessage"+ response = xmlResponse++instance FromXML SendMessageResponse where+ parseXML = withElement "SendMessageResult" $ \x -> SendMessageResponse+ <$> x .@? "MD5OfMessageAttributes"+ <*> x .@? "MD5OfMessageBody"+ <*> x .@? "MessageId"
+ gen/Network/AWS/SQS/SendMessageBatch.hs view
@@ -0,0 +1,144 @@+{-# 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.SQS.SendMessageBatch+-- 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)++-- | Delivers up to ten messages to the specified queue. This is a batch version+-- of SendMessage. The result of the send action on each message is reported+-- individually in the response. The maximum allowed individual message size+-- is 256 KB (262,144 bytes). The maximum total payload size (i.e., the sum of+-- all a batch's individual message lengths) is also 256 KB (262,144 bytes).+-- If the DelaySeconds parameter is not specified for an entry, the default+-- for the queue is used. The following list shows the characters (in Unicode)+-- that are allowed in your message, according to the W3C XML specification.+-- For more information, go to http://www.faqs.org/rfcs/rfc1321.html. If you+-- send any characters that are not included in the list, your request will be+-- rejected. #x9 | #xA | #xD | [#x20 to #xD7FF] | [#xE000 to #xFFFD] |+-- [#x10000 to #x10FFFF] Because the batch request can result in a combination+-- of successful and unsuccessful actions, you should check for batch errors+-- even when the call returns an HTTP status code of 200.+-- &Attribute.1=this &Attribute.2=that.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessageBatch.html>+module Network.AWS.SQS.SendMessageBatch+ (+ -- * Request+ SendMessageBatch+ -- ** Request constructor+ , sendMessageBatch+ -- ** Request lenses+ , smbEntries+ , smbQueueUrl++ -- * Response+ , SendMessageBatchResponse+ -- ** Response constructor+ , sendMessageBatchResponse+ -- ** Response lenses+ , smbrFailed+ , smbrSuccessful+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++data SendMessageBatch = SendMessageBatch+ { _smbEntries :: List "SendMessageBatchRequestEntry" SendMessageBatchRequestEntry+ , _smbQueueUrl :: Text+ } deriving (Eq, Show)++-- | 'SendMessageBatch' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'smbEntries' @::@ ['SendMessageBatchRequestEntry']+--+-- * 'smbQueueUrl' @::@ 'Text'+--+sendMessageBatch :: Text -- ^ 'smbQueueUrl'+ -> [SendMessageBatchRequestEntry] -- ^ 'smbEntries'+ -> SendMessageBatch+sendMessageBatch p1 p2 = SendMessageBatch+ { _smbQueueUrl = p1+ , _smbEntries = withIso _List (const id) p2+ }++-- | A list of SendMessageBatchRequestEntry items.+smbEntries :: Lens' SendMessageBatch [SendMessageBatchRequestEntry]+smbEntries = lens _smbEntries (\s a -> s { _smbEntries = a }) . _List++-- | The URL of the Amazon SQS queue to take action on.+smbQueueUrl :: Lens' SendMessageBatch Text+smbQueueUrl = lens _smbQueueUrl (\s a -> s { _smbQueueUrl = a })++data SendMessageBatchResponse = SendMessageBatchResponse+ { _smbrFailed :: List "BatchResultErrorEntry" BatchResultErrorEntry+ , _smbrSuccessful :: List "SendMessageBatchResultEntry" SendMessageBatchResultEntry+ } deriving (Eq, Show)++-- | 'SendMessageBatchResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'smbrFailed' @::@ ['BatchResultErrorEntry']+--+-- * 'smbrSuccessful' @::@ ['SendMessageBatchResultEntry']+--+sendMessageBatchResponse :: [SendMessageBatchResultEntry] -- ^ 'smbrSuccessful'+ -> [BatchResultErrorEntry] -- ^ 'smbrFailed'+ -> SendMessageBatchResponse+sendMessageBatchResponse p1 p2 = SendMessageBatchResponse+ { _smbrSuccessful = withIso _List (const id) p1+ , _smbrFailed = withIso _List (const id) p2+ }++-- | A list of BatchResultErrorEntry items with the error detail about each+-- message that could not be enqueued.+smbrFailed :: Lens' SendMessageBatchResponse [BatchResultErrorEntry]+smbrFailed = lens _smbrFailed (\s a -> s { _smbrFailed = a }) . _List++-- | A list of SendMessageBatchResultEntry items.+smbrSuccessful :: Lens' SendMessageBatchResponse [SendMessageBatchResultEntry]+smbrSuccessful = lens _smbrSuccessful (\s a -> s { _smbrSuccessful = a }) . _List++instance ToPath SendMessageBatch where+ toPath = const "/"++instance ToQuery SendMessageBatch where+ toQuery SendMessageBatch{..} = mconcat+ [ toQuery _smbEntries+ , "QueueUrl" =? _smbQueueUrl+ ]++instance ToHeaders SendMessageBatch++instance AWSRequest SendMessageBatch where+ type Sv SendMessageBatch = SQS+ type Rs SendMessageBatch = SendMessageBatchResponse++ request = post "SendMessageBatch"+ response = xmlResponse++instance FromXML SendMessageBatchResponse where+ parseXML = withElement "SendMessageBatchResult" $ \x -> SendMessageBatchResponse+ <$> parseXML x+ <*> parseXML x
+ gen/Network/AWS/SQS/SetQueueAttributes.hs view
@@ -0,0 +1,125 @@+{-# 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.SQS.SetQueueAttributes+-- 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)++-- | Sets the value of one or more queue attributes. When you change a queue's+-- attributes, the change can take up to 60 seconds for most of the attributes+-- to propagate throughout the SQS system. Changes made to the+-- MessageRetentionPeriod attribute can take up to 15 minutes.+--+-- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SetQueueAttributes.html>+module Network.AWS.SQS.SetQueueAttributes+ (+ -- * Request+ SetQueueAttributes+ -- ** Request constructor+ , setQueueAttributes+ -- ** Request lenses+ , sqaAttributes+ , sqaQueueUrl++ -- * Response+ , SetQueueAttributesResponse+ -- ** Response constructor+ , setQueueAttributesResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SQS.Types+import qualified GHC.Exts++data SetQueueAttributes = SetQueueAttributes+ { _sqaAttributes :: EMap "Attribute" "Name" "Value" Text Text+ , _sqaQueueUrl :: Text+ } deriving (Eq, Show)++-- | 'SetQueueAttributes' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'sqaAttributes' @::@ 'HashMap' 'Text' 'Text'+--+-- * 'sqaQueueUrl' @::@ 'Text'+--+setQueueAttributes :: Text -- ^ 'sqaQueueUrl'+ -> HashMap Text Text -- ^ 'sqaAttributes'+ -> SetQueueAttributes+setQueueAttributes p1 p2 = SetQueueAttributes+ { _sqaQueueUrl = p1+ , _sqaAttributes = withIso _EMap (const id) p2+ }++-- | A map of attributes to set. The following lists the names, descriptions,+-- and values of the special request parameters the SetQueueAttributes+-- action uses: DelaySeconds - The time in seconds that the delivery of all+-- messages in the queue will be delayed. An integer from 0 to 900 (15+-- minutes). The default for this attribute is 0 (zero). MaximumMessageSize+-- - The limit of how many bytes a message can contain before Amazon SQS+-- rejects it. An integer from 1024 bytes (1 KiB) up to 262144 bytes (256+-- KiB). The default for this attribute is 262144 (256 KiB).+-- MessageRetentionPeriod - The number of seconds Amazon SQS retains a+-- message. Integer representing seconds, from 60 (1 minute) to 1209600 (14+-- days). The default for this attribute is 345600 (4 days). Policy - The+-- queue's policy. A valid form-url-encoded policy. For more information+-- about policy structure, see Basic Policy Structure in the Amazon SQS+-- Developer Guide. For more information about form-url-encoding, see+-- http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1.+-- ReceiveMessageWaitTimeSeconds - The time for which a ReceiveMessage call+-- will wait for a message to arrive. An integer from 0 to 20 (seconds). The+-- default for this attribute is 0. VisibilityTimeout - The visibility+-- timeout for the queue. An integer from 0 to 43200 (12 hours). The default+-- for this attribute is 30. For more information about visibility timeout,+-- see Visibility Timeout in the Amazon SQS Developer Guide. RedrivePolicy -+-- The parameters for dead letter queue functionality of the source queue.+-- For more information about RedrivePolicy and dead letter queues, see+-- Using Amazon SQS Dead Letter Queues in the Amazon SQS Developer Guide.+sqaAttributes :: Lens' SetQueueAttributes (HashMap Text Text)+sqaAttributes = lens _sqaAttributes (\s a -> s { _sqaAttributes = a }) . _EMap++-- | The URL of the Amazon SQS queue to take action on.+sqaQueueUrl :: Lens' SetQueueAttributes Text+sqaQueueUrl = lens _sqaQueueUrl (\s a -> s { _sqaQueueUrl = a })++data SetQueueAttributesResponse = SetQueueAttributesResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'SetQueueAttributesResponse' constructor.+setQueueAttributesResponse :: SetQueueAttributesResponse+setQueueAttributesResponse = SetQueueAttributesResponse++instance ToPath SetQueueAttributes where+ toPath = const "/"++instance ToQuery SetQueueAttributes where+ toQuery SetQueueAttributes{..} = mconcat+ [ toQuery _sqaAttributes+ , "QueueUrl" =? _sqaQueueUrl+ ]++instance ToHeaders SetQueueAttributes++instance AWSRequest SetQueueAttributes where+ type Sv SetQueueAttributes = SQS+ type Rs SetQueueAttributes = SetQueueAttributesResponse++ request = post "SetQueueAttributes"+ response = nullResponse SetQueueAttributesResponse
+ gen/Network/AWS/SQS/Types.hs view
@@ -0,0 +1,718 @@+{-# 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.SQS.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)++module Network.AWS.SQS.Types+ (+ -- * Service+ SQS+ -- ** Error+ , RESTError+ -- ** XML+ , ns++ -- * QueueAttributeName+ , QueueAttributeName (..)++ -- * DeleteMessageBatchRequestEntry+ , DeleteMessageBatchRequestEntry+ , deleteMessageBatchRequestEntry+ , dmbreId+ , dmbreReceiptHandle++ -- * MessageAttributeValue+ , MessageAttributeValue+ , messageAttributeValue+ , mavBinaryListValues+ , mavBinaryValue+ , mavDataType+ , mavStringListValues+ , mavStringValue++ -- * ChangeMessageVisibilityBatchResultEntry+ , ChangeMessageVisibilityBatchResultEntry+ , changeMessageVisibilityBatchResultEntry+ , cmvbreId++ -- * ChangeMessageVisibilityBatchRequestEntry+ , ChangeMessageVisibilityBatchRequestEntry+ , changeMessageVisibilityBatchRequestEntry+ , cmvbre1Id+ , cmvbre1ReceiptHandle+ , cmvbre1VisibilityTimeout++ -- * DeleteMessageBatchResultEntry+ , DeleteMessageBatchResultEntry+ , deleteMessageBatchResultEntry+ , dmbre1Id++ -- * Message+ , Message+ , message+ , mAttributes+ , mBody+ , mMD5OfBody+ , mMD5OfMessageAttributes+ , mMessageAttributes+ , mMessageId+ , mReceiptHandle++ -- * SendMessageBatchRequestEntry+ , SendMessageBatchRequestEntry+ , sendMessageBatchRequestEntry+ , smbreDelaySeconds+ , smbreId+ , smbreMessageAttributes+ , smbreMessageBody++ -- * SendMessageBatchResultEntry+ , SendMessageBatchResultEntry+ , sendMessageBatchResultEntry+ , smbre1Id+ , smbre1MD5OfMessageAttributes+ , smbre1MD5OfMessageBody+ , smbre1MessageId++ -- * BatchResultErrorEntry+ , BatchResultErrorEntry+ , batchResultErrorEntry+ , breeCode+ , breeId+ , breeMessage+ , breeSenderFault+ ) where++import Network.AWS.Error+import Network.AWS.Prelude+import Network.AWS.Signing.V4+import qualified GHC.Exts++-- | Version @2012-11-05@ of the Amazon Simple Queue Service service.+data SQS++instance AWSService SQS where+ type Sg SQS = V4+ type Er SQS = RESTError++ service = Service+ { _svcEndpoint = regional+ , _svcAbbrev = "SQS"+ , _svcPrefix = "sqs"+ , _svcVersion = "2012-11-05"+ , _svcTargetPrefix = Nothing+ , _svcJSONVersion = Nothing+ }++ handle = restError statusSuccess++ns :: Text+ns = "http://queue.amazonaws.com/doc/2012-11-05/"++data QueueAttributeName+ = ApproximateNumberOfMessages -- ^ ApproximateNumberOfMessages+ | ApproximateNumberOfMessagesDelayed -- ^ ApproximateNumberOfMessagesDelayed+ | ApproximateNumberOfMessagesNotVisible -- ^ ApproximateNumberOfMessagesNotVisible+ | CreatedTimestamp -- ^ CreatedTimestamp+ | DelaySeconds -- ^ DelaySeconds+ | LastModifiedTimestamp -- ^ LastModifiedTimestamp+ | MaximumMessageSize -- ^ MaximumMessageSize+ | MessageRetentionPeriod -- ^ MessageRetentionPeriod+ | Policy -- ^ Policy+ | QueueArn -- ^ QueueArn+ | ReceiveMessageWaitTimeSeconds -- ^ ReceiveMessageWaitTimeSeconds+ | RedrivePolicy -- ^ RedrivePolicy+ | VisibilityTimeout -- ^ VisibilityTimeout+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable QueueAttributeName++instance FromText QueueAttributeName where+ parser = match "ApproximateNumberOfMessages" ApproximateNumberOfMessages+ <|> match "ApproximateNumberOfMessagesDelayed" ApproximateNumberOfMessagesDelayed+ <|> match "ApproximateNumberOfMessagesNotVisible" ApproximateNumberOfMessagesNotVisible+ <|> match "CreatedTimestamp" CreatedTimestamp+ <|> match "DelaySeconds" DelaySeconds+ <|> match "LastModifiedTimestamp" LastModifiedTimestamp+ <|> match "MaximumMessageSize" MaximumMessageSize+ <|> match "MessageRetentionPeriod" MessageRetentionPeriod+ <|> match "Policy" Policy+ <|> match "QueueArn" QueueArn+ <|> match "ReceiveMessageWaitTimeSeconds" ReceiveMessageWaitTimeSeconds+ <|> match "RedrivePolicy" RedrivePolicy+ <|> match "VisibilityTimeout" VisibilityTimeout++instance ToText QueueAttributeName where+ toText = \case+ ApproximateNumberOfMessages -> "ApproximateNumberOfMessages"+ ApproximateNumberOfMessagesDelayed -> "ApproximateNumberOfMessagesDelayed"+ ApproximateNumberOfMessagesNotVisible -> "ApproximateNumberOfMessagesNotVisible"+ CreatedTimestamp -> "CreatedTimestamp"+ DelaySeconds -> "DelaySeconds"+ LastModifiedTimestamp -> "LastModifiedTimestamp"+ MaximumMessageSize -> "MaximumMessageSize"+ MessageRetentionPeriod -> "MessageRetentionPeriod"+ Policy -> "Policy"+ QueueArn -> "QueueArn"+ ReceiveMessageWaitTimeSeconds -> "ReceiveMessageWaitTimeSeconds"+ RedrivePolicy -> "RedrivePolicy"+ VisibilityTimeout -> "VisibilityTimeout"++instance FromXML QueueAttributeName where+ parseXML = parseXMLText "QueueAttributeName"++instance ToQuery QueueAttributeName where+ toQuery = toQuery . toText++data DeleteMessageBatchRequestEntry = DeleteMessageBatchRequestEntry+ { _dmbreId :: Text+ , _dmbreReceiptHandle :: Text+ } deriving (Eq, Ord, Show)++-- | 'DeleteMessageBatchRequestEntry' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dmbreId' @::@ 'Text'+--+-- * 'dmbreReceiptHandle' @::@ 'Text'+--+deleteMessageBatchRequestEntry :: Text -- ^ 'dmbreId'+ -> Text -- ^ 'dmbreReceiptHandle'+ -> DeleteMessageBatchRequestEntry+deleteMessageBatchRequestEntry p1 p2 = DeleteMessageBatchRequestEntry+ { _dmbreId = p1+ , _dmbreReceiptHandle = p2+ }++-- | An identifier for this particular receipt handle. This is used to+-- communicate the result. Note that the Ids of a batch request need to be+-- unique within the request.+dmbreId :: Lens' DeleteMessageBatchRequestEntry Text+dmbreId = lens _dmbreId (\s a -> s { _dmbreId = a })++-- | A receipt handle.+dmbreReceiptHandle :: Lens' DeleteMessageBatchRequestEntry Text+dmbreReceiptHandle =+ lens _dmbreReceiptHandle (\s a -> s { _dmbreReceiptHandle = a })++instance FromXML DeleteMessageBatchRequestEntry where+ parseXML x = DeleteMessageBatchRequestEntry+ <$> x .@ "Id"+ <*> x .@ "ReceiptHandle"++instance ToQuery DeleteMessageBatchRequestEntry where+ toQuery DeleteMessageBatchRequestEntry{..} = mconcat+ [ "Id" =? _dmbreId+ , "ReceiptHandle" =? _dmbreReceiptHandle+ ]++data MessageAttributeValue = MessageAttributeValue+ { _mavBinaryListValues :: List "BinaryListValue" Base64+ , _mavBinaryValue :: Maybe Base64+ , _mavDataType :: Text+ , _mavStringListValues :: List "StringListValue" Text+ , _mavStringValue :: Maybe Text+ } deriving (Eq, Show)++-- | 'MessageAttributeValue' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'mavBinaryListValues' @::@ ['Base64']+--+-- * 'mavBinaryValue' @::@ 'Maybe' 'Base64'+--+-- * 'mavDataType' @::@ 'Text'+--+-- * 'mavStringListValues' @::@ ['Text']+--+-- * 'mavStringValue' @::@ 'Maybe' 'Text'+--+messageAttributeValue :: Text -- ^ 'mavDataType'+ -> MessageAttributeValue+messageAttributeValue p1 = MessageAttributeValue+ { _mavDataType = p1+ , _mavStringValue = Nothing+ , _mavBinaryValue = Nothing+ , _mavStringListValues = mempty+ , _mavBinaryListValues = mempty+ }++-- | Not implemented. Reserved for future use.+mavBinaryListValues :: Lens' MessageAttributeValue [Base64]+mavBinaryListValues =+ lens _mavBinaryListValues (\s a -> s { _mavBinaryListValues = a })+ . _List++-- | Binary type attributes can store any binary data, for example, compressed+-- data, encrypted data, or images.+mavBinaryValue :: Lens' MessageAttributeValue (Maybe Base64)+mavBinaryValue = lens _mavBinaryValue (\s a -> s { _mavBinaryValue = a })++-- | Amazon SQS supports the following logical data types: String, Number, and+-- Binary. In addition, you can append your own custom labels. For more+-- information, see Message Attribute Data Types.+mavDataType :: Lens' MessageAttributeValue Text+mavDataType = lens _mavDataType (\s a -> s { _mavDataType = a })++-- | Not implemented. Reserved for future use.+mavStringListValues :: Lens' MessageAttributeValue [Text]+mavStringListValues =+ lens _mavStringListValues (\s a -> s { _mavStringListValues = a })+ . _List++-- | Strings are Unicode with UTF8 binary encoding. For a list of code values,+-- see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters.+mavStringValue :: Lens' MessageAttributeValue (Maybe Text)+mavStringValue = lens _mavStringValue (\s a -> s { _mavStringValue = a })++instance FromXML MessageAttributeValue where+ parseXML x = MessageAttributeValue+ <$> x .@ "BinaryListValue"+ <*> x .@? "BinaryValue"+ <*> x .@ "DataType"+ <*> x .@ "StringListValue"+ <*> x .@? "StringValue"++instance ToQuery MessageAttributeValue where+ toQuery MessageAttributeValue{..} = mconcat+ [ "BinaryListValue" =? _mavBinaryListValues+ , "BinaryValue" =? _mavBinaryValue+ , "DataType" =? _mavDataType+ , "StringListValue" =? _mavStringListValues+ , "StringValue" =? _mavStringValue+ ]++newtype ChangeMessageVisibilityBatchResultEntry = ChangeMessageVisibilityBatchResultEntry+ { _cmvbreId :: Text+ } deriving (Eq, Ord, Show, Monoid, IsString)++-- | 'ChangeMessageVisibilityBatchResultEntry' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cmvbreId' @::@ 'Text'+--+changeMessageVisibilityBatchResultEntry :: Text -- ^ 'cmvbreId'+ -> ChangeMessageVisibilityBatchResultEntry+changeMessageVisibilityBatchResultEntry p1 = ChangeMessageVisibilityBatchResultEntry+ { _cmvbreId = p1+ }++-- | Represents a message whose visibility timeout has been changed+-- successfully.+cmvbreId :: Lens' ChangeMessageVisibilityBatchResultEntry Text+cmvbreId = lens _cmvbreId (\s a -> s { _cmvbreId = a })++instance FromXML ChangeMessageVisibilityBatchResultEntry where+ parseXML x = ChangeMessageVisibilityBatchResultEntry+ <$> x .@ "Id"++instance ToQuery ChangeMessageVisibilityBatchResultEntry where+ toQuery ChangeMessageVisibilityBatchResultEntry{..} = mconcat+ [ "Id" =? _cmvbreId+ ]++data ChangeMessageVisibilityBatchRequestEntry = ChangeMessageVisibilityBatchRequestEntry+ { _cmvbre1Id :: Text+ , _cmvbre1ReceiptHandle :: Text+ , _cmvbre1VisibilityTimeout :: Maybe Int+ } deriving (Eq, Ord, Show)++-- | 'ChangeMessageVisibilityBatchRequestEntry' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cmvbre1Id' @::@ 'Text'+--+-- * 'cmvbre1ReceiptHandle' @::@ 'Text'+--+-- * 'cmvbre1VisibilityTimeout' @::@ 'Maybe' 'Int'+--+changeMessageVisibilityBatchRequestEntry :: Text -- ^ 'cmvbre1Id'+ -> Text -- ^ 'cmvbre1ReceiptHandle'+ -> ChangeMessageVisibilityBatchRequestEntry+changeMessageVisibilityBatchRequestEntry p1 p2 = ChangeMessageVisibilityBatchRequestEntry+ { _cmvbre1Id = p1+ , _cmvbre1ReceiptHandle = p2+ , _cmvbre1VisibilityTimeout = Nothing+ }++-- | An identifier for this particular receipt handle. This is used to+-- communicate the result. Note that the Ids of a batch request need to be+-- unique within the request.+cmvbre1Id :: Lens' ChangeMessageVisibilityBatchRequestEntry Text+cmvbre1Id = lens _cmvbre1Id (\s a -> s { _cmvbre1Id = a })++-- | A receipt handle.+cmvbre1ReceiptHandle :: Lens' ChangeMessageVisibilityBatchRequestEntry Text+cmvbre1ReceiptHandle =+ lens _cmvbre1ReceiptHandle (\s a -> s { _cmvbre1ReceiptHandle = a })++-- | The new value (in seconds) for the message's visibility timeout.+cmvbre1VisibilityTimeout :: Lens' ChangeMessageVisibilityBatchRequestEntry (Maybe Int)+cmvbre1VisibilityTimeout =+ lens _cmvbre1VisibilityTimeout+ (\s a -> s { _cmvbre1VisibilityTimeout = a })++instance FromXML ChangeMessageVisibilityBatchRequestEntry where+ parseXML x = ChangeMessageVisibilityBatchRequestEntry+ <$> x .@ "Id"+ <*> x .@ "ReceiptHandle"+ <*> x .@? "VisibilityTimeout"++instance ToQuery ChangeMessageVisibilityBatchRequestEntry where+ toQuery ChangeMessageVisibilityBatchRequestEntry{..} = mconcat+ [ "Id" =? _cmvbre1Id+ , "ReceiptHandle" =? _cmvbre1ReceiptHandle+ , "VisibilityTimeout" =? _cmvbre1VisibilityTimeout+ ]++newtype DeleteMessageBatchResultEntry = DeleteMessageBatchResultEntry+ { _dmbre1Id :: Text+ } deriving (Eq, Ord, Show, Monoid, IsString)++-- | 'DeleteMessageBatchResultEntry' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dmbre1Id' @::@ 'Text'+--+deleteMessageBatchResultEntry :: Text -- ^ 'dmbre1Id'+ -> DeleteMessageBatchResultEntry+deleteMessageBatchResultEntry p1 = DeleteMessageBatchResultEntry+ { _dmbre1Id = p1+ }++-- | Represents a successfully deleted message.+dmbre1Id :: Lens' DeleteMessageBatchResultEntry Text+dmbre1Id = lens _dmbre1Id (\s a -> s { _dmbre1Id = a })++instance FromXML DeleteMessageBatchResultEntry where+ parseXML x = DeleteMessageBatchResultEntry+ <$> x .@ "Id"++instance ToQuery DeleteMessageBatchResultEntry where+ toQuery DeleteMessageBatchResultEntry{..} = mconcat+ [ "Id" =? _dmbre1Id+ ]++data Message = Message+ { _mAttributes :: EMap "Attribute" "Name" "Value" Text Text+ , _mBody :: Maybe Text+ , _mMD5OfBody :: Maybe Text+ , _mMD5OfMessageAttributes :: Maybe Text+ , _mMessageAttributes :: EMap "MessageAttribute" "Name" "Value" Text MessageAttributeValue+ , _mMessageId :: Maybe Text+ , _mReceiptHandle :: Maybe Text+ } deriving (Eq, Show)++-- | 'Message' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'mAttributes' @::@ 'HashMap' 'Text' 'Text'+--+-- * 'mBody' @::@ 'Maybe' 'Text'+--+-- * 'mMD5OfBody' @::@ 'Maybe' 'Text'+--+-- * 'mMD5OfMessageAttributes' @::@ 'Maybe' 'Text'+--+-- * 'mMessageAttributes' @::@ 'HashMap' 'Text' 'MessageAttributeValue'+--+-- * 'mMessageId' @::@ 'Maybe' 'Text'+--+-- * 'mReceiptHandle' @::@ 'Maybe' 'Text'+--+message :: HashMap Text Text -- ^ 'mAttributes'+ -> HashMap Text MessageAttributeValue -- ^ 'mMessageAttributes'+ -> Message+message p1 p2 = Message+ { _mAttributes = withIso _EMap (const id) p1+ , _mMessageAttributes = withIso _EMap (const id) p2+ , _mMessageId = Nothing+ , _mReceiptHandle = Nothing+ , _mMD5OfBody = Nothing+ , _mBody = Nothing+ , _mMD5OfMessageAttributes = Nothing+ }++-- | SenderId, SentTimestamp, ApproximateReceiveCount, and/or+-- ApproximateFirstReceiveTimestamp. SentTimestamp and+-- ApproximateFirstReceiveTimestamp are each returned as an integer+-- representing the epoch time in milliseconds.+mAttributes :: Lens' Message (HashMap Text Text)+mAttributes = lens _mAttributes (\s a -> s { _mAttributes = a }) . _EMap++-- | The message's contents (not URL-encoded).+mBody :: Lens' Message (Maybe Text)+mBody = lens _mBody (\s a -> s { _mBody = a })++-- | An MD5 digest of the non-URL-encoded message body string.+mMD5OfBody :: Lens' Message (Maybe Text)+mMD5OfBody = lens _mMD5OfBody (\s a -> s { _mMD5OfBody = a })++-- | An MD5 digest of the non-URL-encoded message attribute string. This can+-- be used to verify that Amazon SQS received the message correctly. Amazon+-- SQS first URL decodes the message before creating the MD5 digest. For+-- information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.+mMD5OfMessageAttributes :: Lens' Message (Maybe Text)+mMD5OfMessageAttributes =+ lens _mMD5OfMessageAttributes (\s a -> s { _mMD5OfMessageAttributes = a })++-- | Each message attribute consists of a Name, Type, and Value. For more+-- information, see Message Attribute Items.+mMessageAttributes :: Lens' Message (HashMap Text MessageAttributeValue)+mMessageAttributes =+ lens _mMessageAttributes (\s a -> s { _mMessageAttributes = a })+ . _EMap++-- | A unique identifier for the message. Message IDs are considered unique+-- across all AWS accounts for an extended period of time.+mMessageId :: Lens' Message (Maybe Text)+mMessageId = lens _mMessageId (\s a -> s { _mMessageId = a })++-- | An identifier associated with the act of receiving the message. A new+-- receipt handle is returned every time you receive a message. When+-- deleting a message, you provide the last received receipt handle to+-- delete the message.+mReceiptHandle :: Lens' Message (Maybe Text)+mReceiptHandle = lens _mReceiptHandle (\s a -> s { _mReceiptHandle = a })++instance FromXML Message where+ parseXML x = Message+ <$> parseXML x+ <*> x .@? "Body"+ <*> x .@? "MD5OfBody"+ <*> x .@? "MD5OfMessageAttributes"+ <*> parseXML x+ <*> x .@? "MessageId"+ <*> x .@? "ReceiptHandle"++instance ToQuery Message where+ toQuery Message{..} = mconcat+ [ toQuery _mAttributes+ , "Body" =? _mBody+ , "MD5OfBody" =? _mMD5OfBody+ , "MD5OfMessageAttributes" =? _mMD5OfMessageAttributes+ , toQuery _mMessageAttributes+ , "MessageId" =? _mMessageId+ , "ReceiptHandle" =? _mReceiptHandle+ ]++data SendMessageBatchRequestEntry = SendMessageBatchRequestEntry+ { _smbreDelaySeconds :: Maybe Int+ , _smbreId :: Text+ , _smbreMessageAttributes :: EMap "MessageAttribute" "Name" "Value" Text MessageAttributeValue+ , _smbreMessageBody :: Text+ } deriving (Eq, Show)++-- | 'SendMessageBatchRequestEntry' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'smbreDelaySeconds' @::@ 'Maybe' 'Int'+--+-- * 'smbreId' @::@ 'Text'+--+-- * 'smbreMessageAttributes' @::@ 'HashMap' 'Text' 'MessageAttributeValue'+--+-- * 'smbreMessageBody' @::@ 'Text'+--+sendMessageBatchRequestEntry :: Text -- ^ 'smbreId'+ -> Text -- ^ 'smbreMessageBody'+ -> HashMap Text MessageAttributeValue -- ^ 'smbreMessageAttributes'+ -> SendMessageBatchRequestEntry+sendMessageBatchRequestEntry p1 p2 p3 = SendMessageBatchRequestEntry+ { _smbreId = p1+ , _smbreMessageBody = p2+ , _smbreMessageAttributes = withIso _EMap (const id) p3+ , _smbreDelaySeconds = Nothing+ }++-- | The number of seconds for which the message has to be delayed.+smbreDelaySeconds :: Lens' SendMessageBatchRequestEntry (Maybe Int)+smbreDelaySeconds =+ lens _smbreDelaySeconds (\s a -> s { _smbreDelaySeconds = a })++-- | An identifier for the message in this batch. This is used to communicate+-- the result. Note that the Ids of a batch request need to be unique within+-- the request.+smbreId :: Lens' SendMessageBatchRequestEntry Text+smbreId = lens _smbreId (\s a -> s { _smbreId = a })++-- | Each message attribute consists of a Name, Type, and Value. For more+-- information, see Message Attribute Items.+smbreMessageAttributes :: Lens' SendMessageBatchRequestEntry (HashMap Text MessageAttributeValue)+smbreMessageAttributes =+ lens _smbreMessageAttributes (\s a -> s { _smbreMessageAttributes = a })+ . _EMap++-- | Body of the message.+smbreMessageBody :: Lens' SendMessageBatchRequestEntry Text+smbreMessageBody = lens _smbreMessageBody (\s a -> s { _smbreMessageBody = a })++instance FromXML SendMessageBatchRequestEntry where+ parseXML x = SendMessageBatchRequestEntry+ <$> x .@? "DelaySeconds"+ <*> x .@ "Id"+ <*> parseXML x+ <*> x .@ "MessageBody"++instance ToQuery SendMessageBatchRequestEntry where+ toQuery SendMessageBatchRequestEntry{..} = mconcat+ [ "DelaySeconds" =? _smbreDelaySeconds+ , "Id" =? _smbreId+ , toQuery _smbreMessageAttributes+ , "MessageBody" =? _smbreMessageBody+ ]++data SendMessageBatchResultEntry = SendMessageBatchResultEntry+ { _smbre1Id :: Text+ , _smbre1MD5OfMessageAttributes :: Maybe Text+ , _smbre1MD5OfMessageBody :: Text+ , _smbre1MessageId :: Text+ } deriving (Eq, Ord, Show)++-- | 'SendMessageBatchResultEntry' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'smbre1Id' @::@ 'Text'+--+-- * 'smbre1MD5OfMessageAttributes' @::@ 'Maybe' 'Text'+--+-- * 'smbre1MD5OfMessageBody' @::@ 'Text'+--+-- * 'smbre1MessageId' @::@ 'Text'+--+sendMessageBatchResultEntry :: Text -- ^ 'smbre1Id'+ -> Text -- ^ 'smbre1MessageId'+ -> Text -- ^ 'smbre1MD5OfMessageBody'+ -> SendMessageBatchResultEntry+sendMessageBatchResultEntry p1 p2 p3 = SendMessageBatchResultEntry+ { _smbre1Id = p1+ , _smbre1MessageId = p2+ , _smbre1MD5OfMessageBody = p3+ , _smbre1MD5OfMessageAttributes = Nothing+ }++-- | An identifier for the message in this batch.+smbre1Id :: Lens' SendMessageBatchResultEntry Text+smbre1Id = lens _smbre1Id (\s a -> s { _smbre1Id = a })++-- | An MD5 digest of the non-URL-encoded message attribute string. This can+-- be used to verify that Amazon SQS received the message batch correctly.+-- Amazon SQS first URL decodes the message before creating the MD5 digest.+-- For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.+smbre1MD5OfMessageAttributes :: Lens' SendMessageBatchResultEntry (Maybe Text)+smbre1MD5OfMessageAttributes =+ lens _smbre1MD5OfMessageAttributes+ (\s a -> s { _smbre1MD5OfMessageAttributes = a })++-- | An MD5 digest of the non-URL-encoded message body string. This can be+-- used to verify that Amazon SQS received the message correctly. Amazon SQS+-- first URL decodes the message before creating the MD5 digest. For+-- information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.+smbre1MD5OfMessageBody :: Lens' SendMessageBatchResultEntry Text+smbre1MD5OfMessageBody =+ lens _smbre1MD5OfMessageBody (\s a -> s { _smbre1MD5OfMessageBody = a })++-- | An identifier for the message.+smbre1MessageId :: Lens' SendMessageBatchResultEntry Text+smbre1MessageId = lens _smbre1MessageId (\s a -> s { _smbre1MessageId = a })++instance FromXML SendMessageBatchResultEntry where+ parseXML x = SendMessageBatchResultEntry+ <$> x .@ "Id"+ <*> x .@? "MD5OfMessageAttributes"+ <*> x .@ "MD5OfMessageBody"+ <*> x .@ "MessageId"++instance ToQuery SendMessageBatchResultEntry where+ toQuery SendMessageBatchResultEntry{..} = mconcat+ [ "Id" =? _smbre1Id+ , "MD5OfMessageAttributes" =? _smbre1MD5OfMessageAttributes+ , "MD5OfMessageBody" =? _smbre1MD5OfMessageBody+ , "MessageId" =? _smbre1MessageId+ ]++data BatchResultErrorEntry = BatchResultErrorEntry+ { _breeCode :: Text+ , _breeId :: Text+ , _breeMessage :: Maybe Text+ , _breeSenderFault :: Bool+ } deriving (Eq, Ord, Show)++-- | 'BatchResultErrorEntry' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'breeCode' @::@ 'Text'+--+-- * 'breeId' @::@ 'Text'+--+-- * 'breeMessage' @::@ 'Maybe' 'Text'+--+-- * 'breeSenderFault' @::@ 'Bool'+--+batchResultErrorEntry :: Text -- ^ 'breeId'+ -> Bool -- ^ 'breeSenderFault'+ -> Text -- ^ 'breeCode'+ -> BatchResultErrorEntry+batchResultErrorEntry p1 p2 p3 = BatchResultErrorEntry+ { _breeId = p1+ , _breeSenderFault = p2+ , _breeCode = p3+ , _breeMessage = Nothing+ }++-- | An error code representing why the action failed on this entry.+breeCode :: Lens' BatchResultErrorEntry Text+breeCode = lens _breeCode (\s a -> s { _breeCode = a })++-- | The id of an entry in a batch request.+breeId :: Lens' BatchResultErrorEntry Text+breeId = lens _breeId (\s a -> s { _breeId = a })++-- | A message explaining why the action failed on this entry.+breeMessage :: Lens' BatchResultErrorEntry (Maybe Text)+breeMessage = lens _breeMessage (\s a -> s { _breeMessage = a })++-- | Whether the error happened due to the sender's fault.+breeSenderFault :: Lens' BatchResultErrorEntry Bool+breeSenderFault = lens _breeSenderFault (\s a -> s { _breeSenderFault = a })++instance FromXML BatchResultErrorEntry where+ parseXML x = BatchResultErrorEntry+ <$> x .@ "Code"+ <*> x .@ "Id"+ <*> x .@? "Message"+ <*> x .@ "SenderFault"++instance ToQuery BatchResultErrorEntry where+ toQuery BatchResultErrorEntry{..} = mconcat+ [ "Code" =? _breeCode+ , "Id" =? _breeId+ , "Message" =? _breeMessage+ , "SenderFault" =? _breeSenderFault+ ]