amazonka-sns (empty) → 0.0.0
raw patch · 31 files changed
+3948/−0 lines, 31 filesdep +amazonka-coredep +basesetup-changed
Dependencies added: amazonka-core, base
Files
- LICENSE +373/−0
- README.md +26/−0
- Setup.hs +2/−0
- amazonka-sns.cabal +76/−0
- gen/Network/AWS/SNS.hs +76/−0
- gen/Network/AWS/SNS/AddPermission.hs +123/−0
- gen/Network/AWS/SNS/ConfirmSubscription.hs +137/−0
- gen/Network/AWS/SNS/CreatePlatformApplication.hs +146/−0
- gen/Network/AWS/SNS/CreatePlatformEndpoint.hs +159/−0
- gen/Network/AWS/SNS/CreateTopic.hs +112/−0
- gen/Network/AWS/SNS/DeleteEndpoint.hs +89/−0
- gen/Network/AWS/SNS/DeletePlatformApplication.hs +92/−0
- gen/Network/AWS/SNS/DeleteTopic.hs +91/−0
- gen/Network/AWS/SNS/GetEndpointAttributes.hs +117/−0
- gen/Network/AWS/SNS/GetPlatformApplicationAttributes.hs +117/−0
- gen/Network/AWS/SNS/GetSubscriptionAttributes.hs +115/−0
- gen/Network/AWS/SNS/GetTopicAttributes.hs +118/−0
- gen/Network/AWS/SNS/ListEndpointsByPlatformApplication.hs +147/−0
- gen/Network/AWS/SNS/ListPlatformApplications.hs +135/−0
- gen/Network/AWS/SNS/ListSubscriptions.hs +125/−0
- gen/Network/AWS/SNS/ListSubscriptionsByTopic.hs +138/−0
- gen/Network/AWS/SNS/ListTopics.hs +125/−0
- gen/Network/AWS/SNS/Publish.hs +202/−0
- gen/Network/AWS/SNS/RemovePermission.hs +99/−0
- gen/Network/AWS/SNS/SetEndpointAttributes.hs +109/−0
- gen/Network/AWS/SNS/SetPlatformApplicationAttributes.hs +116/−0
- gen/Network/AWS/SNS/SetSubscriptionAttributes.hs +114/−0
- gen/Network/AWS/SNS/SetTopicAttributes.hs +112/−0
- gen/Network/AWS/SNS/Subscribe.hs +146/−0
- gen/Network/AWS/SNS/Types.hs +317/−0
- gen/Network/AWS/SNS/Unsubscribe.hs +94/−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 Notification 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 Notification Service (Amazon SNS) is a fast, flexible, fully managed push messaging service. Amazon SNS makes it simple and cost-effective to push notifications to Apple, Google, Fire OS, and Windows devices, as well as Android devices in China with Baidu Cloud Push. You can also use SNS to push notifications to internet connected smart devices, as well as other distributed services. Besides pushing cloud notifications directly to mobile devices, Amazon SNS can also deliver notifications by SMS text message or email, to Amazon Simple Queue Service (SQS) queues, or to any HTTP endpoint. To prevent messages from being lost, all messages published to Amazon SNS are stored redundantly across multiple availability zones.++Documentation is available via [Hackage](http://hackage.haskell.org/package/amazonka-sns)+and [AWS API Reference](http://docs.aws.amazon.com/sns/latest/api/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-sns` 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-sns.cabal view
@@ -0,0 +1,76 @@+name: amazonka-sns+version: 0.0.0+synopsis: Amazon Simple Notification 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 Notification Service (Amazon SNS) is a fast, flexible,+ fully managed push messaging service. Amazon SNS makes it simple and+ cost-effective to push notifications to Apple, Google, Fire OS, and+ Windows devices, as well as Android devices in China with Baidu Cloud+ Push. You can also use SNS to push notifications to internet connected+ smart devices, as well as other distributed services. Besides pushing+ cloud notifications directly to mobile devices, Amazon SNS can also+ deliver notifications by SMS text message or email, to Amazon Simple+ Queue Service (SQS) queues, or to any HTTP endpoint. To prevent+ messages from being lost, all messages published to Amazon SNS are+ stored redundantly across multiple availability zones.+ .+ /See:/ <http://docs.aws.amazon.com/sns/latest/api/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.SNS+ , Network.AWS.SNS.AddPermission+ , Network.AWS.SNS.ConfirmSubscription+ , Network.AWS.SNS.CreatePlatformApplication+ , Network.AWS.SNS.CreatePlatformEndpoint+ , Network.AWS.SNS.CreateTopic+ , Network.AWS.SNS.DeleteEndpoint+ , Network.AWS.SNS.DeletePlatformApplication+ , Network.AWS.SNS.DeleteTopic+ , Network.AWS.SNS.GetEndpointAttributes+ , Network.AWS.SNS.GetPlatformApplicationAttributes+ , Network.AWS.SNS.GetSubscriptionAttributes+ , Network.AWS.SNS.GetTopicAttributes+ , Network.AWS.SNS.ListEndpointsByPlatformApplication+ , Network.AWS.SNS.ListPlatformApplications+ , Network.AWS.SNS.ListSubscriptions+ , Network.AWS.SNS.ListSubscriptionsByTopic+ , Network.AWS.SNS.ListTopics+ , Network.AWS.SNS.Publish+ , Network.AWS.SNS.RemovePermission+ , Network.AWS.SNS.SetEndpointAttributes+ , Network.AWS.SNS.SetPlatformApplicationAttributes+ , Network.AWS.SNS.SetSubscriptionAttributes+ , Network.AWS.SNS.SetTopicAttributes+ , Network.AWS.SNS.Subscribe+ , Network.AWS.SNS.Types+ , Network.AWS.SNS.Unsubscribe++ other-modules:++ build-depends:+ amazonka-core+ , base >= 4.7 && < 5
+ gen/Network/AWS/SNS.hs view
@@ -0,0 +1,76 @@+-- Module : Network.AWS.SNS+-- 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 Notification Service (Amazon SNS) is a fast, flexible, fully+-- managed push messaging service. Amazon SNS makes it simple and+-- cost-effective to push notifications to Apple, Google, Fire OS, and Windows+-- devices, as well as Android devices in China with Baidu Cloud Push. You can+-- also use SNS to push notifications to internet connected smart devices, as+-- well as other distributed services. Besides pushing cloud notifications+-- directly to mobile devices, Amazon SNS can also deliver notifications by+-- SMS text message or email, to Amazon Simple Queue Service (SQS) queues, or+-- to any HTTP endpoint. To prevent messages from being lost, all messages+-- published to Amazon SNS are stored redundantly across multiple availability+-- zones.+module Network.AWS.SNS+ ( module Network.AWS.SNS.AddPermission+ , module Network.AWS.SNS.ConfirmSubscription+ , module Network.AWS.SNS.CreatePlatformApplication+ , module Network.AWS.SNS.CreatePlatformEndpoint+ , module Network.AWS.SNS.CreateTopic+ , module Network.AWS.SNS.DeleteEndpoint+ , module Network.AWS.SNS.DeletePlatformApplication+ , module Network.AWS.SNS.DeleteTopic+ , module Network.AWS.SNS.GetEndpointAttributes+ , module Network.AWS.SNS.GetPlatformApplicationAttributes+ , module Network.AWS.SNS.GetSubscriptionAttributes+ , module Network.AWS.SNS.GetTopicAttributes+ , module Network.AWS.SNS.ListEndpointsByPlatformApplication+ , module Network.AWS.SNS.ListPlatformApplications+ , module Network.AWS.SNS.ListSubscriptions+ , module Network.AWS.SNS.ListSubscriptionsByTopic+ , module Network.AWS.SNS.ListTopics+ , module Network.AWS.SNS.Publish+ , module Network.AWS.SNS.RemovePermission+ , module Network.AWS.SNS.SetEndpointAttributes+ , module Network.AWS.SNS.SetPlatformApplicationAttributes+ , module Network.AWS.SNS.SetSubscriptionAttributes+ , module Network.AWS.SNS.SetTopicAttributes+ , module Network.AWS.SNS.Subscribe+ , module Network.AWS.SNS.Types+ , module Network.AWS.SNS.Unsubscribe+ ) where++import Network.AWS.SNS.AddPermission+import Network.AWS.SNS.ConfirmSubscription+import Network.AWS.SNS.CreatePlatformApplication+import Network.AWS.SNS.CreatePlatformEndpoint+import Network.AWS.SNS.CreateTopic+import Network.AWS.SNS.DeleteEndpoint+import Network.AWS.SNS.DeletePlatformApplication+import Network.AWS.SNS.DeleteTopic+import Network.AWS.SNS.GetEndpointAttributes+import Network.AWS.SNS.GetPlatformApplicationAttributes+import Network.AWS.SNS.GetSubscriptionAttributes+import Network.AWS.SNS.GetTopicAttributes+import Network.AWS.SNS.ListEndpointsByPlatformApplication+import Network.AWS.SNS.ListPlatformApplications+import Network.AWS.SNS.ListSubscriptions+import Network.AWS.SNS.ListSubscriptionsByTopic+import Network.AWS.SNS.ListTopics+import Network.AWS.SNS.Publish+import Network.AWS.SNS.RemovePermission+import Network.AWS.SNS.SetEndpointAttributes+import Network.AWS.SNS.SetPlatformApplicationAttributes+import Network.AWS.SNS.SetSubscriptionAttributes+import Network.AWS.SNS.SetTopicAttributes+import Network.AWS.SNS.Subscribe+import Network.AWS.SNS.Types+import Network.AWS.SNS.Unsubscribe
+ gen/Network/AWS/SNS/AddPermission.hs view
@@ -0,0 +1,123 @@+{-# 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.SNS.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 statement to a topic's access control policy, granting access for+-- the specified AWS accounts to the specified actions.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_AddPermission.html>+module Network.AWS.SNS.AddPermission+ (+ -- * Request+ AddPermission+ -- ** Request constructor+ , addPermission+ -- ** Request lenses+ , apAWSAccountId+ , apActionName+ , apLabel+ , apTopicArn++ -- * Response+ , AddPermissionResponse+ -- ** Response constructor+ , addPermissionResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++data AddPermission = AddPermission+ { _apAWSAccountId :: List "AWSAccountId" Text+ , _apActionName :: List "ActionName" Text+ , _apLabel :: Text+ , _apTopicArn :: Text+ } deriving (Eq, Ord, Show)++-- | 'AddPermission' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'apAWSAccountId' @::@ ['Text']+--+-- * 'apActionName' @::@ ['Text']+--+-- * 'apLabel' @::@ 'Text'+--+-- * 'apTopicArn' @::@ 'Text'+--+addPermission :: Text -- ^ 'apTopicArn'+ -> Text -- ^ 'apLabel'+ -> AddPermission+addPermission p1 p2 = AddPermission+ { _apTopicArn = p1+ , _apLabel = p2+ , _apAWSAccountId = mempty+ , _apActionName = mempty+ }++-- | The AWS account IDs of the users (principals) who will be given access to+-- the specified actions. The users must have AWS accounts, but do not need+-- to be signed up for this service.+apAWSAccountId :: Lens' AddPermission [Text]+apAWSAccountId = lens _apAWSAccountId (\s a -> s { _apAWSAccountId = a }) . _List++-- | The action you want to allow for the specified principal(s). Valid+-- values: any Amazon SNS action name.+apActionName :: Lens' AddPermission [Text]+apActionName = lens _apActionName (\s a -> s { _apActionName = a }) . _List++-- | A unique identifier for the new policy statement.+apLabel :: Lens' AddPermission Text+apLabel = lens _apLabel (\s a -> s { _apLabel = a })++-- | The ARN of the topic whose access control policy you wish to modify.+apTopicArn :: Lens' AddPermission Text+apTopicArn = lens _apTopicArn (\s a -> s { _apTopicArn = 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+ [ "AWSAccountId" =? _apAWSAccountId+ , "ActionName" =? _apActionName+ , "Label" =? _apLabel+ , "TopicArn" =? _apTopicArn+ ]++instance ToHeaders AddPermission++instance AWSRequest AddPermission where+ type Sv AddPermission = SNS+ type Rs AddPermission = AddPermissionResponse++ request = post "AddPermission"+ response = nullResponse AddPermissionResponse
+ gen/Network/AWS/SNS/ConfirmSubscription.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.SNS.ConfirmSubscription+-- 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)++-- | Verifies an endpoint owner's intent to receive messages by validating the+-- token sent to the endpoint by an earlier Subscribe action. If the token is+-- valid, the action creates a new subscription and returns its Amazon+-- Resource Name (ARN). This call requires an AWS signature only when the+-- AuthenticateOnUnsubscribe flag is set to "true".+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_ConfirmSubscription.html>+module Network.AWS.SNS.ConfirmSubscription+ (+ -- * Request+ ConfirmSubscription+ -- ** Request constructor+ , confirmSubscription+ -- ** Request lenses+ , csAuthenticateOnUnsubscribe+ , csToken+ , csTopicArn++ -- * Response+ , ConfirmSubscriptionResponse+ -- ** Response constructor+ , confirmSubscriptionResponse+ -- ** Response lenses+ , csrSubscriptionArn+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++data ConfirmSubscription = ConfirmSubscription+ { _csAuthenticateOnUnsubscribe :: Maybe Text+ , _csToken :: Text+ , _csTopicArn :: Text+ } deriving (Eq, Ord, Show)++-- | 'ConfirmSubscription' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'csAuthenticateOnUnsubscribe' @::@ 'Maybe' 'Text'+--+-- * 'csToken' @::@ 'Text'+--+-- * 'csTopicArn' @::@ 'Text'+--+confirmSubscription :: Text -- ^ 'csTopicArn'+ -> Text -- ^ 'csToken'+ -> ConfirmSubscription+confirmSubscription p1 p2 = ConfirmSubscription+ { _csTopicArn = p1+ , _csToken = p2+ , _csAuthenticateOnUnsubscribe = Nothing+ }++-- | Disallows unauthenticated unsubscribes of the subscription. If the value+-- of this parameter is true and the request has an AWS signature, then only+-- the topic owner and the subscription owner can unsubscribe the endpoint.+-- The unsubscribe action requires AWS authentication.+csAuthenticateOnUnsubscribe :: Lens' ConfirmSubscription (Maybe Text)+csAuthenticateOnUnsubscribe =+ lens _csAuthenticateOnUnsubscribe+ (\s a -> s { _csAuthenticateOnUnsubscribe = a })++-- | Short-lived token sent to an endpoint during the Subscribe action.+csToken :: Lens' ConfirmSubscription Text+csToken = lens _csToken (\s a -> s { _csToken = a })++-- | The ARN of the topic for which you wish to confirm a subscription.+csTopicArn :: Lens' ConfirmSubscription Text+csTopicArn = lens _csTopicArn (\s a -> s { _csTopicArn = a })++newtype ConfirmSubscriptionResponse = ConfirmSubscriptionResponse+ { _csrSubscriptionArn :: Maybe Text+ } deriving (Eq, Ord, Show, Monoid)++-- | 'ConfirmSubscriptionResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'csrSubscriptionArn' @::@ 'Maybe' 'Text'+--+confirmSubscriptionResponse :: ConfirmSubscriptionResponse+confirmSubscriptionResponse = ConfirmSubscriptionResponse+ { _csrSubscriptionArn = Nothing+ }++-- | The ARN of the created subscription.+csrSubscriptionArn :: Lens' ConfirmSubscriptionResponse (Maybe Text)+csrSubscriptionArn =+ lens _csrSubscriptionArn (\s a -> s { _csrSubscriptionArn = a })++instance ToPath ConfirmSubscription where+ toPath = const "/"++instance ToQuery ConfirmSubscription where+ toQuery ConfirmSubscription{..} = mconcat+ [ "AuthenticateOnUnsubscribe" =? _csAuthenticateOnUnsubscribe+ , "Token" =? _csToken+ , "TopicArn" =? _csTopicArn+ ]++instance ToHeaders ConfirmSubscription++instance AWSRequest ConfirmSubscription where+ type Sv ConfirmSubscription = SNS+ type Rs ConfirmSubscription = ConfirmSubscriptionResponse++ request = post "ConfirmSubscription"+ response = xmlResponse++instance FromXML ConfirmSubscriptionResponse where+ parseXML = withElement "ConfirmSubscriptionResult" $ \x -> ConfirmSubscriptionResponse+ <$> x .@? "SubscriptionArn"
+ gen/Network/AWS/SNS/CreatePlatformApplication.hs view
@@ -0,0 +1,146 @@+{-# 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.SNS.CreatePlatformApplication+-- 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 platform application object for one of the supported push+-- notification services, such as APNS and GCM, to which devices and mobile+-- apps may register. You must specify PlatformPrincipal and+-- PlatformCredential attributes when using the CreatePlatformApplication+-- action. The PlatformPrincipal is received from the notification service.+-- For APNS/APNS_SANDBOX, PlatformPrincipal is "SSL certificate". For GCM,+-- PlatformPrincipal is not applicable. For ADM, PlatformPrincipal is "client+-- id". The PlatformCredential is also received from the notification service.+-- For APNS/APNS_SANDBOX, PlatformCredential is "private key". For GCM,+-- PlatformCredential is "API key". For ADM, PlatformCredential is "client+-- secret". The PlatformApplicationArn that is returned when using+-- CreatePlatformApplication is then used as an attribute for the+-- CreatePlatformEndpoint action. For more information, see Using Amazon SNS+-- Mobile Push Notifications.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformApplication.html>+module Network.AWS.SNS.CreatePlatformApplication+ (+ -- * Request+ CreatePlatformApplication+ -- ** Request constructor+ , createPlatformApplication+ -- ** Request lenses+ , cpaAttributes+ , cpaName+ , cpaPlatform++ -- * Response+ , CreatePlatformApplicationResponse+ -- ** Response constructor+ , createPlatformApplicationResponse+ -- ** Response lenses+ , cparPlatformApplicationArn+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++data CreatePlatformApplication = CreatePlatformApplication+ { _cpaAttributes :: EMap "entry" "key" "value" Text Text+ , _cpaName :: Text+ , _cpaPlatform :: Text+ } deriving (Eq, Show)++-- | 'CreatePlatformApplication' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cpaAttributes' @::@ 'HashMap' 'Text' 'Text'+--+-- * 'cpaName' @::@ 'Text'+--+-- * 'cpaPlatform' @::@ 'Text'+--+createPlatformApplication :: Text -- ^ 'cpaName'+ -> Text -- ^ 'cpaPlatform'+ -> CreatePlatformApplication+createPlatformApplication p1 p2 = CreatePlatformApplication+ { _cpaName = p1+ , _cpaPlatform = p2+ , _cpaAttributes = mempty+ }++-- | For a list of attributes, see SetPlatformApplicationAttributes.+cpaAttributes :: Lens' CreatePlatformApplication (HashMap Text Text)+cpaAttributes = lens _cpaAttributes (\s a -> s { _cpaAttributes = a }) . _EMap++-- | Application names must be made up of only uppercase and lowercase ASCII+-- letters, numbers, underscores, hyphens, and periods, and must be between+-- 1 and 256 characters long.+cpaName :: Lens' CreatePlatformApplication Text+cpaName = lens _cpaName (\s a -> s { _cpaName = a })++-- | The following platforms are supported: ADM (Amazon Device Messaging),+-- APNS (Apple Push Notification Service), APNS_SANDBOX, and GCM (Google+-- Cloud Messaging).+cpaPlatform :: Lens' CreatePlatformApplication Text+cpaPlatform = lens _cpaPlatform (\s a -> s { _cpaPlatform = a })++newtype CreatePlatformApplicationResponse = CreatePlatformApplicationResponse+ { _cparPlatformApplicationArn :: Maybe Text+ } deriving (Eq, Ord, Show, Monoid)++-- | 'CreatePlatformApplicationResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cparPlatformApplicationArn' @::@ 'Maybe' 'Text'+--+createPlatformApplicationResponse :: CreatePlatformApplicationResponse+createPlatformApplicationResponse = CreatePlatformApplicationResponse+ { _cparPlatformApplicationArn = Nothing+ }++-- | PlatformApplicationArn is returned.+cparPlatformApplicationArn :: Lens' CreatePlatformApplicationResponse (Maybe Text)+cparPlatformApplicationArn =+ lens _cparPlatformApplicationArn+ (\s a -> s { _cparPlatformApplicationArn = a })++instance ToPath CreatePlatformApplication where+ toPath = const "/"++instance ToQuery CreatePlatformApplication where+ toQuery CreatePlatformApplication{..} = mconcat+ [ "Attributes" =? _cpaAttributes+ , "Name" =? _cpaName+ , "Platform" =? _cpaPlatform+ ]++instance ToHeaders CreatePlatformApplication++instance AWSRequest CreatePlatformApplication where+ type Sv CreatePlatformApplication = SNS+ type Rs CreatePlatformApplication = CreatePlatformApplicationResponse++ request = post "CreatePlatformApplication"+ response = xmlResponse++instance FromXML CreatePlatformApplicationResponse where+ parseXML = withElement "CreatePlatformApplicationResult" $ \x -> CreatePlatformApplicationResponse+ <$> x .@? "PlatformApplicationArn"
+ gen/Network/AWS/SNS/CreatePlatformEndpoint.hs view
@@ -0,0 +1,159 @@+{-# 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.SNS.CreatePlatformEndpoint+-- 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 an endpoint for a device and mobile app on one of the supported+-- push notification services, such as GCM and APNS. CreatePlatformEndpoint+-- requires the PlatformApplicationArn that is returned from+-- CreatePlatformApplication. The EndpointArn that is returned when using+-- CreatePlatformEndpoint can then be used by the Publish action to send a+-- message to a mobile app or by the Subscribe action for subscription to a+-- topic. The CreatePlatformEndpoint action is idempotent, so if the requester+-- already owns an endpoint with the same device token and attributes, that+-- endpoint's ARN is returned without creating a new endpoint. For more+-- information, see Using Amazon SNS Mobile Push Notifications. When using+-- CreatePlatformEndpoint with Baidu, two attributes must be provided:+-- ChannelId and UserId. The token field must also contain the ChannelId. For+-- more information, see Creating an Amazon SNS Endpoint for Baidu.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformEndpoint.html>+module Network.AWS.SNS.CreatePlatformEndpoint+ (+ -- * Request+ CreatePlatformEndpoint+ -- ** Request constructor+ , createPlatformEndpoint+ -- ** Request lenses+ , cpeAttributes+ , cpeCustomUserData+ , cpePlatformApplicationArn+ , cpeToken++ -- * Response+ , CreatePlatformEndpointResponse+ -- ** Response constructor+ , createPlatformEndpointResponse+ -- ** Response lenses+ , cperEndpointArn+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++data CreatePlatformEndpoint = CreatePlatformEndpoint+ { _cpeAttributes :: EMap "entry" "key" "value" Text Text+ , _cpeCustomUserData :: Maybe Text+ , _cpePlatformApplicationArn :: Text+ , _cpeToken :: Text+ } deriving (Eq, Show)++-- | 'CreatePlatformEndpoint' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cpeAttributes' @::@ 'HashMap' 'Text' 'Text'+--+-- * 'cpeCustomUserData' @::@ 'Maybe' 'Text'+--+-- * 'cpePlatformApplicationArn' @::@ 'Text'+--+-- * 'cpeToken' @::@ 'Text'+--+createPlatformEndpoint :: Text -- ^ 'cpePlatformApplicationArn'+ -> Text -- ^ 'cpeToken'+ -> CreatePlatformEndpoint+createPlatformEndpoint p1 p2 = CreatePlatformEndpoint+ { _cpePlatformApplicationArn = p1+ , _cpeToken = p2+ , _cpeCustomUserData = Nothing+ , _cpeAttributes = mempty+ }++-- | For a list of attributes, see SetEndpointAttributes.+cpeAttributes :: Lens' CreatePlatformEndpoint (HashMap Text Text)+cpeAttributes = lens _cpeAttributes (\s a -> s { _cpeAttributes = a }) . _EMap++-- | Arbitrary user data to associate with the endpoint. Amazon SNS does not+-- use this data. The data must be in UTF-8 format and less than 2KB.+cpeCustomUserData :: Lens' CreatePlatformEndpoint (Maybe Text)+cpeCustomUserData =+ lens _cpeCustomUserData (\s a -> s { _cpeCustomUserData = a })++-- | PlatformApplicationArn returned from CreatePlatformApplication is used to+-- create a an endpoint.+cpePlatformApplicationArn :: Lens' CreatePlatformEndpoint Text+cpePlatformApplicationArn =+ lens _cpePlatformApplicationArn+ (\s a -> s { _cpePlatformApplicationArn = a })++-- | Unique identifier created by the notification service for an app on a+-- device. The specific name for Token will vary, depending on which+-- notification service is being used. For example, when using APNS as the+-- notification service, you need the device token. Alternatively, when+-- using GCM or ADM, the device token equivalent is called the registration+-- ID.+cpeToken :: Lens' CreatePlatformEndpoint Text+cpeToken = lens _cpeToken (\s a -> s { _cpeToken = a })++newtype CreatePlatformEndpointResponse = CreatePlatformEndpointResponse+ { _cperEndpointArn :: Maybe Text+ } deriving (Eq, Ord, Show, Monoid)++-- | 'CreatePlatformEndpointResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'cperEndpointArn' @::@ 'Maybe' 'Text'+--+createPlatformEndpointResponse :: CreatePlatformEndpointResponse+createPlatformEndpointResponse = CreatePlatformEndpointResponse+ { _cperEndpointArn = Nothing+ }++-- | EndpointArn returned from CreateEndpoint action.+cperEndpointArn :: Lens' CreatePlatformEndpointResponse (Maybe Text)+cperEndpointArn = lens _cperEndpointArn (\s a -> s { _cperEndpointArn = a })++instance ToPath CreatePlatformEndpoint where+ toPath = const "/"++instance ToQuery CreatePlatformEndpoint where+ toQuery CreatePlatformEndpoint{..} = mconcat+ [ "Attributes" =? _cpeAttributes+ , "CustomUserData" =? _cpeCustomUserData+ , "PlatformApplicationArn" =? _cpePlatformApplicationArn+ , "Token" =? _cpeToken+ ]++instance ToHeaders CreatePlatformEndpoint++instance AWSRequest CreatePlatformEndpoint where+ type Sv CreatePlatformEndpoint = SNS+ type Rs CreatePlatformEndpoint = CreatePlatformEndpointResponse++ request = post "CreatePlatformEndpoint"+ response = xmlResponse++instance FromXML CreatePlatformEndpointResponse where+ parseXML = withElement "CreatePlatformEndpointResult" $ \x -> CreatePlatformEndpointResponse+ <$> x .@? "EndpointArn"
+ gen/Network/AWS/SNS/CreateTopic.hs view
@@ -0,0 +1,112 @@+{-# 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.SNS.CreateTopic+-- 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 topic to which notifications can be published. Users can create+-- at most 3000 topics. For more information, see http://aws.amazon.com/sns.+-- This action is idempotent, so if the requester already owns a topic with+-- the specified name, that topic's ARN is returned without creating a new+-- topic.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html>+module Network.AWS.SNS.CreateTopic+ (+ -- * Request+ CreateTopic+ -- ** Request constructor+ , createTopic+ -- ** Request lenses+ , ctName++ -- * Response+ , CreateTopicResponse+ -- ** Response constructor+ , createTopicResponse+ -- ** Response lenses+ , ctrTopicArn+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++newtype CreateTopic = CreateTopic+ { _ctName :: Text+ } deriving (Eq, Ord, Show, Monoid, IsString)++-- | 'CreateTopic' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ctName' @::@ 'Text'+--+createTopic :: Text -- ^ 'ctName'+ -> CreateTopic+createTopic p1 = CreateTopic+ { _ctName = p1+ }++-- | The name of the topic you want to create. Constraints: Topic names must+-- be made up of only uppercase and lowercase ASCII letters, numbers,+-- underscores, and hyphens, and must be between 1 and 256 characters long.+ctName :: Lens' CreateTopic Text+ctName = lens _ctName (\s a -> s { _ctName = a })++newtype CreateTopicResponse = CreateTopicResponse+ { _ctrTopicArn :: Maybe Text+ } deriving (Eq, Ord, Show, Monoid)++-- | 'CreateTopicResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ctrTopicArn' @::@ 'Maybe' 'Text'+--+createTopicResponse :: CreateTopicResponse+createTopicResponse = CreateTopicResponse+ { _ctrTopicArn = Nothing+ }++-- | The Amazon Resource Name (ARN) assigned to the created topic.+ctrTopicArn :: Lens' CreateTopicResponse (Maybe Text)+ctrTopicArn = lens _ctrTopicArn (\s a -> s { _ctrTopicArn = a })++instance ToPath CreateTopic where+ toPath = const "/"++instance ToQuery CreateTopic where+ toQuery CreateTopic{..} = mconcat+ [ "Name" =? _ctName+ ]++instance ToHeaders CreateTopic++instance AWSRequest CreateTopic where+ type Sv CreateTopic = SNS+ type Rs CreateTopic = CreateTopicResponse++ request = post "CreateTopic"+ response = xmlResponse++instance FromXML CreateTopicResponse where+ parseXML = withElement "CreateTopicResult" $ \x -> CreateTopicResponse+ <$> x .@? "TopicArn"
+ gen/Network/AWS/SNS/DeleteEndpoint.hs view
@@ -0,0 +1,89 @@+{-# 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.SNS.DeleteEndpoint+-- 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 endpoint from Amazon SNS. This action is idempotent. For more+-- information, see Using Amazon SNS Mobile Push Notifications.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_DeleteEndpoint.html>+module Network.AWS.SNS.DeleteEndpoint+ (+ -- * Request+ DeleteEndpoint+ -- ** Request constructor+ , deleteEndpoint+ -- ** Request lenses+ , deEndpointArn++ -- * Response+ , DeleteEndpointResponse+ -- ** Response constructor+ , deleteEndpointResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++newtype DeleteEndpoint = DeleteEndpoint+ { _deEndpointArn :: Text+ } deriving (Eq, Ord, Show, Monoid, IsString)++-- | 'DeleteEndpoint' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'deEndpointArn' @::@ 'Text'+--+deleteEndpoint :: Text -- ^ 'deEndpointArn'+ -> DeleteEndpoint+deleteEndpoint p1 = DeleteEndpoint+ { _deEndpointArn = p1+ }++-- | EndpointArn of endpoint to delete.+deEndpointArn :: Lens' DeleteEndpoint Text+deEndpointArn = lens _deEndpointArn (\s a -> s { _deEndpointArn = a })++data DeleteEndpointResponse = DeleteEndpointResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'DeleteEndpointResponse' constructor.+deleteEndpointResponse :: DeleteEndpointResponse+deleteEndpointResponse = DeleteEndpointResponse++instance ToPath DeleteEndpoint where+ toPath = const "/"++instance ToQuery DeleteEndpoint where+ toQuery DeleteEndpoint{..} = mconcat+ [ "EndpointArn" =? _deEndpointArn+ ]++instance ToHeaders DeleteEndpoint++instance AWSRequest DeleteEndpoint where+ type Sv DeleteEndpoint = SNS+ type Rs DeleteEndpoint = DeleteEndpointResponse++ request = post "DeleteEndpoint"+ response = nullResponse DeleteEndpointResponse
+ gen/Network/AWS/SNS/DeletePlatformApplication.hs view
@@ -0,0 +1,92 @@+{-# 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.SNS.DeletePlatformApplication+-- 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 a platform application object for one of the supported push+-- notification services, such as APNS and GCM. For more information, see+-- Using Amazon SNS Mobile Push Notifications.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_DeletePlatformApplication.html>+module Network.AWS.SNS.DeletePlatformApplication+ (+ -- * Request+ DeletePlatformApplication+ -- ** Request constructor+ , deletePlatformApplication+ -- ** Request lenses+ , dpaPlatformApplicationArn++ -- * Response+ , DeletePlatformApplicationResponse+ -- ** Response constructor+ , deletePlatformApplicationResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++newtype DeletePlatformApplication = DeletePlatformApplication+ { _dpaPlatformApplicationArn :: Text+ } deriving (Eq, Ord, Show, Monoid, IsString)++-- | 'DeletePlatformApplication' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dpaPlatformApplicationArn' @::@ 'Text'+--+deletePlatformApplication :: Text -- ^ 'dpaPlatformApplicationArn'+ -> DeletePlatformApplication+deletePlatformApplication p1 = DeletePlatformApplication+ { _dpaPlatformApplicationArn = p1+ }++-- | PlatformApplicationArn of platform application object to delete.+dpaPlatformApplicationArn :: Lens' DeletePlatformApplication Text+dpaPlatformApplicationArn =+ lens _dpaPlatformApplicationArn+ (\s a -> s { _dpaPlatformApplicationArn = a })++data DeletePlatformApplicationResponse = DeletePlatformApplicationResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'DeletePlatformApplicationResponse' constructor.+deletePlatformApplicationResponse :: DeletePlatformApplicationResponse+deletePlatformApplicationResponse = DeletePlatformApplicationResponse++instance ToPath DeletePlatformApplication where+ toPath = const "/"++instance ToQuery DeletePlatformApplication where+ toQuery DeletePlatformApplication{..} = mconcat+ [ "PlatformApplicationArn" =? _dpaPlatformApplicationArn+ ]++instance ToHeaders DeletePlatformApplication++instance AWSRequest DeletePlatformApplication where+ type Sv DeletePlatformApplication = SNS+ type Rs DeletePlatformApplication = DeletePlatformApplicationResponse++ request = post "DeletePlatformApplication"+ response = nullResponse DeletePlatformApplicationResponse
+ gen/Network/AWS/SNS/DeleteTopic.hs view
@@ -0,0 +1,91 @@+{-# 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.SNS.DeleteTopic+-- 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 a topic and all its subscriptions. Deleting a topic might prevent+-- some messages previously sent to the topic from being delivered to+-- subscribers. This action is idempotent, so deleting a topic that does not+-- exist does not result in an error.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_DeleteTopic.html>+module Network.AWS.SNS.DeleteTopic+ (+ -- * Request+ DeleteTopic+ -- ** Request constructor+ , deleteTopic+ -- ** Request lenses+ , dtTopicArn++ -- * Response+ , DeleteTopicResponse+ -- ** Response constructor+ , deleteTopicResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++newtype DeleteTopic = DeleteTopic+ { _dtTopicArn :: Text+ } deriving (Eq, Ord, Show, Monoid, IsString)++-- | 'DeleteTopic' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dtTopicArn' @::@ 'Text'+--+deleteTopic :: Text -- ^ 'dtTopicArn'+ -> DeleteTopic+deleteTopic p1 = DeleteTopic+ { _dtTopicArn = p1+ }++-- | The ARN of the topic you want to delete.+dtTopicArn :: Lens' DeleteTopic Text+dtTopicArn = lens _dtTopicArn (\s a -> s { _dtTopicArn = a })++data DeleteTopicResponse = DeleteTopicResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'DeleteTopicResponse' constructor.+deleteTopicResponse :: DeleteTopicResponse+deleteTopicResponse = DeleteTopicResponse++instance ToPath DeleteTopic where+ toPath = const "/"++instance ToQuery DeleteTopic where+ toQuery DeleteTopic{..} = mconcat+ [ "TopicArn" =? _dtTopicArn+ ]++instance ToHeaders DeleteTopic++instance AWSRequest DeleteTopic where+ type Sv DeleteTopic = SNS+ type Rs DeleteTopic = DeleteTopicResponse++ request = post "DeleteTopic"+ response = nullResponse DeleteTopicResponse
+ gen/Network/AWS/SNS/GetEndpointAttributes.hs view
@@ -0,0 +1,117 @@+{-# 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.SNS.GetEndpointAttributes+-- 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 the endpoint attributes for a device on one of the supported push+-- notification services, such as GCM and APNS. For more information, see+-- Using Amazon SNS Mobile Push Notifications.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_GetEndpointAttributes.html>+module Network.AWS.SNS.GetEndpointAttributes+ (+ -- * Request+ GetEndpointAttributes+ -- ** Request constructor+ , getEndpointAttributes+ -- ** Request lenses+ , geaEndpointArn++ -- * Response+ , GetEndpointAttributesResponse+ -- ** Response constructor+ , getEndpointAttributesResponse+ -- ** Response lenses+ , gearAttributes+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++newtype GetEndpointAttributes = GetEndpointAttributes+ { _geaEndpointArn :: Text+ } deriving (Eq, Ord, Show, Monoid, IsString)++-- | 'GetEndpointAttributes' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'geaEndpointArn' @::@ 'Text'+--+getEndpointAttributes :: Text -- ^ 'geaEndpointArn'+ -> GetEndpointAttributes+getEndpointAttributes p1 = GetEndpointAttributes+ { _geaEndpointArn = p1+ }++-- | EndpointArn for GetEndpointAttributes input.+geaEndpointArn :: Lens' GetEndpointAttributes Text+geaEndpointArn = lens _geaEndpointArn (\s a -> s { _geaEndpointArn = a })++newtype GetEndpointAttributesResponse = GetEndpointAttributesResponse+ { _gearAttributes :: EMap "entry" "key" "value" Text Text+ } deriving (Eq, Show, Monoid, Semigroup)++-- | 'GetEndpointAttributesResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gearAttributes' @::@ 'HashMap' 'Text' 'Text'+--+getEndpointAttributesResponse :: GetEndpointAttributesResponse+getEndpointAttributesResponse = GetEndpointAttributesResponse+ { _gearAttributes = mempty+ }++-- | Attributes include the following: CustomUserData -- arbitrary user data+-- to associate with the endpoint. Amazon SNS does not use this data. The+-- data must be in UTF-8 format and less than 2KB. Enabled -- flag that+-- enables/disables delivery to the endpoint. Amazon SNS will set this to+-- false when a notification service indicates to Amazon SNS that the+-- endpoint is invalid. Users can set it back to true, typically after+-- updating Token. Token -- device token, also referred to as a registration+-- id, for an app and mobile device. This is returned from the notification+-- service when an app and mobile device are registered with the+-- notification service.+gearAttributes :: Lens' GetEndpointAttributesResponse (HashMap Text Text)+gearAttributes = lens _gearAttributes (\s a -> s { _gearAttributes = a }) . _EMap++instance ToPath GetEndpointAttributes where+ toPath = const "/"++instance ToQuery GetEndpointAttributes where+ toQuery GetEndpointAttributes{..} = mconcat+ [ "EndpointArn" =? _geaEndpointArn+ ]++instance ToHeaders GetEndpointAttributes++instance AWSRequest GetEndpointAttributes where+ type Sv GetEndpointAttributes = SNS+ type Rs GetEndpointAttributes = GetEndpointAttributesResponse++ request = post "GetEndpointAttributes"+ response = xmlResponse++instance FromXML GetEndpointAttributesResponse where+ parseXML = withElement "GetEndpointAttributesResult" $ \x -> GetEndpointAttributesResponse+ <$> x .@ "Attributes"
+ gen/Network/AWS/SNS/GetPlatformApplicationAttributes.hs view
@@ -0,0 +1,117 @@+{-# 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.SNS.GetPlatformApplicationAttributes+-- 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 the attributes of the platform application object for the+-- supported push notification services, such as APNS and GCM. For more+-- information, see Using Amazon SNS Mobile Push Notifications.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_GetPlatformApplicationAttributes.html>+module Network.AWS.SNS.GetPlatformApplicationAttributes+ (+ -- * Request+ GetPlatformApplicationAttributes+ -- ** Request constructor+ , getPlatformApplicationAttributes+ -- ** Request lenses+ , gpaaPlatformApplicationArn++ -- * Response+ , GetPlatformApplicationAttributesResponse+ -- ** Response constructor+ , getPlatformApplicationAttributesResponse+ -- ** Response lenses+ , gpaarAttributes+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++newtype GetPlatformApplicationAttributes = GetPlatformApplicationAttributes+ { _gpaaPlatformApplicationArn :: Text+ } deriving (Eq, Ord, Show, Monoid, IsString)++-- | 'GetPlatformApplicationAttributes' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gpaaPlatformApplicationArn' @::@ 'Text'+--+getPlatformApplicationAttributes :: Text -- ^ 'gpaaPlatformApplicationArn'+ -> GetPlatformApplicationAttributes+getPlatformApplicationAttributes p1 = GetPlatformApplicationAttributes+ { _gpaaPlatformApplicationArn = p1+ }++-- | PlatformApplicationArn for GetPlatformApplicationAttributesInput.+gpaaPlatformApplicationArn :: Lens' GetPlatformApplicationAttributes Text+gpaaPlatformApplicationArn =+ lens _gpaaPlatformApplicationArn+ (\s a -> s { _gpaaPlatformApplicationArn = a })++newtype GetPlatformApplicationAttributesResponse = GetPlatformApplicationAttributesResponse+ { _gpaarAttributes :: EMap "entry" "key" "value" Text Text+ } deriving (Eq, Show, Monoid, Semigroup)++-- | 'GetPlatformApplicationAttributesResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gpaarAttributes' @::@ 'HashMap' 'Text' 'Text'+--+getPlatformApplicationAttributesResponse :: GetPlatformApplicationAttributesResponse+getPlatformApplicationAttributesResponse = GetPlatformApplicationAttributesResponse+ { _gpaarAttributes = mempty+ }++-- | Attributes include the following: EventEndpointCreated -- Topic ARN to+-- which EndpointCreated event notifications should be sent.+-- EventEndpointDeleted -- Topic ARN to which EndpointDeleted event+-- notifications should be sent. EventEndpointUpdated -- Topic ARN to which+-- EndpointUpdate event notifications should be sent. EventDeliveryFailure+-- -- Topic ARN to which DeliveryFailure event notifications should be sent+-- upon Direct Publish delivery failure (permanent) to one of the+-- application's endpoints.+gpaarAttributes :: Lens' GetPlatformApplicationAttributesResponse (HashMap Text Text)+gpaarAttributes = lens _gpaarAttributes (\s a -> s { _gpaarAttributes = a }) . _EMap++instance ToPath GetPlatformApplicationAttributes where+ toPath = const "/"++instance ToQuery GetPlatformApplicationAttributes where+ toQuery GetPlatformApplicationAttributes{..} = mconcat+ [ "PlatformApplicationArn" =? _gpaaPlatformApplicationArn+ ]++instance ToHeaders GetPlatformApplicationAttributes++instance AWSRequest GetPlatformApplicationAttributes where+ type Sv GetPlatformApplicationAttributes = SNS+ type Rs GetPlatformApplicationAttributes = GetPlatformApplicationAttributesResponse++ request = post "GetPlatformApplicationAttributes"+ response = xmlResponse++instance FromXML GetPlatformApplicationAttributesResponse where+ parseXML = withElement "GetPlatformApplicationAttributesResult" $ \x -> GetPlatformApplicationAttributesResponse+ <$> x .@ "Attributes"
+ gen/Network/AWS/SNS/GetSubscriptionAttributes.hs view
@@ -0,0 +1,115 @@+{-# 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.SNS.GetSubscriptionAttributes+-- 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 all of the properties of a subscription.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html>+module Network.AWS.SNS.GetSubscriptionAttributes+ (+ -- * Request+ GetSubscriptionAttributes+ -- ** Request constructor+ , getSubscriptionAttributes+ -- ** Request lenses+ , gsaSubscriptionArn++ -- * Response+ , GetSubscriptionAttributesResponse+ -- ** Response constructor+ , getSubscriptionAttributesResponse+ -- ** Response lenses+ , gsarAttributes+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++newtype GetSubscriptionAttributes = GetSubscriptionAttributes+ { _gsaSubscriptionArn :: Text+ } deriving (Eq, Ord, Show, Monoid, IsString)++-- | 'GetSubscriptionAttributes' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gsaSubscriptionArn' @::@ 'Text'+--+getSubscriptionAttributes :: Text -- ^ 'gsaSubscriptionArn'+ -> GetSubscriptionAttributes+getSubscriptionAttributes p1 = GetSubscriptionAttributes+ { _gsaSubscriptionArn = p1+ }++-- | The ARN of the subscription whose properties you want to get.+gsaSubscriptionArn :: Lens' GetSubscriptionAttributes Text+gsaSubscriptionArn =+ lens _gsaSubscriptionArn (\s a -> s { _gsaSubscriptionArn = a })++newtype GetSubscriptionAttributesResponse = GetSubscriptionAttributesResponse+ { _gsarAttributes :: EMap "entry" "key" "value" Text Text+ } deriving (Eq, Show, Monoid, Semigroup)++-- | 'GetSubscriptionAttributesResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gsarAttributes' @::@ 'HashMap' 'Text' 'Text'+--+getSubscriptionAttributesResponse :: GetSubscriptionAttributesResponse+getSubscriptionAttributesResponse = GetSubscriptionAttributesResponse+ { _gsarAttributes = mempty+ }++-- | A map of the subscription's attributes. Attributes in this map include+-- the following: SubscriptionArn -- the subscription's ARN TopicArn -- the+-- topic ARN that the subscription is associated with Owner -- the AWS+-- account ID of the subscription's owner ConfirmationWasAuthenticated --+-- true if the subscription confirmation request was authenticated+-- DeliveryPolicy -- the JSON serialization of the subscription's delivery+-- policy EffectiveDeliveryPolicy -- the JSON serialization of the effective+-- delivery policy that takes into account the topic delivery policy and+-- account system defaults.+gsarAttributes :: Lens' GetSubscriptionAttributesResponse (HashMap Text Text)+gsarAttributes = lens _gsarAttributes (\s a -> s { _gsarAttributes = a }) . _EMap++instance ToPath GetSubscriptionAttributes where+ toPath = const "/"++instance ToQuery GetSubscriptionAttributes where+ toQuery GetSubscriptionAttributes{..} = mconcat+ [ "SubscriptionArn" =? _gsaSubscriptionArn+ ]++instance ToHeaders GetSubscriptionAttributes++instance AWSRequest GetSubscriptionAttributes where+ type Sv GetSubscriptionAttributes = SNS+ type Rs GetSubscriptionAttributes = GetSubscriptionAttributesResponse++ request = post "GetSubscriptionAttributes"+ response = xmlResponse++instance FromXML GetSubscriptionAttributesResponse where+ parseXML = withElement "GetSubscriptionAttributesResult" $ \x -> GetSubscriptionAttributesResponse+ <$> x .@ "Attributes"
+ gen/Network/AWS/SNS/GetTopicAttributes.hs view
@@ -0,0 +1,118 @@+{-# 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.SNS.GetTopicAttributes+-- 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 all of the properties of a topic. Topic properties returned might+-- differ based on the authorization of the user.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_GetTopicAttributes.html>+module Network.AWS.SNS.GetTopicAttributes+ (+ -- * Request+ GetTopicAttributes+ -- ** Request constructor+ , getTopicAttributes+ -- ** Request lenses+ , gtaTopicArn++ -- * Response+ , GetTopicAttributesResponse+ -- ** Response constructor+ , getTopicAttributesResponse+ -- ** Response lenses+ , gtarAttributes+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++newtype GetTopicAttributes = GetTopicAttributes+ { _gtaTopicArn :: Text+ } deriving (Eq, Ord, Show, Monoid, IsString)++-- | 'GetTopicAttributes' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gtaTopicArn' @::@ 'Text'+--+getTopicAttributes :: Text -- ^ 'gtaTopicArn'+ -> GetTopicAttributes+getTopicAttributes p1 = GetTopicAttributes+ { _gtaTopicArn = p1+ }++-- | The ARN of the topic whose properties you want to get.+gtaTopicArn :: Lens' GetTopicAttributes Text+gtaTopicArn = lens _gtaTopicArn (\s a -> s { _gtaTopicArn = a })++newtype GetTopicAttributesResponse = GetTopicAttributesResponse+ { _gtarAttributes :: EMap "entry" "key" "value" Text Text+ } deriving (Eq, Show, Monoid, Semigroup)++-- | 'GetTopicAttributesResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gtarAttributes' @::@ 'HashMap' 'Text' 'Text'+--+getTopicAttributesResponse :: GetTopicAttributesResponse+getTopicAttributesResponse = GetTopicAttributesResponse+ { _gtarAttributes = mempty+ }++-- | A map of the topic's attributes. Attributes in this map include the+-- following: TopicArn -- the topic's ARN Owner -- the AWS account ID of the+-- topic's owner Policy -- the JSON serialization of the topic's access+-- control policy DisplayName -- the human-readable name used in the "From"+-- field for notifications to email and email-json endpoints+-- SubscriptionsPending -- the number of subscriptions pending confirmation+-- on this topic SubscriptionsConfirmed -- the number of confirmed+-- subscriptions on this topic SubscriptionsDeleted -- the number of deleted+-- subscriptions on this topic DeliveryPolicy -- the JSON serialization of+-- the topic's delivery policy EffectiveDeliveryPolicy -- the JSON+-- serialization of the effective delivery policy that takes into account+-- system defaults.+gtarAttributes :: Lens' GetTopicAttributesResponse (HashMap Text Text)+gtarAttributes = lens _gtarAttributes (\s a -> s { _gtarAttributes = a }) . _EMap++instance ToPath GetTopicAttributes where+ toPath = const "/"++instance ToQuery GetTopicAttributes where+ toQuery GetTopicAttributes{..} = mconcat+ [ "TopicArn" =? _gtaTopicArn+ ]++instance ToHeaders GetTopicAttributes++instance AWSRequest GetTopicAttributes where+ type Sv GetTopicAttributes = SNS+ type Rs GetTopicAttributes = GetTopicAttributesResponse++ request = post "GetTopicAttributes"+ response = xmlResponse++instance FromXML GetTopicAttributesResponse where+ parseXML = withElement "GetTopicAttributesResult" $ \x -> GetTopicAttributesResponse+ <$> x .@ "Attributes"
+ gen/Network/AWS/SNS/ListEndpointsByPlatformApplication.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.SNS.ListEndpointsByPlatformApplication+-- 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)++-- | Lists the endpoints and endpoint attributes for devices in a supported push+-- notification service, such as GCM and APNS. The results for+-- ListEndpointsByPlatformApplication are paginated and return a limited list+-- of endpoints, up to 100. If additional records are available after the+-- first page results, then a NextToken string will be returned. To receive+-- the next page, you call ListEndpointsByPlatformApplication again using the+-- NextToken string received from the previous call. When there are no more+-- records to return, NextToken will be null. For more information, see Using+-- Amazon SNS Mobile Push Notifications.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_ListEndpointsByPlatformApplication.html>+module Network.AWS.SNS.ListEndpointsByPlatformApplication+ (+ -- * Request+ ListEndpointsByPlatformApplication+ -- ** Request constructor+ , listEndpointsByPlatformApplication+ -- ** Request lenses+ , lebpaNextToken+ , lebpaPlatformApplicationArn++ -- * Response+ , ListEndpointsByPlatformApplicationResponse+ -- ** Response constructor+ , listEndpointsByPlatformApplicationResponse+ -- ** Response lenses+ , lebparEndpoints+ , lebparNextToken+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++data ListEndpointsByPlatformApplication = ListEndpointsByPlatformApplication+ { _lebpaNextToken :: Maybe Text+ , _lebpaPlatformApplicationArn :: Text+ } deriving (Eq, Ord, Show)++-- | 'ListEndpointsByPlatformApplication' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lebpaNextToken' @::@ 'Maybe' 'Text'+--+-- * 'lebpaPlatformApplicationArn' @::@ 'Text'+--+listEndpointsByPlatformApplication :: Text -- ^ 'lebpaPlatformApplicationArn'+ -> ListEndpointsByPlatformApplication+listEndpointsByPlatformApplication p1 = ListEndpointsByPlatformApplication+ { _lebpaPlatformApplicationArn = p1+ , _lebpaNextToken = Nothing+ }++-- | NextToken string is used when calling ListEndpointsByPlatformApplication+-- action to retrieve additional records that are available after the first+-- page results.+lebpaNextToken :: Lens' ListEndpointsByPlatformApplication (Maybe Text)+lebpaNextToken = lens _lebpaNextToken (\s a -> s { _lebpaNextToken = a })++-- | PlatformApplicationArn for ListEndpointsByPlatformApplicationInput+-- action.+lebpaPlatformApplicationArn :: Lens' ListEndpointsByPlatformApplication Text+lebpaPlatformApplicationArn =+ lens _lebpaPlatformApplicationArn+ (\s a -> s { _lebpaPlatformApplicationArn = a })++data ListEndpointsByPlatformApplicationResponse = ListEndpointsByPlatformApplicationResponse+ { _lebparEndpoints :: List "Endpoints" Endpoint+ , _lebparNextToken :: Maybe Text+ } deriving (Eq, Show)++-- | 'ListEndpointsByPlatformApplicationResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lebparEndpoints' @::@ ['Endpoint']+--+-- * 'lebparNextToken' @::@ 'Maybe' 'Text'+--+listEndpointsByPlatformApplicationResponse :: ListEndpointsByPlatformApplicationResponse+listEndpointsByPlatformApplicationResponse = ListEndpointsByPlatformApplicationResponse+ { _lebparEndpoints = mempty+ , _lebparNextToken = Nothing+ }++-- | Endpoints returned for ListEndpointsByPlatformApplication action.+lebparEndpoints :: Lens' ListEndpointsByPlatformApplicationResponse [Endpoint]+lebparEndpoints = lens _lebparEndpoints (\s a -> s { _lebparEndpoints = a }) . _List++-- | NextToken string is returned when calling+-- ListEndpointsByPlatformApplication action if additional records are+-- available after the first page results.+lebparNextToken :: Lens' ListEndpointsByPlatformApplicationResponse (Maybe Text)+lebparNextToken = lens _lebparNextToken (\s a -> s { _lebparNextToken = a })++instance ToPath ListEndpointsByPlatformApplication where+ toPath = const "/"++instance ToQuery ListEndpointsByPlatformApplication where+ toQuery ListEndpointsByPlatformApplication{..} = mconcat+ [ "NextToken" =? _lebpaNextToken+ , "PlatformApplicationArn" =? _lebpaPlatformApplicationArn+ ]++instance ToHeaders ListEndpointsByPlatformApplication++instance AWSRequest ListEndpointsByPlatformApplication where+ type Sv ListEndpointsByPlatformApplication = SNS+ type Rs ListEndpointsByPlatformApplication = ListEndpointsByPlatformApplicationResponse++ request = post "ListEndpointsByPlatformApplication"+ response = xmlResponse++instance FromXML ListEndpointsByPlatformApplicationResponse where+ parseXML = withElement "ListEndpointsByPlatformApplicationResult" $ \x -> ListEndpointsByPlatformApplicationResponse+ <$> x .@ "Endpoints"+ <*> x .@? "NextToken"++instance AWSPager ListEndpointsByPlatformApplication where+ page rq rs+ | stop (rq ^. lebpaNextToken) = Nothing+ | otherwise = (\x -> rq & lebpaNextToken ?~ x)+ <$> (rs ^. lebparNextToken)
+ gen/Network/AWS/SNS/ListPlatformApplications.hs view
@@ -0,0 +1,135 @@+{-# 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.SNS.ListPlatformApplications+-- 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)++-- | Lists the platform application objects for the supported push notification+-- services, such as APNS and GCM. The results for ListPlatformApplications+-- are paginated and return a limited list of applications, up to 100. If+-- additional records are available after the first page results, then a+-- NextToken string will be returned. To receive the next page, you call+-- ListPlatformApplications using the NextToken string received from the+-- previous call. When there are no more records to return, NextToken will be+-- null. For more information, see Using Amazon SNS Mobile Push Notifications.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_ListPlatformApplications.html>+module Network.AWS.SNS.ListPlatformApplications+ (+ -- * Request+ ListPlatformApplications+ -- ** Request constructor+ , listPlatformApplications+ -- ** Request lenses+ , lpaNextToken++ -- * Response+ , ListPlatformApplicationsResponse+ -- ** Response constructor+ , listPlatformApplicationsResponse+ -- ** Response lenses+ , lparNextToken+ , lparPlatformApplications+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++newtype ListPlatformApplications = ListPlatformApplications+ { _lpaNextToken :: Maybe Text+ } deriving (Eq, Ord, Show, Monoid)++-- | 'ListPlatformApplications' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lpaNextToken' @::@ 'Maybe' 'Text'+--+listPlatformApplications :: ListPlatformApplications+listPlatformApplications = ListPlatformApplications+ { _lpaNextToken = Nothing+ }++-- | NextToken string is used when calling ListPlatformApplications action to+-- retrieve additional records that are available after the first page+-- results.+lpaNextToken :: Lens' ListPlatformApplications (Maybe Text)+lpaNextToken = lens _lpaNextToken (\s a -> s { _lpaNextToken = a })++data ListPlatformApplicationsResponse = ListPlatformApplicationsResponse+ { _lparNextToken :: Maybe Text+ , _lparPlatformApplications :: List "PlatformApplications" PlatformApplication+ } deriving (Eq, Show)++-- | 'ListPlatformApplicationsResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lparNextToken' @::@ 'Maybe' 'Text'+--+-- * 'lparPlatformApplications' @::@ ['PlatformApplication']+--+listPlatformApplicationsResponse :: ListPlatformApplicationsResponse+listPlatformApplicationsResponse = ListPlatformApplicationsResponse+ { _lparPlatformApplications = mempty+ , _lparNextToken = Nothing+ }++-- | NextToken string is returned when calling ListPlatformApplications action+-- if additional records are available after the first page results.+lparNextToken :: Lens' ListPlatformApplicationsResponse (Maybe Text)+lparNextToken = lens _lparNextToken (\s a -> s { _lparNextToken = a })++-- | Platform applications returned when calling ListPlatformApplications+-- action.+lparPlatformApplications :: Lens' ListPlatformApplicationsResponse [PlatformApplication]+lparPlatformApplications =+ lens _lparPlatformApplications+ (\s a -> s { _lparPlatformApplications = a })+ . _List++instance ToPath ListPlatformApplications where+ toPath = const "/"++instance ToQuery ListPlatformApplications where+ toQuery ListPlatformApplications{..} = mconcat+ [ "NextToken" =? _lpaNextToken+ ]++instance ToHeaders ListPlatformApplications++instance AWSRequest ListPlatformApplications where+ type Sv ListPlatformApplications = SNS+ type Rs ListPlatformApplications = ListPlatformApplicationsResponse++ request = post "ListPlatformApplications"+ response = xmlResponse++instance FromXML ListPlatformApplicationsResponse where+ parseXML = withElement "ListPlatformApplicationsResult" $ \x -> ListPlatformApplicationsResponse+ <$> x .@? "NextToken"+ <*> x .@ "PlatformApplications"++instance AWSPager ListPlatformApplications where+ page rq rs+ | stop (rq ^. lpaNextToken) = Nothing+ | otherwise = (\x -> rq & lpaNextToken ?~ x)+ <$> (rs ^. lparNextToken)
+ gen/Network/AWS/SNS/ListSubscriptions.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.SNS.ListSubscriptions+-- 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 the requester's subscriptions. Each call returns a+-- limited list of subscriptions, up to 100. If there are more subscriptions,+-- a NextToken is also returned. Use the NextToken parameter in a new+-- ListSubscriptions call to get further results.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_ListSubscriptions.html>+module Network.AWS.SNS.ListSubscriptions+ (+ -- * Request+ ListSubscriptions+ -- ** Request constructor+ , listSubscriptions+ -- ** Request lenses+ , lsNextToken++ -- * Response+ , ListSubscriptionsResponse+ -- ** Response constructor+ , listSubscriptionsResponse+ -- ** Response lenses+ , lsrNextToken+ , lsrSubscriptions+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++newtype ListSubscriptions = ListSubscriptions+ { _lsNextToken :: Maybe Text+ } deriving (Eq, Ord, Show, Monoid)++-- | 'ListSubscriptions' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lsNextToken' @::@ 'Maybe' 'Text'+--+listSubscriptions :: ListSubscriptions+listSubscriptions = ListSubscriptions+ { _lsNextToken = Nothing+ }++-- | Token returned by the previous ListSubscriptions request.+lsNextToken :: Lens' ListSubscriptions (Maybe Text)+lsNextToken = lens _lsNextToken (\s a -> s { _lsNextToken = a })++data ListSubscriptionsResponse = ListSubscriptionsResponse+ { _lsrNextToken :: Maybe Text+ , _lsrSubscriptions :: List "Subscriptions" Subscription+ } deriving (Eq, Show)++-- | 'ListSubscriptionsResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lsrNextToken' @::@ 'Maybe' 'Text'+--+-- * 'lsrSubscriptions' @::@ ['Subscription']+--+listSubscriptionsResponse :: ListSubscriptionsResponse+listSubscriptionsResponse = ListSubscriptionsResponse+ { _lsrSubscriptions = mempty+ , _lsrNextToken = Nothing+ }++-- | Token to pass along to the next ListSubscriptions request. This element+-- is returned if there are more subscriptions to retrieve.+lsrNextToken :: Lens' ListSubscriptionsResponse (Maybe Text)+lsrNextToken = lens _lsrNextToken (\s a -> s { _lsrNextToken = a })++-- | A list of subscriptions.+lsrSubscriptions :: Lens' ListSubscriptionsResponse [Subscription]+lsrSubscriptions = lens _lsrSubscriptions (\s a -> s { _lsrSubscriptions = a }) . _List++instance ToPath ListSubscriptions where+ toPath = const "/"++instance ToQuery ListSubscriptions where+ toQuery ListSubscriptions{..} = mconcat+ [ "NextToken" =? _lsNextToken+ ]++instance ToHeaders ListSubscriptions++instance AWSRequest ListSubscriptions where+ type Sv ListSubscriptions = SNS+ type Rs ListSubscriptions = ListSubscriptionsResponse++ request = post "ListSubscriptions"+ response = xmlResponse++instance FromXML ListSubscriptionsResponse where+ parseXML = withElement "ListSubscriptionsResult" $ \x -> ListSubscriptionsResponse+ <$> x .@? "NextToken"+ <*> x .@ "Subscriptions"++instance AWSPager ListSubscriptions where+ page rq rs+ | stop (rq ^. lsNextToken) = Nothing+ | otherwise = (\x -> rq & lsNextToken ?~ x)+ <$> (rs ^. lsrNextToken)
+ gen/Network/AWS/SNS/ListSubscriptionsByTopic.hs view
@@ -0,0 +1,138 @@+{-# 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.SNS.ListSubscriptionsByTopic+-- 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 the subscriptions to a specific topic. Each call returns+-- a limited list of subscriptions, up to 100. If there are more+-- subscriptions, a NextToken is also returned. Use the NextToken parameter in+-- a new ListSubscriptionsByTopic call to get further results.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_ListSubscriptionsByTopic.html>+module Network.AWS.SNS.ListSubscriptionsByTopic+ (+ -- * Request+ ListSubscriptionsByTopic+ -- ** Request constructor+ , listSubscriptionsByTopic+ -- ** Request lenses+ , lsbtNextToken+ , lsbtTopicArn++ -- * Response+ , ListSubscriptionsByTopicResponse+ -- ** Response constructor+ , listSubscriptionsByTopicResponse+ -- ** Response lenses+ , lsbtrNextToken+ , lsbtrSubscriptions+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++data ListSubscriptionsByTopic = ListSubscriptionsByTopic+ { _lsbtNextToken :: Maybe Text+ , _lsbtTopicArn :: Text+ } deriving (Eq, Ord, Show)++-- | 'ListSubscriptionsByTopic' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lsbtNextToken' @::@ 'Maybe' 'Text'+--+-- * 'lsbtTopicArn' @::@ 'Text'+--+listSubscriptionsByTopic :: Text -- ^ 'lsbtTopicArn'+ -> ListSubscriptionsByTopic+listSubscriptionsByTopic p1 = ListSubscriptionsByTopic+ { _lsbtTopicArn = p1+ , _lsbtNextToken = Nothing+ }++-- | Token returned by the previous ListSubscriptionsByTopic request.+lsbtNextToken :: Lens' ListSubscriptionsByTopic (Maybe Text)+lsbtNextToken = lens _lsbtNextToken (\s a -> s { _lsbtNextToken = a })++-- | The ARN of the topic for which you wish to find subscriptions.+lsbtTopicArn :: Lens' ListSubscriptionsByTopic Text+lsbtTopicArn = lens _lsbtTopicArn (\s a -> s { _lsbtTopicArn = a })++data ListSubscriptionsByTopicResponse = ListSubscriptionsByTopicResponse+ { _lsbtrNextToken :: Maybe Text+ , _lsbtrSubscriptions :: List "Subscriptions" Subscription+ } deriving (Eq, Show)++-- | 'ListSubscriptionsByTopicResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lsbtrNextToken' @::@ 'Maybe' 'Text'+--+-- * 'lsbtrSubscriptions' @::@ ['Subscription']+--+listSubscriptionsByTopicResponse :: ListSubscriptionsByTopicResponse+listSubscriptionsByTopicResponse = ListSubscriptionsByTopicResponse+ { _lsbtrSubscriptions = mempty+ , _lsbtrNextToken = Nothing+ }++-- | Token to pass along to the next ListSubscriptionsByTopic request. This+-- element is returned if there are more subscriptions to retrieve.+lsbtrNextToken :: Lens' ListSubscriptionsByTopicResponse (Maybe Text)+lsbtrNextToken = lens _lsbtrNextToken (\s a -> s { _lsbtrNextToken = a })++-- | A list of subscriptions.+lsbtrSubscriptions :: Lens' ListSubscriptionsByTopicResponse [Subscription]+lsbtrSubscriptions =+ lens _lsbtrSubscriptions (\s a -> s { _lsbtrSubscriptions = a })+ . _List++instance ToPath ListSubscriptionsByTopic where+ toPath = const "/"++instance ToQuery ListSubscriptionsByTopic where+ toQuery ListSubscriptionsByTopic{..} = mconcat+ [ "NextToken" =? _lsbtNextToken+ , "TopicArn" =? _lsbtTopicArn+ ]++instance ToHeaders ListSubscriptionsByTopic++instance AWSRequest ListSubscriptionsByTopic where+ type Sv ListSubscriptionsByTopic = SNS+ type Rs ListSubscriptionsByTopic = ListSubscriptionsByTopicResponse++ request = post "ListSubscriptionsByTopic"+ response = xmlResponse++instance FromXML ListSubscriptionsByTopicResponse where+ parseXML = withElement "ListSubscriptionsByTopicResult" $ \x -> ListSubscriptionsByTopicResponse+ <$> x .@? "NextToken"+ <*> x .@ "Subscriptions"++instance AWSPager ListSubscriptionsByTopic where+ page rq rs+ | stop (rq ^. lsbtNextToken) = Nothing+ | otherwise = (\x -> rq & lsbtNextToken ?~ x)+ <$> (rs ^. lsbtrNextToken)
+ gen/Network/AWS/SNS/ListTopics.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.SNS.ListTopics+-- 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 the requester's topics. Each call returns a limited list+-- of topics, up to 100. If there are more topics, a NextToken is also+-- returned. Use the NextToken parameter in a new ListTopics call to get+-- further results.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_ListTopics.html>+module Network.AWS.SNS.ListTopics+ (+ -- * Request+ ListTopics+ -- ** Request constructor+ , listTopics+ -- ** Request lenses+ , ltNextToken++ -- * Response+ , ListTopicsResponse+ -- ** Response constructor+ , listTopicsResponse+ -- ** Response lenses+ , ltrNextToken+ , ltrTopics+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++newtype ListTopics = ListTopics+ { _ltNextToken :: Maybe Text+ } deriving (Eq, Ord, Show, Monoid)++-- | 'ListTopics' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ltNextToken' @::@ 'Maybe' 'Text'+--+listTopics :: ListTopics+listTopics = ListTopics+ { _ltNextToken = Nothing+ }++-- | Token returned by the previous ListTopics request.+ltNextToken :: Lens' ListTopics (Maybe Text)+ltNextToken = lens _ltNextToken (\s a -> s { _ltNextToken = a })++data ListTopicsResponse = ListTopicsResponse+ { _ltrNextToken :: Maybe Text+ , _ltrTopics :: List "Topics" Topic+ } deriving (Eq, Show)++-- | 'ListTopicsResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ltrNextToken' @::@ 'Maybe' 'Text'+--+-- * 'ltrTopics' @::@ ['Topic']+--+listTopicsResponse :: ListTopicsResponse+listTopicsResponse = ListTopicsResponse+ { _ltrTopics = mempty+ , _ltrNextToken = Nothing+ }++-- | Token to pass along to the next ListTopics request. This element is+-- returned if there are additional topics to retrieve.+ltrNextToken :: Lens' ListTopicsResponse (Maybe Text)+ltrNextToken = lens _ltrNextToken (\s a -> s { _ltrNextToken = a })++-- | A list of topic ARNs.+ltrTopics :: Lens' ListTopicsResponse [Topic]+ltrTopics = lens _ltrTopics (\s a -> s { _ltrTopics = a }) . _List++instance ToPath ListTopics where+ toPath = const "/"++instance ToQuery ListTopics where+ toQuery ListTopics{..} = mconcat+ [ "NextToken" =? _ltNextToken+ ]++instance ToHeaders ListTopics++instance AWSRequest ListTopics where+ type Sv ListTopics = SNS+ type Rs ListTopics = ListTopicsResponse++ request = post "ListTopics"+ response = xmlResponse++instance FromXML ListTopicsResponse where+ parseXML = withElement "ListTopicsResult" $ \x -> ListTopicsResponse+ <$> x .@? "NextToken"+ <*> x .@ "Topics"++instance AWSPager ListTopics where+ page rq rs+ | stop (rq ^. ltNextToken) = Nothing+ | otherwise = (\x -> rq & ltNextToken ?~ x)+ <$> (rs ^. ltrNextToken)
+ gen/Network/AWS/SNS/Publish.hs view
@@ -0,0 +1,202 @@+{-# 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.SNS.Publish+-- 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)++-- | Sends a message to all of a topic's subscribed endpoints. When a messageId+-- is returned, the message has been saved and Amazon SNS will attempt to+-- deliver it to the topic's subscribers shortly. The format of the outgoing+-- message to each subscribed endpoint depends on the notification protocol+-- selected. To use the Publish action for sending a message to a mobile+-- endpoint, such as an app on a Kindle device or mobile phone, you must+-- specify the EndpointArn. The EndpointArn is returned when making a call+-- with the CreatePlatformEndpoint action. The second example below shows a+-- request and response for publishing to a mobile endpoint.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_Publish.html>+module Network.AWS.SNS.Publish+ (+ -- * Request+ Publish+ -- ** Request constructor+ , publish+ -- ** Request lenses+ , pMessage+ , pMessageAttributes+ , pMessageStructure+ , pSubject+ , pTargetArn+ , pTopicArn++ -- * Response+ , PublishResponse+ -- ** Response constructor+ , publishResponse+ -- ** Response lenses+ , prMessageId+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++data Publish = Publish+ { _pMessage :: Text+ , _pMessageAttributes :: EMap "entry" "Name" "Value" Text MessageAttributeValue+ , _pMessageStructure :: Maybe Text+ , _pSubject :: Maybe Text+ , _pTargetArn :: Maybe Text+ , _pTopicArn :: Maybe Text+ } deriving (Eq, Show)++-- | 'Publish' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'pMessage' @::@ 'Text'+--+-- * 'pMessageAttributes' @::@ 'HashMap' 'Text' 'MessageAttributeValue'+--+-- * 'pMessageStructure' @::@ 'Maybe' 'Text'+--+-- * 'pSubject' @::@ 'Maybe' 'Text'+--+-- * 'pTargetArn' @::@ 'Maybe' 'Text'+--+-- * 'pTopicArn' @::@ 'Maybe' 'Text'+--+publish :: Text -- ^ 'pMessage'+ -> Publish+publish p1 = Publish+ { _pMessage = p1+ , _pTopicArn = Nothing+ , _pTargetArn = Nothing+ , _pSubject = Nothing+ , _pMessageStructure = Nothing+ , _pMessageAttributes = mempty+ }++-- | The message you want to send to the topic. If you want to send the same+-- message to all transport protocols, include the text of the message as a+-- String value. If you want to send different messages for each transport+-- protocol, set the value of the MessageStructure parameter to json and use+-- a JSON object for the Message parameter. See the Examples section for the+-- format of the JSON object. Constraints: Messages must be UTF-8 encoded+-- strings at most 256 KB in size (262144 bytes, not 262144 characters).+-- JSON-specific constraints: Keys in the JSON object that correspond to+-- supported transport protocols must have simple JSON string values. The+-- values will be parsed (unescaped) before they are used in outgoing+-- messages. Outbound notifications are JSON encoded (meaning that the+-- characters will be reescaped for sending). Values have a minimum length+-- of 0 (the empty string, "", is allowed). Values have a maximum length+-- bounded by the overall message size (so, including multiple protocols may+-- limit message sizes). Non-string values will cause the key to be ignored.+-- Keys that do not correspond to supported transport protocols are ignored.+-- Duplicate keys are not allowed. Failure to parse or validate any key or+-- value in the message will cause the Publish call to return an error (no+-- partial delivery).+pMessage :: Lens' Publish Text+pMessage = lens _pMessage (\s a -> s { _pMessage = a })++-- | Message attributes for Publish action.+pMessageAttributes :: Lens' Publish (HashMap Text MessageAttributeValue)+pMessageAttributes =+ lens _pMessageAttributes (\s a -> s { _pMessageAttributes = a })+ . _EMap++-- | Set MessageStructure to json if you want to send a different message for+-- each protocol. For example, using one publish action, you can send a+-- short message to your SMS subscribers and a longer message to your email+-- subscribers. If you set MessageStructure to json, the value of the+-- Message parameter must: be a syntactically valid JSON object; and contain+-- at least a top-level JSON key of "default" with a value that is a string.+-- You can define other top-level keys that define the message you want to+-- send to a specific transport protocol (e.g., "http"). For information+-- about sending different messages for each protocol using the AWS+-- Management Console, go to Create Different Messages for Each Protocol in+-- the Amazon Simple Notification Service Getting Started Guide. Valid+-- value: json.+pMessageStructure :: Lens' Publish (Maybe Text)+pMessageStructure =+ lens _pMessageStructure (\s a -> s { _pMessageStructure = a })++-- | Optional parameter to be used as the "Subject" line when the message is+-- delivered to email endpoints. This field will also be included, if+-- present, in the standard JSON messages delivered to other endpoints.+-- Constraints: Subjects must be ASCII text that begins with a letter,+-- number, or punctuation mark; must not include line breaks or control+-- characters; and must be less than 100 characters long.+pSubject :: Lens' Publish (Maybe Text)+pSubject = lens _pSubject (\s a -> s { _pSubject = a })++-- | Either TopicArn or EndpointArn, but not both.+pTargetArn :: Lens' Publish (Maybe Text)+pTargetArn = lens _pTargetArn (\s a -> s { _pTargetArn = a })++-- | The topic you want to publish to.+pTopicArn :: Lens' Publish (Maybe Text)+pTopicArn = lens _pTopicArn (\s a -> s { _pTopicArn = a })++newtype PublishResponse = PublishResponse+ { _prMessageId :: Maybe Text+ } deriving (Eq, Ord, Show, Monoid)++-- | 'PublishResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'prMessageId' @::@ 'Maybe' 'Text'+--+publishResponse :: PublishResponse+publishResponse = PublishResponse+ { _prMessageId = Nothing+ }++-- | Unique identifier assigned to the published message. Length Constraint:+-- Maximum 100 characters.+prMessageId :: Lens' PublishResponse (Maybe Text)+prMessageId = lens _prMessageId (\s a -> s { _prMessageId = a })++instance ToPath Publish where+ toPath = const "/"++instance ToQuery Publish where+ toQuery Publish{..} = mconcat+ [ "Message" =? _pMessage+ , "MessageAttributes" =? _pMessageAttributes+ , "MessageStructure" =? _pMessageStructure+ , "Subject" =? _pSubject+ , "TargetArn" =? _pTargetArn+ , "TopicArn" =? _pTopicArn+ ]++instance ToHeaders Publish++instance AWSRequest Publish where+ type Sv Publish = SNS+ type Rs Publish = PublishResponse++ request = post "Publish"+ response = xmlResponse++instance FromXML PublishResponse where+ parseXML = withElement "PublishResult" $ \x -> PublishResponse+ <$> x .@? "MessageId"
+ gen/Network/AWS/SNS/RemovePermission.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.SNS.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)++-- | Removes a statement from a topic's access control policy.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_RemovePermission.html>+module Network.AWS.SNS.RemovePermission+ (+ -- * Request+ RemovePermission+ -- ** Request constructor+ , removePermission+ -- ** Request lenses+ , rpLabel+ , rpTopicArn++ -- * Response+ , RemovePermissionResponse+ -- ** Response constructor+ , removePermissionResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++data RemovePermission = RemovePermission+ { _rpLabel :: Text+ , _rpTopicArn :: Text+ } deriving (Eq, Ord, Show)++-- | 'RemovePermission' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'rpLabel' @::@ 'Text'+--+-- * 'rpTopicArn' @::@ 'Text'+--+removePermission :: Text -- ^ 'rpTopicArn'+ -> Text -- ^ 'rpLabel'+ -> RemovePermission+removePermission p1 p2 = RemovePermission+ { _rpTopicArn = p1+ , _rpLabel = p2+ }++-- | The unique label of the statement you want to remove.+rpLabel :: Lens' RemovePermission Text+rpLabel = lens _rpLabel (\s a -> s { _rpLabel = a })++-- | The ARN of the topic whose access control policy you wish to modify.+rpTopicArn :: Lens' RemovePermission Text+rpTopicArn = lens _rpTopicArn (\s a -> s { _rpTopicArn = 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+ , "TopicArn" =? _rpTopicArn+ ]++instance ToHeaders RemovePermission++instance AWSRequest RemovePermission where+ type Sv RemovePermission = SNS+ type Rs RemovePermission = RemovePermissionResponse++ request = post "RemovePermission"+ response = nullResponse RemovePermissionResponse
+ gen/Network/AWS/SNS/SetEndpointAttributes.hs view
@@ -0,0 +1,109 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.SNS.SetEndpointAttributes+-- 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 attributes for an endpoint for a device on one of the supported+-- push notification services, such as GCM and APNS. For more information, see+-- Using Amazon SNS Mobile Push Notifications.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html>+module Network.AWS.SNS.SetEndpointAttributes+ (+ -- * Request+ SetEndpointAttributes+ -- ** Request constructor+ , setEndpointAttributes+ -- ** Request lenses+ , seaAttributes+ , seaEndpointArn++ -- * Response+ , SetEndpointAttributesResponse+ -- ** Response constructor+ , setEndpointAttributesResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++data SetEndpointAttributes = SetEndpointAttributes+ { _seaAttributes :: EMap "entry" "key" "value" Text Text+ , _seaEndpointArn :: Text+ } deriving (Eq, Show)++-- | 'SetEndpointAttributes' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'seaAttributes' @::@ 'HashMap' 'Text' 'Text'+--+-- * 'seaEndpointArn' @::@ 'Text'+--+setEndpointAttributes :: Text -- ^ 'seaEndpointArn'+ -> SetEndpointAttributes+setEndpointAttributes p1 = SetEndpointAttributes+ { _seaEndpointArn = p1+ , _seaAttributes = mempty+ }++-- | A map of the endpoint attributes. Attributes in this map include the+-- following: CustomUserData -- arbitrary user data to associate with the+-- endpoint. Amazon SNS does not use this data. The data must be in UTF-8+-- format and less than 2KB. Enabled -- flag that enables/disables delivery+-- to the endpoint. Amazon SNS will set this to false when a notification+-- service indicates to Amazon SNS that the endpoint is invalid. Users can+-- set it back to true, typically after updating Token. Token -- device+-- token, also referred to as a registration id, for an app and mobile+-- device. This is returned from the notification service when an app and+-- mobile device are registered with the notification service.+seaAttributes :: Lens' SetEndpointAttributes (HashMap Text Text)+seaAttributes = lens _seaAttributes (\s a -> s { _seaAttributes = a }) . _EMap++-- | EndpointArn used for SetEndpointAttributes action.+seaEndpointArn :: Lens' SetEndpointAttributes Text+seaEndpointArn = lens _seaEndpointArn (\s a -> s { _seaEndpointArn = a })++data SetEndpointAttributesResponse = SetEndpointAttributesResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'SetEndpointAttributesResponse' constructor.+setEndpointAttributesResponse :: SetEndpointAttributesResponse+setEndpointAttributesResponse = SetEndpointAttributesResponse++instance ToPath SetEndpointAttributes where+ toPath = const "/"++instance ToQuery SetEndpointAttributes where+ toQuery SetEndpointAttributes{..} = mconcat+ [ "Attributes" =? _seaAttributes+ , "EndpointArn" =? _seaEndpointArn+ ]++instance ToHeaders SetEndpointAttributes++instance AWSRequest SetEndpointAttributes where+ type Sv SetEndpointAttributes = SNS+ type Rs SetEndpointAttributes = SetEndpointAttributesResponse++ request = post "SetEndpointAttributes"+ response = nullResponse SetEndpointAttributesResponse
+ gen/Network/AWS/SNS/SetPlatformApplicationAttributes.hs view
@@ -0,0 +1,116 @@+{-# 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.SNS.SetPlatformApplicationAttributes+-- 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 attributes of the platform application object for the supported+-- push notification services, such as APNS and GCM. For more information, see+-- Using Amazon SNS Mobile Push Notifications.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html>+module Network.AWS.SNS.SetPlatformApplicationAttributes+ (+ -- * Request+ SetPlatformApplicationAttributes+ -- ** Request constructor+ , setPlatformApplicationAttributes+ -- ** Request lenses+ , spaaAttributes+ , spaaPlatformApplicationArn++ -- * Response+ , SetPlatformApplicationAttributesResponse+ -- ** Response constructor+ , setPlatformApplicationAttributesResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++data SetPlatformApplicationAttributes = SetPlatformApplicationAttributes+ { _spaaAttributes :: EMap "entry" "key" "value" Text Text+ , _spaaPlatformApplicationArn :: Text+ } deriving (Eq, Show)++-- | 'SetPlatformApplicationAttributes' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'spaaAttributes' @::@ 'HashMap' 'Text' 'Text'+--+-- * 'spaaPlatformApplicationArn' @::@ 'Text'+--+setPlatformApplicationAttributes :: Text -- ^ 'spaaPlatformApplicationArn'+ -> SetPlatformApplicationAttributes+setPlatformApplicationAttributes p1 = SetPlatformApplicationAttributes+ { _spaaPlatformApplicationArn = p1+ , _spaaAttributes = mempty+ }++-- | A map of the platform application attributes. Attributes in this map+-- include the following: PlatformCredential -- The credential received from+-- the notification service. For APNS/APNS_SANDBOX, PlatformCredential is+-- "private key". For GCM, PlatformCredential is "API key". For ADM,+-- PlatformCredential is "client secret". PlatformPrincipal -- The principal+-- received from the notification service. For APNS/APNS_SANDBOX,+-- PlatformPrincipal is "SSL certificate". For GCM, PlatformPrincipal is not+-- applicable. For ADM, PlatformPrincipal is "client id".+-- EventEndpointCreated -- Topic ARN to which EndpointCreated event+-- notifications should be sent. EventEndpointDeleted -- Topic ARN to which+-- EndpointDeleted event notifications should be sent. EventEndpointUpdated+-- -- Topic ARN to which EndpointUpdate event notifications should be sent.+-- EventDeliveryFailure -- Topic ARN to which DeliveryFailure event+-- notifications should be sent upon Direct Publish delivery failure+-- (permanent) to one of the application's endpoints.+spaaAttributes :: Lens' SetPlatformApplicationAttributes (HashMap Text Text)+spaaAttributes = lens _spaaAttributes (\s a -> s { _spaaAttributes = a }) . _EMap++-- | PlatformApplicationArn for SetPlatformApplicationAttributes action.+spaaPlatformApplicationArn :: Lens' SetPlatformApplicationAttributes Text+spaaPlatformApplicationArn =+ lens _spaaPlatformApplicationArn+ (\s a -> s { _spaaPlatformApplicationArn = a })++data SetPlatformApplicationAttributesResponse = SetPlatformApplicationAttributesResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'SetPlatformApplicationAttributesResponse' constructor.+setPlatformApplicationAttributesResponse :: SetPlatformApplicationAttributesResponse+setPlatformApplicationAttributesResponse = SetPlatformApplicationAttributesResponse++instance ToPath SetPlatformApplicationAttributes where+ toPath = const "/"++instance ToQuery SetPlatformApplicationAttributes where+ toQuery SetPlatformApplicationAttributes{..} = mconcat+ [ "Attributes" =? _spaaAttributes+ , "PlatformApplicationArn" =? _spaaPlatformApplicationArn+ ]++instance ToHeaders SetPlatformApplicationAttributes++instance AWSRequest SetPlatformApplicationAttributes where+ type Sv SetPlatformApplicationAttributes = SNS+ type Rs SetPlatformApplicationAttributes = SetPlatformApplicationAttributesResponse++ request = post "SetPlatformApplicationAttributes"+ response = nullResponse SetPlatformApplicationAttributesResponse
+ gen/Network/AWS/SNS/SetSubscriptionAttributes.hs view
@@ -0,0 +1,114 @@+{-# 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.SNS.SetSubscriptionAttributes+-- 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)++-- | Allows a subscription owner to set an attribute of the topic to a new+-- value.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_SetSubscriptionAttributes.html>+module Network.AWS.SNS.SetSubscriptionAttributes+ (+ -- * Request+ SetSubscriptionAttributes+ -- ** Request constructor+ , setSubscriptionAttributes+ -- ** Request lenses+ , ssaAttributeName+ , ssaAttributeValue+ , ssaSubscriptionArn++ -- * Response+ , SetSubscriptionAttributesResponse+ -- ** Response constructor+ , setSubscriptionAttributesResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++data SetSubscriptionAttributes = SetSubscriptionAttributes+ { _ssaAttributeName :: Text+ , _ssaAttributeValue :: Maybe Text+ , _ssaSubscriptionArn :: Text+ } deriving (Eq, Ord, Show)++-- | 'SetSubscriptionAttributes' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ssaAttributeName' @::@ 'Text'+--+-- * 'ssaAttributeValue' @::@ 'Maybe' 'Text'+--+-- * 'ssaSubscriptionArn' @::@ 'Text'+--+setSubscriptionAttributes :: Text -- ^ 'ssaSubscriptionArn'+ -> Text -- ^ 'ssaAttributeName'+ -> SetSubscriptionAttributes+setSubscriptionAttributes p1 p2 = SetSubscriptionAttributes+ { _ssaSubscriptionArn = p1+ , _ssaAttributeName = p2+ , _ssaAttributeValue = Nothing+ }++-- | The name of the attribute you want to set. Only a subset of the+-- subscriptions attributes are mutable. Valid values: DeliveryPolicy |+-- RawMessageDelivery.+ssaAttributeName :: Lens' SetSubscriptionAttributes Text+ssaAttributeName = lens _ssaAttributeName (\s a -> s { _ssaAttributeName = a })++-- | The new value for the attribute in JSON format.+ssaAttributeValue :: Lens' SetSubscriptionAttributes (Maybe Text)+ssaAttributeValue =+ lens _ssaAttributeValue (\s a -> s { _ssaAttributeValue = a })++-- | The ARN of the subscription to modify.+ssaSubscriptionArn :: Lens' SetSubscriptionAttributes Text+ssaSubscriptionArn =+ lens _ssaSubscriptionArn (\s a -> s { _ssaSubscriptionArn = a })++data SetSubscriptionAttributesResponse = SetSubscriptionAttributesResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'SetSubscriptionAttributesResponse' constructor.+setSubscriptionAttributesResponse :: SetSubscriptionAttributesResponse+setSubscriptionAttributesResponse = SetSubscriptionAttributesResponse++instance ToPath SetSubscriptionAttributes where+ toPath = const "/"++instance ToQuery SetSubscriptionAttributes where+ toQuery SetSubscriptionAttributes{..} = mconcat+ [ "AttributeName" =? _ssaAttributeName+ , "AttributeValue" =? _ssaAttributeValue+ , "SubscriptionArn" =? _ssaSubscriptionArn+ ]++instance ToHeaders SetSubscriptionAttributes++instance AWSRequest SetSubscriptionAttributes where+ type Sv SetSubscriptionAttributes = SNS+ type Rs SetSubscriptionAttributes = SetSubscriptionAttributesResponse++ request = post "SetSubscriptionAttributes"+ response = nullResponse SetSubscriptionAttributesResponse
+ gen/Network/AWS/SNS/SetTopicAttributes.hs view
@@ -0,0 +1,112 @@+{-# 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.SNS.SetTopicAttributes+-- 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)++-- | Allows a topic owner to set an attribute of the topic to a new value.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_SetTopicAttributes.html>+module Network.AWS.SNS.SetTopicAttributes+ (+ -- * Request+ SetTopicAttributes+ -- ** Request constructor+ , setTopicAttributes+ -- ** Request lenses+ , staAttributeName+ , staAttributeValue+ , staTopicArn++ -- * Response+ , SetTopicAttributesResponse+ -- ** Response constructor+ , setTopicAttributesResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++data SetTopicAttributes = SetTopicAttributes+ { _staAttributeName :: Text+ , _staAttributeValue :: Maybe Text+ , _staTopicArn :: Text+ } deriving (Eq, Ord, Show)++-- | 'SetTopicAttributes' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'staAttributeName' @::@ 'Text'+--+-- * 'staAttributeValue' @::@ 'Maybe' 'Text'+--+-- * 'staTopicArn' @::@ 'Text'+--+setTopicAttributes :: Text -- ^ 'staTopicArn'+ -> Text -- ^ 'staAttributeName'+ -> SetTopicAttributes+setTopicAttributes p1 p2 = SetTopicAttributes+ { _staTopicArn = p1+ , _staAttributeName = p2+ , _staAttributeValue = Nothing+ }++-- | The name of the attribute you want to set. Only a subset of the topic's+-- attributes are mutable. Valid values: Policy | DisplayName |+-- DeliveryPolicy.+staAttributeName :: Lens' SetTopicAttributes Text+staAttributeName = lens _staAttributeName (\s a -> s { _staAttributeName = a })++-- | The new value for the attribute.+staAttributeValue :: Lens' SetTopicAttributes (Maybe Text)+staAttributeValue =+ lens _staAttributeValue (\s a -> s { _staAttributeValue = a })++-- | The ARN of the topic to modify.+staTopicArn :: Lens' SetTopicAttributes Text+staTopicArn = lens _staTopicArn (\s a -> s { _staTopicArn = a })++data SetTopicAttributesResponse = SetTopicAttributesResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'SetTopicAttributesResponse' constructor.+setTopicAttributesResponse :: SetTopicAttributesResponse+setTopicAttributesResponse = SetTopicAttributesResponse++instance ToPath SetTopicAttributes where+ toPath = const "/"++instance ToQuery SetTopicAttributes where+ toQuery SetTopicAttributes{..} = mconcat+ [ "AttributeName" =? _staAttributeName+ , "AttributeValue" =? _staAttributeValue+ , "TopicArn" =? _staTopicArn+ ]++instance ToHeaders SetTopicAttributes++instance AWSRequest SetTopicAttributes where+ type Sv SetTopicAttributes = SNS+ type Rs SetTopicAttributes = SetTopicAttributesResponse++ request = post "SetTopicAttributes"+ response = nullResponse SetTopicAttributesResponse
+ gen/Network/AWS/SNS/Subscribe.hs view
@@ -0,0 +1,146 @@+{-# 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.SNS.Subscribe+-- 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)++-- | Prepares to subscribe an endpoint by sending the endpoint a confirmation+-- message. To actually create a subscription, the endpoint owner must call+-- the ConfirmSubscription action with the token from the confirmation+-- message. Confirmation tokens are valid for three days.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html>+module Network.AWS.SNS.Subscribe+ (+ -- * Request+ Subscribe+ -- ** Request constructor+ , subscribe+ -- ** Request lenses+ , sEndpoint+ , sProtocol+ , sTopicArn++ -- * Response+ , SubscribeResponse+ -- ** Response constructor+ , subscribeResponse+ -- ** Response lenses+ , srSubscriptionArn+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++data Subscribe = Subscribe+ { _sEndpoint :: Maybe Text+ , _sProtocol :: Text+ , _sTopicArn :: Text+ } deriving (Eq, Ord, Show)++-- | 'Subscribe' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'sEndpoint' @::@ 'Maybe' 'Text'+--+-- * 'sProtocol' @::@ 'Text'+--+-- * 'sTopicArn' @::@ 'Text'+--+subscribe :: Text -- ^ 'sTopicArn'+ -> Text -- ^ 'sProtocol'+ -> Subscribe+subscribe p1 p2 = Subscribe+ { _sTopicArn = p1+ , _sProtocol = p2+ , _sEndpoint = Nothing+ }++-- | The endpoint that you want to receive notifications. Endpoints vary by+-- protocol: For the http protocol, the endpoint is an URL beginning with+-- "http://" For the https protocol, the endpoint is a URL beginning with+-- "https://" For the email protocol, the endpoint is an email address For+-- the email-json protocol, the endpoint is an email address For the sms+-- protocol, the endpoint is a phone number of an SMS-enabled device For the+-- sqs protocol, the endpoint is the ARN of an Amazon SQS queue For the+-- application protocol, the endpoint is the EndpointArn of a mobile app and+-- device.+sEndpoint :: Lens' Subscribe (Maybe Text)+sEndpoint = lens _sEndpoint (\s a -> s { _sEndpoint = a })++-- | The protocol you want to use. Supported protocols include: http --+-- delivery of JSON-encoded message via HTTP POST https -- delivery of+-- JSON-encoded message via HTTPS POST email -- delivery of message via SMTP+-- email-json -- delivery of JSON-encoded message via SMTP sms -- delivery+-- of message via SMS sqs -- delivery of JSON-encoded message to an Amazon+-- SQS queue application -- delivery of JSON-encoded message to an+-- EndpointArn for a mobile app and device.+sProtocol :: Lens' Subscribe Text+sProtocol = lens _sProtocol (\s a -> s { _sProtocol = a })++-- | The ARN of the topic you want to subscribe to.+sTopicArn :: Lens' Subscribe Text+sTopicArn = lens _sTopicArn (\s a -> s { _sTopicArn = a })++newtype SubscribeResponse = SubscribeResponse+ { _srSubscriptionArn :: Maybe Text+ } deriving (Eq, Ord, Show, Monoid)++-- | 'SubscribeResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'srSubscriptionArn' @::@ 'Maybe' 'Text'+--+subscribeResponse :: SubscribeResponse+subscribeResponse = SubscribeResponse+ { _srSubscriptionArn = Nothing+ }++-- | The ARN of the subscription, if the service was able to create a+-- subscription immediately (without requiring endpoint owner confirmation).+srSubscriptionArn :: Lens' SubscribeResponse (Maybe Text)+srSubscriptionArn =+ lens _srSubscriptionArn (\s a -> s { _srSubscriptionArn = a })++instance ToPath Subscribe where+ toPath = const "/"++instance ToQuery Subscribe where+ toQuery Subscribe{..} = mconcat+ [ "Endpoint" =? _sEndpoint+ , "Protocol" =? _sProtocol+ , "TopicArn" =? _sTopicArn+ ]++instance ToHeaders Subscribe++instance AWSRequest Subscribe where+ type Sv Subscribe = SNS+ type Rs Subscribe = SubscribeResponse++ request = post "Subscribe"+ response = xmlResponse++instance FromXML SubscribeResponse where+ parseXML = withElement "SubscribeResult" $ \x -> SubscribeResponse+ <$> x .@? "SubscriptionArn"
+ gen/Network/AWS/SNS/Types.hs view
@@ -0,0 +1,317 @@+{-# 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.SNS.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.SNS.Types+ (+ -- * Service+ SNS+ -- ** Error+ , RESTError+ -- ** XML+ , ns++ -- * Topic+ , Topic+ , topic+ , tTopicArn++ -- * MessageAttributeValue+ , MessageAttributeValue+ , messageAttributeValue+ , mavBinaryValue+ , mavDataType+ , mavStringValue++ -- * PlatformApplication+ , PlatformApplication+ , platformApplication+ , paAttributes+ , paPlatformApplicationArn++ -- * Subscription+ , Subscription+ , subscription+ , s1Endpoint+ , s1Owner+ , s1Protocol+ , s1SubscriptionArn+ , s1TopicArn++ -- * Endpoint+ , Endpoint+ , endpoint+ , eAttributes+ , eEndpointArn+ ) where++import Network.AWS.Error+import Network.AWS.Prelude+import Network.AWS.Signing.V4+import qualified GHC.Exts++-- | Version @2010-03-31@ of the Amazon Simple Notification Service service.+data SNS++instance AWSService SNS where+ type Sg SNS = V4+ type Er SNS = RESTError++ service = Service+ { _svcEndpoint = regional+ , _svcAbbrev = "SNS"+ , _svcPrefix = "sns"+ , _svcVersion = "2010-03-31"+ , _svcTargetPrefix = Nothing+ , _svcJSONVersion = Nothing+ }++ handle = restError statusSuccess++ns :: Text+ns = "http://sns.amazonaws.com/doc/2010-03-31/"++newtype Topic = Topic+ { _tTopicArn :: Maybe Text+ } deriving (Eq, Ord, Show, Monoid)++-- | 'Topic' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'tTopicArn' @::@ 'Maybe' 'Text'+--+topic :: Topic+topic = Topic+ { _tTopicArn = Nothing+ }++-- | The topic's ARN.+tTopicArn :: Lens' Topic (Maybe Text)+tTopicArn = lens _tTopicArn (\s a -> s { _tTopicArn = a })++instance FromXML Topic where+ parseXML x = Topic+ <$> x .@? "TopicArn"++instance ToQuery Topic where+ toQuery Topic{..} = mconcat+ [ "TopicArn" =? _tTopicArn+ ]++data MessageAttributeValue = MessageAttributeValue+ { _mavBinaryValue :: Maybe Base64+ , _mavDataType :: Text+ , _mavStringValue :: Maybe Text+ } deriving (Eq, Show)++-- | 'MessageAttributeValue' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'mavBinaryValue' @::@ 'Maybe' 'Base64'+--+-- * 'mavDataType' @::@ 'Text'+--+-- * 'mavStringValue' @::@ 'Maybe' 'Text'+--+messageAttributeValue :: Text -- ^ 'mavDataType'+ -> MessageAttributeValue+messageAttributeValue p1 = MessageAttributeValue+ { _mavDataType = p1+ , _mavStringValue = Nothing+ , _mavBinaryValue = Nothing+ }++-- | 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 SNS supports the following logical data types: String, Number, and+-- Binary. For more information, see Message Attribute Data Types.+mavDataType :: Lens' MessageAttributeValue Text+mavDataType = lens _mavDataType (\s a -> s { _mavDataType = a })++-- | 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 .@? "BinaryValue"+ <*> x .@ "DataType"+ <*> x .@? "StringValue"++instance ToQuery MessageAttributeValue where+ toQuery MessageAttributeValue{..} = mconcat+ [ "BinaryValue" =? _mavBinaryValue+ , "DataType" =? _mavDataType+ , "StringValue" =? _mavStringValue+ ]++data PlatformApplication = PlatformApplication+ { _paAttributes :: EMap "entry" "key" "value" Text Text+ , _paPlatformApplicationArn :: Maybe Text+ } deriving (Eq, Show)++-- | 'PlatformApplication' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'paAttributes' @::@ 'HashMap' 'Text' 'Text'+--+-- * 'paPlatformApplicationArn' @::@ 'Maybe' 'Text'+--+platformApplication :: PlatformApplication+platformApplication = PlatformApplication+ { _paPlatformApplicationArn = Nothing+ , _paAttributes = mempty+ }++-- | Attributes for platform application object.+paAttributes :: Lens' PlatformApplication (HashMap Text Text)+paAttributes = lens _paAttributes (\s a -> s { _paAttributes = a }) . _EMap++-- | PlatformApplicationArn for platform application object.+paPlatformApplicationArn :: Lens' PlatformApplication (Maybe Text)+paPlatformApplicationArn =+ lens _paPlatformApplicationArn+ (\s a -> s { _paPlatformApplicationArn = a })++instance FromXML PlatformApplication where+ parseXML x = PlatformApplication+ <$> x .@ "Attributes"+ <*> x .@? "PlatformApplicationArn"++instance ToQuery PlatformApplication where+ toQuery PlatformApplication{..} = mconcat+ [ "Attributes" =? _paAttributes+ , "PlatformApplicationArn" =? _paPlatformApplicationArn+ ]++data Subscription = Subscription+ { _s1Endpoint :: Maybe Text+ , _s1Owner :: Maybe Text+ , _s1Protocol :: Maybe Text+ , _s1SubscriptionArn :: Maybe Text+ , _s1TopicArn :: Maybe Text+ } deriving (Eq, Ord, Show)++-- | 'Subscription' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 's1Endpoint' @::@ 'Maybe' 'Text'+--+-- * 's1Owner' @::@ 'Maybe' 'Text'+--+-- * 's1Protocol' @::@ 'Maybe' 'Text'+--+-- * 's1SubscriptionArn' @::@ 'Maybe' 'Text'+--+-- * 's1TopicArn' @::@ 'Maybe' 'Text'+--+subscription :: Subscription+subscription = Subscription+ { _s1SubscriptionArn = Nothing+ , _s1Owner = Nothing+ , _s1Protocol = Nothing+ , _s1Endpoint = Nothing+ , _s1TopicArn = Nothing+ }++-- | The subscription's endpoint (format depends on the protocol).+s1Endpoint :: Lens' Subscription (Maybe Text)+s1Endpoint = lens _s1Endpoint (\s a -> s { _s1Endpoint = a })++-- | The subscription's owner.+s1Owner :: Lens' Subscription (Maybe Text)+s1Owner = lens _s1Owner (\s a -> s { _s1Owner = a })++-- | The subscription's protocol.+s1Protocol :: Lens' Subscription (Maybe Text)+s1Protocol = lens _s1Protocol (\s a -> s { _s1Protocol = a })++-- | The subscription's ARN.+s1SubscriptionArn :: Lens' Subscription (Maybe Text)+s1SubscriptionArn =+ lens _s1SubscriptionArn (\s a -> s { _s1SubscriptionArn = a })++-- | The ARN of the subscription's topic.+s1TopicArn :: Lens' Subscription (Maybe Text)+s1TopicArn = lens _s1TopicArn (\s a -> s { _s1TopicArn = a })++instance FromXML Subscription where+ parseXML x = Subscription+ <$> x .@? "Endpoint"+ <*> x .@? "Owner"+ <*> x .@? "Protocol"+ <*> x .@? "SubscriptionArn"+ <*> x .@? "TopicArn"++instance ToQuery Subscription where+ toQuery Subscription{..} = mconcat+ [ "Endpoint" =? _s1Endpoint+ , "Owner" =? _s1Owner+ , "Protocol" =? _s1Protocol+ , "SubscriptionArn" =? _s1SubscriptionArn+ , "TopicArn" =? _s1TopicArn+ ]++data Endpoint = Endpoint+ { _eAttributes :: EMap "entry" "key" "value" Text Text+ , _eEndpointArn :: Maybe Text+ } deriving (Eq, Show)++-- | 'Endpoint' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'eAttributes' @::@ 'HashMap' 'Text' 'Text'+--+-- * 'eEndpointArn' @::@ 'Maybe' 'Text'+--+endpoint :: Endpoint+endpoint = Endpoint+ { _eEndpointArn = Nothing+ , _eAttributes = mempty+ }++-- | Attributes for endpoint.+eAttributes :: Lens' Endpoint (HashMap Text Text)+eAttributes = lens _eAttributes (\s a -> s { _eAttributes = a }) . _EMap++-- | EndpointArn for mobile app and device.+eEndpointArn :: Lens' Endpoint (Maybe Text)+eEndpointArn = lens _eEndpointArn (\s a -> s { _eEndpointArn = a })++instance FromXML Endpoint where+ parseXML x = Endpoint+ <$> x .@ "Attributes"+ <*> x .@? "EndpointArn"++instance ToQuery Endpoint where+ toQuery Endpoint{..} = mconcat+ [ "Attributes" =? _eAttributes+ , "EndpointArn" =? _eEndpointArn+ ]
+ gen/Network/AWS/SNS/Unsubscribe.hs view
@@ -0,0 +1,94 @@+{-# 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.SNS.Unsubscribe+-- 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 a subscription. If the subscription requires authentication for+-- deletion, only the owner of the subscription or the topic's owner can+-- unsubscribe, and an AWS signature is required. If the Unsubscribe call does+-- not require authentication and the requester is not the subscription owner,+-- a final cancellation message is delivered to the endpoint, so that the+-- endpoint owner can easily resubscribe to the topic if the Unsubscribe+-- request was unintended.+--+-- <http://docs.aws.amazon.com/sns/latest/api/API_Unsubscribe.html>+module Network.AWS.SNS.Unsubscribe+ (+ -- * Request+ Unsubscribe+ -- ** Request constructor+ , unsubscribe+ -- ** Request lenses+ , uSubscriptionArn++ -- * Response+ , UnsubscribeResponse+ -- ** Response constructor+ , unsubscribeResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.SNS.Types+import qualified GHC.Exts++newtype Unsubscribe = Unsubscribe+ { _uSubscriptionArn :: Text+ } deriving (Eq, Ord, Show, Monoid, IsString)++-- | 'Unsubscribe' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'uSubscriptionArn' @::@ 'Text'+--+unsubscribe :: Text -- ^ 'uSubscriptionArn'+ -> Unsubscribe+unsubscribe p1 = Unsubscribe+ { _uSubscriptionArn = p1+ }++-- | The ARN of the subscription to be deleted.+uSubscriptionArn :: Lens' Unsubscribe Text+uSubscriptionArn = lens _uSubscriptionArn (\s a -> s { _uSubscriptionArn = a })++data UnsubscribeResponse = UnsubscribeResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'UnsubscribeResponse' constructor.+unsubscribeResponse :: UnsubscribeResponse+unsubscribeResponse = UnsubscribeResponse++instance ToPath Unsubscribe where+ toPath = const "/"++instance ToQuery Unsubscribe where+ toQuery Unsubscribe{..} = mconcat+ [ "SubscriptionArn" =? _uSubscriptionArn+ ]++instance ToHeaders Unsubscribe++instance AWSRequest Unsubscribe where+ type Sv Unsubscribe = SNS+ type Rs Unsubscribe = UnsubscribeResponse++ request = post "Unsubscribe"+ response = nullResponse UnsubscribeResponse