amazonka-kinesis (empty) → 0.0.0
raw patch · 18 files changed
+2758/−0 lines, 18 filesdep +amazonka-coredep +basesetup-changed
Dependencies added: amazonka-core, base
Files
- LICENSE +373/−0
- README.md +26/−0
- Setup.hs +2/−0
- amazonka-kinesis.cabal +57/−0
- gen/Network/AWS/Kinesis.hs +43/−0
- gen/Network/AWS/Kinesis/AddTagsToStream.hs +104/−0
- gen/Network/AWS/Kinesis/CreateStream.hs +137/−0
- gen/Network/AWS/Kinesis/DeleteStream.hs +103/−0
- gen/Network/AWS/Kinesis/DescribeStream.hs +156/−0
- gen/Network/AWS/Kinesis/GetRecords.hs +173/−0
- gen/Network/AWS/Kinesis/GetShardIterator.hs +185/−0
- gen/Network/AWS/Kinesis/ListStreams.hs +150/−0
- gen/Network/AWS/Kinesis/ListTagsForStream.hs +149/−0
- gen/Network/AWS/Kinesis/MergeShards.hs +141/−0
- gen/Network/AWS/Kinesis/PutRecord.hs +210/−0
- gen/Network/AWS/Kinesis/RemoveTagsFromStream.hs +103/−0
- gen/Network/AWS/Kinesis/SplitShard.hs +154/−0
- gen/Network/AWS/Kinesis/Types.hs +492/−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 Kinesis 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 Kinesis is a managed service that scales elastically for real-time processing of streaming big data. The service takes in large streams of data records that can then be consumed in real time by multiple data-processing applications that can be run on Amazon EC2 instances.++Documentation is available via [Hackage](http://hackage.haskell.org/package/amazonka-kinesis)+and [AWS API Reference](http://docs.aws.amazon.com/kinesis/latest/APIReference/Welcome.html).+++## Contribute++For any problems, comments, or feedback please create an issue [here on GitHub](https://github.com/brendanhay/amazonka/issues).++> _Note:_ this library is an auto-generated Haskell package. Please see `amazonka-gen` for more information.+++## Licence++`amazonka-kinesis` 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-kinesis.cabal view
@@ -0,0 +1,57 @@+name: amazonka-kinesis+version: 0.0.0+synopsis: Amazon Kinesis 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 Kinesis is a managed service that scales elastically for+ real-time processing of streaming big data. The service takes in large+ streams of data records that can then be consumed in real time by+ multiple data-processing applications that can be run on Amazon EC2+ instances.+ .+ /See:/ <http://docs.aws.amazon.com/kinesis/latest/APIReference/Welcome.html AWS API Reference>+ .+ /Warning:/ This is an experimental preview release which is still under+ heavy development and not intended for public consumption, caveat emptor!++source-repository head+ type: git+ location: git://github.com/brendanhay/amazonka.git++library+ default-language: Haskell2010+ hs-source-dirs: src gen++ ghc-options: -Wall++ exposed-modules:+ Network.AWS.Kinesis+ , Network.AWS.Kinesis.AddTagsToStream+ , Network.AWS.Kinesis.CreateStream+ , Network.AWS.Kinesis.DeleteStream+ , Network.AWS.Kinesis.DescribeStream+ , Network.AWS.Kinesis.GetRecords+ , Network.AWS.Kinesis.GetShardIterator+ , Network.AWS.Kinesis.ListStreams+ , Network.AWS.Kinesis.ListTagsForStream+ , Network.AWS.Kinesis.MergeShards+ , Network.AWS.Kinesis.PutRecord+ , Network.AWS.Kinesis.RemoveTagsFromStream+ , Network.AWS.Kinesis.SplitShard+ , Network.AWS.Kinesis.Types++ other-modules:++ build-depends:+ amazonka-core+ , base >= 4.7 && < 5
+ gen/Network/AWS/Kinesis.hs view
@@ -0,0 +1,43 @@+-- Module : Network.AWS.Kinesis+-- 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 Kinesis is a managed service that scales elastically for real-time+-- processing of streaming big data. The service takes in large streams of+-- data records that can then be consumed in real time by multiple+-- data-processing applications that can be run on Amazon EC2 instances.+module Network.AWS.Kinesis+ ( module Network.AWS.Kinesis.AddTagsToStream+ , module Network.AWS.Kinesis.CreateStream+ , module Network.AWS.Kinesis.DeleteStream+ , module Network.AWS.Kinesis.DescribeStream+ , module Network.AWS.Kinesis.GetRecords+ , module Network.AWS.Kinesis.GetShardIterator+ , module Network.AWS.Kinesis.ListStreams+ , module Network.AWS.Kinesis.ListTagsForStream+ , module Network.AWS.Kinesis.MergeShards+ , module Network.AWS.Kinesis.PutRecord+ , module Network.AWS.Kinesis.RemoveTagsFromStream+ , module Network.AWS.Kinesis.SplitShard+ , module Network.AWS.Kinesis.Types+ ) where++import Network.AWS.Kinesis.AddTagsToStream+import Network.AWS.Kinesis.CreateStream+import Network.AWS.Kinesis.DeleteStream+import Network.AWS.Kinesis.DescribeStream+import Network.AWS.Kinesis.GetRecords+import Network.AWS.Kinesis.GetShardIterator+import Network.AWS.Kinesis.ListStreams+import Network.AWS.Kinesis.ListTagsForStream+import Network.AWS.Kinesis.MergeShards+import Network.AWS.Kinesis.PutRecord+import Network.AWS.Kinesis.RemoveTagsFromStream+import Network.AWS.Kinesis.SplitShard+import Network.AWS.Kinesis.Types
+ gen/Network/AWS/Kinesis/AddTagsToStream.hs view
@@ -0,0 +1,104 @@+{-# 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.Kinesis.AddTagsToStream+-- 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 or updates tags for the specified Amazon Kinesis stream. Each stream+-- can have up to 10 tags. If tags have already been assigned to the stream,+-- AddTagsToStream overwrites any existing tags that correspond to the+-- specified tag keys.+--+-- <http://docs.aws.amazon.com/kinesis/latest/APIReference/API_AddTagsToStream.html>+module Network.AWS.Kinesis.AddTagsToStream+ (+ -- * Request+ AddTagsToStream+ -- ** Request constructor+ , addTagsToStream+ -- ** Request lenses+ , attsStreamName+ , attsTags++ -- * Response+ , AddTagsToStreamResponse+ -- ** Response constructor+ , addTagsToStreamResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.JSON+import Network.AWS.Kinesis.Types+import qualified GHC.Exts++data AddTagsToStream = AddTagsToStream+ { _attsStreamName :: Text+ , _attsTags :: Map Text Text+ } deriving (Eq, Show)++-- | 'AddTagsToStream' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'attsStreamName' @::@ 'Text'+--+-- * 'attsTags' @::@ 'HashMap' 'Text' 'Text'+--+addTagsToStream :: Text -- ^ 'attsStreamName'+ -> AddTagsToStream+addTagsToStream p1 = AddTagsToStream+ { _attsStreamName = p1+ , _attsTags = mempty+ }++-- | The name of the stream.+attsStreamName :: Lens' AddTagsToStream Text+attsStreamName = lens _attsStreamName (\s a -> s { _attsStreamName = a })++-- | The set of key-value pairs to use to create the tags.+attsTags :: Lens' AddTagsToStream (HashMap Text Text)+attsTags = lens _attsTags (\s a -> s { _attsTags = a }) . _Map++data AddTagsToStreamResponse = AddTagsToStreamResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'AddTagsToStreamResponse' constructor.+addTagsToStreamResponse :: AddTagsToStreamResponse+addTagsToStreamResponse = AddTagsToStreamResponse++instance ToPath AddTagsToStream where+ toPath = const "/"++instance ToQuery AddTagsToStream where+ toQuery = const mempty++instance ToHeaders AddTagsToStream++instance ToJSON AddTagsToStream where+ toJSON AddTagsToStream{..} = object+ [ "StreamName" .= _attsStreamName+ , "Tags" .= _attsTags+ ]++instance AWSRequest AddTagsToStream where+ type Sv AddTagsToStream = Kinesis+ type Rs AddTagsToStream = AddTagsToStreamResponse++ request = post "AddTagsToStream"+ response = nullResponse AddTagsToStreamResponse
+ gen/Network/AWS/Kinesis/CreateStream.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.Kinesis.CreateStream+-- 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 Amazon Kinesis stream. A stream captures and transports data+-- records that are continuously emitted from different data sources or+-- producers. Scale-out within an Amazon Kinesis stream is explicitly+-- supported by means of shards, which are uniquely identified groups of data+-- records in an Amazon Kinesis stream. You specify and control the number of+-- shards that a stream is composed of. Each open shard can support up to 5+-- read transactions per second, up to a maximum total of 2 MB of data read+-- per second. Each shard can support up to 1000 write transactions per+-- second, up to a maximum total of 1 MB data written per second. You can add+-- shards to a stream if the amount of data input increases and you can remove+-- shards if the amount of data input decreases. The stream name identifies+-- the stream. The name is scoped to the AWS account used by the application.+-- It is also scoped by region. That is, two streams in two different accounts+-- can have the same name, and two streams in the same account, but in two+-- different regions, can have the same name. CreateStream is an asynchronous+-- operation. Upon receiving a CreateStream request, Amazon Kinesis+-- immediately returns and sets the stream status to CREATING. After the+-- stream is created, Amazon Kinesis sets the stream status to ACTIVE. You+-- should perform read and write operations only on an ACTIVE stream. You+-- receive a LimitExceededException when making a CreateStream request if you+-- try to do one of the following: Have more than five streams in the CREATING+-- state at any point in time. Create more shards than are authorized for your+-- account. The default limit for an AWS account is 10 shards per stream. If+-- you need to create a stream with more than 10 shards, contact AWS Support+-- to increase the limit on your account. You can use DescribeStream to check+-- the stream status, which is returned in StreamStatus. CreateStream has a+-- limit of 5 transactions per second per account.+--+-- <http://docs.aws.amazon.com/kinesis/latest/APIReference/API_CreateStream.html>+module Network.AWS.Kinesis.CreateStream+ (+ -- * Request+ CreateStream+ -- ** Request constructor+ , createStream+ -- ** Request lenses+ , csShardCount+ , csStreamName++ -- * Response+ , CreateStreamResponse+ -- ** Response constructor+ , createStreamResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.JSON+import Network.AWS.Kinesis.Types+import qualified GHC.Exts++data CreateStream = CreateStream+ { _csShardCount :: Nat+ , _csStreamName :: Text+ } deriving (Eq, Ord, Show)++-- | 'CreateStream' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'csShardCount' @::@ 'Natural'+--+-- * 'csStreamName' @::@ 'Text'+--+createStream :: Text -- ^ 'csStreamName'+ -> Natural -- ^ 'csShardCount'+ -> CreateStream+createStream p1 p2 = CreateStream+ { _csStreamName = p1+ , _csShardCount = withIso _Nat (const id) p2+ }++-- | The number of shards that the stream will use. The throughput of the+-- stream is a function of the number of shards; more shards are required+-- for greater provisioned throughput. Note: The default limit for an AWS+-- account is 10 shards per stream. If you need to create a stream with more+-- than 10 shards, contact AWS Support to increase the limit on your+-- account.+csShardCount :: Lens' CreateStream Natural+csShardCount = lens _csShardCount (\s a -> s { _csShardCount = a }) . _Nat++-- | A name to identify the stream. The stream name is scoped to the AWS+-- account used by the application that creates the stream. It is also+-- scoped by region. That is, two streams in two different AWS accounts can+-- have the same name, and two streams in the same AWS account, but in two+-- different regions, can have the same name.+csStreamName :: Lens' CreateStream Text+csStreamName = lens _csStreamName (\s a -> s { _csStreamName = a })++data CreateStreamResponse = CreateStreamResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'CreateStreamResponse' constructor.+createStreamResponse :: CreateStreamResponse+createStreamResponse = CreateStreamResponse++instance ToPath CreateStream where+ toPath = const "/"++instance ToQuery CreateStream where+ toQuery = const mempty++instance ToHeaders CreateStream++instance ToJSON CreateStream where+ toJSON CreateStream{..} = object+ [ "StreamName" .= _csStreamName+ , "ShardCount" .= _csShardCount+ ]++instance AWSRequest CreateStream where+ type Sv CreateStream = Kinesis+ type Rs CreateStream = CreateStreamResponse++ request = post "CreateStream"+ response = nullResponse CreateStreamResponse
+ gen/Network/AWS/Kinesis/DeleteStream.hs view
@@ -0,0 +1,103 @@+{-# 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.Kinesis.DeleteStream+-- 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 stream and all its shards and data. You must shut down any+-- applications that are operating on the stream before you delete the stream.+-- If an application attempts to operate on a deleted stream, it will receive+-- the exception ResourceNotFoundException. If the stream is in the ACTIVE+-- state, you can delete it. After a DeleteStream request, the specified+-- stream is in the DELETING state until Amazon Kinesis completes the+-- deletion. Note: Amazon Kinesis might continue to accept data read and write+-- operations, such as PutRecord and GetRecords, on a stream in the DELETING+-- state until the stream deletion is complete. When you delete a stream, any+-- shards in that stream are also deleted, and any tags are dissociated from+-- the stream. You can use the DescribeStream operation to check the state of+-- the stream, which is returned in StreamStatus. DeleteStream has a limit of+-- 5 transactions per second per account.+--+-- <http://docs.aws.amazon.com/kinesis/latest/APIReference/API_DeleteStream.html>+module Network.AWS.Kinesis.DeleteStream+ (+ -- * Request+ DeleteStream+ -- ** Request constructor+ , deleteStream+ -- ** Request lenses+ , dsStreamName++ -- * Response+ , DeleteStreamResponse+ -- ** Response constructor+ , deleteStreamResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.JSON+import Network.AWS.Kinesis.Types+import qualified GHC.Exts++newtype DeleteStream = DeleteStream+ { _dsStreamName :: Text+ } deriving (Eq, Ord, Show, Monoid, IsString)++-- | 'DeleteStream' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dsStreamName' @::@ 'Text'+--+deleteStream :: Text -- ^ 'dsStreamName'+ -> DeleteStream+deleteStream p1 = DeleteStream+ { _dsStreamName = p1+ }++-- | The name of the stream to delete.+dsStreamName :: Lens' DeleteStream Text+dsStreamName = lens _dsStreamName (\s a -> s { _dsStreamName = a })++data DeleteStreamResponse = DeleteStreamResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'DeleteStreamResponse' constructor.+deleteStreamResponse :: DeleteStreamResponse+deleteStreamResponse = DeleteStreamResponse++instance ToPath DeleteStream where+ toPath = const "/"++instance ToQuery DeleteStream where+ toQuery = const mempty++instance ToHeaders DeleteStream++instance ToJSON DeleteStream where+ toJSON DeleteStream{..} = object+ [ "StreamName" .= _dsStreamName+ ]++instance AWSRequest DeleteStream where+ type Sv DeleteStream = Kinesis+ type Rs DeleteStream = DeleteStreamResponse++ request = post "DeleteStream"+ response = nullResponse DeleteStreamResponse
+ gen/Network/AWS/Kinesis/DescribeStream.hs view
@@ -0,0 +1,156 @@+{-# 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.Kinesis.DescribeStream+-- 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)++-- | Describes the specified stream. The information about the stream includes+-- its current status, its Amazon Resource Name (ARN), and an array of shard+-- objects. For each shard object, there is information about the hash key and+-- sequence number ranges that the shard spans, and the IDs of any earlier+-- shards that played in a role in creating the shard. A sequence number is+-- the identifier associated with every record ingested in the Amazon Kinesis+-- stream. The sequence number is assigned when a record is put into the+-- stream. You can limit the number of returned shards using the Limit+-- parameter. The number of shards in a stream may be too large to return from+-- a single call to DescribeStream. You can detect this by using the+-- HasMoreShards flag in the returned output. HasMoreShards is set to true+-- when there is more data available. DescribeStream is a paginated operation.+-- If there are more shards available, you can request them using the shard ID+-- of the last shard returned. Specify this ID in the ExclusiveStartShardId+-- parameter in a subsequent request to DescribeStream. DescribeStream has a+-- limit of 10 transactions per second per account.+--+-- <http://docs.aws.amazon.com/kinesis/latest/APIReference/API_DescribeStream.html>+module Network.AWS.Kinesis.DescribeStream+ (+ -- * Request+ DescribeStream+ -- ** Request constructor+ , describeStream+ -- ** Request lenses+ , ds1ExclusiveStartShardId+ , ds1Limit+ , ds1StreamName++ -- * Response+ , DescribeStreamResponse+ -- ** Response constructor+ , describeStreamResponse+ -- ** Response lenses+ , dsrStreamDescription+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.JSON+import Network.AWS.Kinesis.Types+import qualified GHC.Exts++data DescribeStream = DescribeStream+ { _ds1ExclusiveStartShardId :: Maybe Text+ , _ds1Limit :: Maybe Nat+ , _ds1StreamName :: Text+ } deriving (Eq, Ord, Show)++-- | 'DescribeStream' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ds1ExclusiveStartShardId' @::@ 'Maybe' 'Text'+--+-- * 'ds1Limit' @::@ 'Maybe' 'Natural'+--+-- * 'ds1StreamName' @::@ 'Text'+--+describeStream :: Text -- ^ 'ds1StreamName'+ -> DescribeStream+describeStream p1 = DescribeStream+ { _ds1StreamName = p1+ , _ds1Limit = Nothing+ , _ds1ExclusiveStartShardId = Nothing+ }++-- | The shard ID of the shard to start with.+ds1ExclusiveStartShardId :: Lens' DescribeStream (Maybe Text)+ds1ExclusiveStartShardId =+ lens _ds1ExclusiveStartShardId+ (\s a -> s { _ds1ExclusiveStartShardId = a })++-- | The maximum number of shards to return.+ds1Limit :: Lens' DescribeStream (Maybe Natural)+ds1Limit = lens _ds1Limit (\s a -> s { _ds1Limit = a }) . mapping _Nat++-- | The name of the stream to describe.+ds1StreamName :: Lens' DescribeStream Text+ds1StreamName = lens _ds1StreamName (\s a -> s { _ds1StreamName = a })++newtype DescribeStreamResponse = DescribeStreamResponse+ { _dsrStreamDescription :: StreamDescription+ } deriving (Eq, Show)++-- | 'DescribeStreamResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dsrStreamDescription' @::@ 'StreamDescription'+--+describeStreamResponse :: StreamDescription -- ^ 'dsrStreamDescription'+ -> DescribeStreamResponse+describeStreamResponse p1 = DescribeStreamResponse+ { _dsrStreamDescription = p1+ }++-- | The current status of the stream, the stream ARN, an array of shard+-- objects that comprise the stream, and states whether there are more+-- shards available.+dsrStreamDescription :: Lens' DescribeStreamResponse StreamDescription+dsrStreamDescription =+ lens _dsrStreamDescription (\s a -> s { _dsrStreamDescription = a })++instance ToPath DescribeStream where+ toPath = const "/"++instance ToQuery DescribeStream where+ toQuery = const mempty++instance ToHeaders DescribeStream++instance ToJSON DescribeStream where+ toJSON DescribeStream{..} = object+ [ "StreamName" .= _ds1StreamName+ , "Limit" .= _ds1Limit+ , "ExclusiveStartShardId" .= _ds1ExclusiveStartShardId+ ]++instance AWSRequest DescribeStream where+ type Sv DescribeStream = Kinesis+ type Rs DescribeStream = DescribeStreamResponse++ request = post "DescribeStream"+ response = jsonResponse++instance FromJSON DescribeStreamResponse where+ parseJSON = withObject "DescribeStreamResponse" $ \o -> DescribeStreamResponse+ <$> o .: "StreamDescription"++instance AWSPager DescribeStream where+ page rq rs+ | stop (rs ^. dsrStreamDescription . sdHasMoreShards) = Nothing+ | otherwise = Just $ rq+ & ds1ExclusiveStartShardId .~ rs ^. index (dsrStreamDescription . sdShards) sShardId
+ gen/Network/AWS/Kinesis/GetRecords.hs view
@@ -0,0 +1,173 @@+{-# 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.Kinesis.GetRecords+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)++-- | Gets data records from a shard. Specify a shard iterator using the+-- ShardIterator parameter. The shard iterator specifies the position in the+-- shard from which you want to start reading data records sequentially. If+-- there are no records available in the portion of the shard that the+-- iterator points to, GetRecords returns an empty list. Note that it might+-- take multiple calls to get to a portion of the shard that contains records.+-- You can scale by provisioning multiple shards. Your application should have+-- one thread per shard, each reading continuously from its stream. To read+-- from a stream continually, call GetRecords in a loop. Use GetShardIterator+-- to get the shard iterator to specify in the first GetRecords call.+-- GetRecords returns a new shard iterator in NextShardIterator. Specify the+-- shard iterator returned in NextShardIterator in subsequent calls to+-- GetRecords. Note that if the shard has been closed, the shard iterator+-- can't return more data and GetRecords returns null in NextShardIterator.+-- You can terminate the loop when the shard is closed, or when the shard+-- iterator reaches the record with the sequence number or other attribute+-- that marks it as the last record to process. Each data record can be up to+-- 50 KB in size, and each shard can read up to 2 MB per second. You can+-- ensure that your calls don't exceed the maximum supported size or+-- throughput by specifying the maximum number of records that GetRecords can+-- return in the Limit parameter. Consider your average record size when+-- determining this limit. For example, if your average record size is 40 KB,+-- you can limit the data returned to about 1 MB per call by specifying 25 as+-- the limit. The size of the data returned by GetRecords will vary depending+-- on the utilization of the shard. The maximum size of data that GetRecords+-- can return is 10 MB. If a call returns 10 MB of data, subsequent calls made+-- within the next 5 seconds throw ProvisionedThroughputExceededException. If+-- there is insufficient provisioned throughput on the shard, subsequent calls+-- made within the next 1 second throw ProvisionedThroughputExceededException.+-- Note that GetRecords won't return any data when it throws an exception. For+-- this reason, we recommend that you wait one second between calls to+-- GetRecords; however, it's possible that the application will get exceptions+-- for longer than 1 second. To detect whether the application is falling+-- behind in processing, add a timestamp to your records and note how long it+-- takes to process them. You can also monitor how much data is in a stream+-- using the CloudWatch metrics for PutRecord. For more information, see+-- Monitoring Amazon Kinesis with Amazon CloudWatch in the Amazon Kinesis+-- Developer Guide.+--+-- <http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetRecords.html>+module Network.AWS.Kinesis.GetRecords+ (+ -- * Request+ GetRecords+ -- ** Request constructor+ , getRecords+ -- ** Request lenses+ , grLimit+ , grShardIterator++ -- * Response+ , GetRecordsResponse+ -- ** Response constructor+ , getRecordsResponse+ -- ** Response lenses+ , grrNextShardIterator+ , grrRecords+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.JSON+import Network.AWS.Kinesis.Types+import qualified GHC.Exts++data GetRecords = GetRecords+ { _grLimit :: Maybe Nat+ , _grShardIterator :: Text+ } deriving (Eq, Ord, Show)++-- | 'GetRecords' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'grLimit' @::@ 'Maybe' 'Natural'+--+-- * 'grShardIterator' @::@ 'Text'+--+getRecords :: Text -- ^ 'grShardIterator'+ -> GetRecords+getRecords p1 = GetRecords+ { _grShardIterator = p1+ , _grLimit = Nothing+ }++-- | The maximum number of records to return. Specify a value of up to 10,000.+-- If you specify a value that is greater than 10,000, GetRecords throws+-- InvalidArgumentException.+grLimit :: Lens' GetRecords (Maybe Natural)+grLimit = lens _grLimit (\s a -> s { _grLimit = a }) . mapping _Nat++-- | The position in the shard from which you want to start sequentially+-- reading data records. A shard iterator specifies this position using the+-- sequence number of a data record in the shard.+grShardIterator :: Lens' GetRecords Text+grShardIterator = lens _grShardIterator (\s a -> s { _grShardIterator = a })++data GetRecordsResponse = GetRecordsResponse+ { _grrNextShardIterator :: Maybe Text+ , _grrRecords :: List "Records" Record+ } deriving (Eq, Show)++-- | 'GetRecordsResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'grrNextShardIterator' @::@ 'Maybe' 'Text'+--+-- * 'grrRecords' @::@ ['Record']+--+getRecordsResponse :: GetRecordsResponse+getRecordsResponse = GetRecordsResponse+ { _grrRecords = mempty+ , _grrNextShardIterator = Nothing+ }++-- | The next position in the shard from which to start sequentially reading+-- data records. If set to null, the shard has been closed and the requested+-- iterator will not return any more data.+grrNextShardIterator :: Lens' GetRecordsResponse (Maybe Text)+grrNextShardIterator =+ lens _grrNextShardIterator (\s a -> s { _grrNextShardIterator = a })++-- | The data records retrieved from the shard.+grrRecords :: Lens' GetRecordsResponse [Record]+grrRecords = lens _grrRecords (\s a -> s { _grrRecords = a }) . _List++instance ToPath GetRecords where+ toPath = const "/"++instance ToQuery GetRecords where+ toQuery = const mempty++instance ToHeaders GetRecords++instance ToJSON GetRecords where+ toJSON GetRecords{..} = object+ [ "ShardIterator" .= _grShardIterator+ , "Limit" .= _grLimit+ ]++instance AWSRequest GetRecords where+ type Sv GetRecords = Kinesis+ type Rs GetRecords = GetRecordsResponse++ request = post "GetRecords"+ response = jsonResponse++instance FromJSON GetRecordsResponse where+ parseJSON = withObject "GetRecordsResponse" $ \o -> GetRecordsResponse+ <$> o .:? "NextShardIterator"+ <*> o .: "Records"
+ gen/Network/AWS/Kinesis/GetShardIterator.hs view
@@ -0,0 +1,185 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module : Network.AWS.Kinesis.GetShardIterator+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)++-- | Gets a shard iterator. A shard iterator expires five minutes after it is+-- returned to the requester. A shard iterator specifies the position in the+-- shard from which to start reading data records sequentially. A shard+-- iterator specifies this position using the sequence number of a data record+-- in a shard. A sequence number is the identifier associated with every+-- record ingested in the Amazon Kinesis stream. The sequence number is+-- assigned when a record is put into the stream. You must specify the shard+-- iterator type. For example, you can set the ShardIteratorType parameter to+-- read exactly from the position denoted by a specific sequence number by+-- using the AT_SEQUENCE_NUMBER shard iterator type, or right after the+-- sequence number by using the AFTER_SEQUENCE_NUMBER shard iterator type,+-- using sequence numbers returned by earlier calls to PutRecord, GetRecords,+-- or DescribeStream. You can specify the shard iterator type TRIM_HORIZON in+-- the request to cause ShardIterator to point to the last untrimmed record in+-- the shard in the system, which is the oldest data record in the shard. Or+-- you can point to just after the most recent record in the shard, by using+-- the shard iterator type LATEST, so that you always read the most recent+-- data in the shard. When you repeatedly read from an Amazon Kinesis stream+-- use a GetShardIterator request to get the first shard iterator to to use in+-- your first GetRecords request and then use the shard iterator returned by+-- the GetRecords request in NextShardIterator for subsequent reads. A new+-- shard iterator is returned by every GetRecords request in+-- NextShardIterator, which you use in the ShardIterator parameter of the next+-- GetRecords request. If a GetShardIterator request is made too often, you+-- receive a ProvisionedThroughputExceededException. For more information+-- about throughput limits, see GetRecords. If the shard is closed, the+-- iterator can't return more data, and GetShardIterator returns null for its+-- ShardIterator. A shard can be closed using SplitShard or MergeShards.+-- GetShardIterator has a limit of 5 transactions per second per account per+-- open shard.+--+-- <http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html>+module Network.AWS.Kinesis.GetShardIterator+ (+ -- * Request+ GetShardIterator+ -- ** Request constructor+ , getShardIterator+ -- ** Request lenses+ , gsiShardId+ , gsiShardIteratorType+ , gsiStartingSequenceNumber+ , gsiStreamName++ -- * Response+ , GetShardIteratorResponse+ -- ** Response constructor+ , getShardIteratorResponse+ -- ** Response lenses+ , gsirShardIterator+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.JSON+import Network.AWS.Kinesis.Types+import qualified GHC.Exts++data GetShardIterator = GetShardIterator+ { _gsiShardId :: Text+ , _gsiShardIteratorType :: Text+ , _gsiStartingSequenceNumber :: Maybe Text+ , _gsiStreamName :: Text+ } deriving (Eq, Ord, Show)++-- | 'GetShardIterator' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gsiShardId' @::@ 'Text'+--+-- * 'gsiShardIteratorType' @::@ 'Text'+--+-- * 'gsiStartingSequenceNumber' @::@ 'Maybe' 'Text'+--+-- * 'gsiStreamName' @::@ 'Text'+--+getShardIterator :: Text -- ^ 'gsiStreamName'+ -> Text -- ^ 'gsiShardId'+ -> Text -- ^ 'gsiShardIteratorType'+ -> GetShardIterator+getShardIterator p1 p2 p3 = GetShardIterator+ { _gsiStreamName = p1+ , _gsiShardId = p2+ , _gsiShardIteratorType = p3+ , _gsiStartingSequenceNumber = Nothing+ }++-- | The shard ID of the shard to get the iterator for.+gsiShardId :: Lens' GetShardIterator Text+gsiShardId = lens _gsiShardId (\s a -> s { _gsiShardId = a })++-- | Determines how the shard iterator is used to start reading data records+-- from the shard. The following are the valid shard iterator types:+-- AT_SEQUENCE_NUMBER - Start reading exactly from the position denoted by a+-- specific sequence number. AFTER_SEQUENCE_NUMBER - Start reading right+-- after the position denoted by a specific sequence number. TRIM_HORIZON -+-- Start reading at the last untrimmed record in the shard in the system,+-- which is the oldest data record in the shard. LATEST - Start reading just+-- after the most recent record in the shard, so that you always read the+-- most recent data in the shard.+gsiShardIteratorType :: Lens' GetShardIterator Text+gsiShardIteratorType =+ lens _gsiShardIteratorType (\s a -> s { _gsiShardIteratorType = a })++-- | The sequence number of the data record in the shard from which to start+-- reading from.+gsiStartingSequenceNumber :: Lens' GetShardIterator (Maybe Text)+gsiStartingSequenceNumber =+ lens _gsiStartingSequenceNumber+ (\s a -> s { _gsiStartingSequenceNumber = a })++-- | The name of the stream.+gsiStreamName :: Lens' GetShardIterator Text+gsiStreamName = lens _gsiStreamName (\s a -> s { _gsiStreamName = a })++newtype GetShardIteratorResponse = GetShardIteratorResponse+ { _gsirShardIterator :: Maybe Text+ } deriving (Eq, Ord, Show, Monoid)++-- | 'GetShardIteratorResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gsirShardIterator' @::@ 'Maybe' 'Text'+--+getShardIteratorResponse :: GetShardIteratorResponse+getShardIteratorResponse = GetShardIteratorResponse+ { _gsirShardIterator = Nothing+ }++-- | The position in the shard from which to start reading data records+-- sequentially. A shard iterator specifies this position using the sequence+-- number of a data record in a shard.+gsirShardIterator :: Lens' GetShardIteratorResponse (Maybe Text)+gsirShardIterator =+ lens _gsirShardIterator (\s a -> s { _gsirShardIterator = a })++instance ToPath GetShardIterator where+ toPath = const "/"++instance ToQuery GetShardIterator where+ toQuery = const mempty++instance ToHeaders GetShardIterator++instance ToJSON GetShardIterator where+ toJSON GetShardIterator{..} = object+ [ "StreamName" .= _gsiStreamName+ , "ShardId" .= _gsiShardId+ , "ShardIteratorType" .= _gsiShardIteratorType+ , "StartingSequenceNumber" .= _gsiStartingSequenceNumber+ ]++instance AWSRequest GetShardIterator where+ type Sv GetShardIterator = Kinesis+ type Rs GetShardIterator = GetShardIteratorResponse++ request = post "GetShardIterator"+ response = jsonResponse++instance FromJSON GetShardIteratorResponse where+ parseJSON = withObject "GetShardIteratorResponse" $ \o -> GetShardIteratorResponse+ <$> o .:? "ShardIterator"
+ gen/Network/AWS/Kinesis/ListStreams.hs view
@@ -0,0 +1,150 @@+{-# 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.Kinesis.ListStreams+-- 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 your streams. The number of streams may be too large to return from a+-- single call to ListStreams. You can limit the number of returned streams+-- using the Limit parameter. If you do not specify a value for the Limit+-- parameter, Amazon Kinesis uses the default limit, which is currently 10.+-- You can detect if there are more streams available to list by using the+-- HasMoreStreams flag from the returned output. If there are more streams+-- available, you can request more streams by using the name of the last+-- stream returned by the ListStreams request in the ExclusiveStartStreamName+-- parameter in a subsequent request to ListStreams. The group of stream names+-- returned by the subsequent request is then added to the list. You can+-- continue this process until all the stream names have been collected in the+-- list. ListStreams has a limit of 5 transactions per second per account.+--+-- <http://docs.aws.amazon.com/kinesis/latest/APIReference/API_ListStreams.html>+module Network.AWS.Kinesis.ListStreams+ (+ -- * Request+ ListStreams+ -- ** Request constructor+ , listStreams+ -- ** Request lenses+ , lsExclusiveStartStreamName+ , lsLimit++ -- * Response+ , ListStreamsResponse+ -- ** Response constructor+ , listStreamsResponse+ -- ** Response lenses+ , lsrHasMoreStreams+ , lsrStreamNames+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.JSON+import Network.AWS.Kinesis.Types+import qualified GHC.Exts++data ListStreams = ListStreams+ { _lsExclusiveStartStreamName :: Maybe Text+ , _lsLimit :: Maybe Nat+ } deriving (Eq, Ord, Show)++-- | 'ListStreams' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lsExclusiveStartStreamName' @::@ 'Maybe' 'Text'+--+-- * 'lsLimit' @::@ 'Maybe' 'Natural'+--+listStreams :: ListStreams+listStreams = ListStreams+ { _lsLimit = Nothing+ , _lsExclusiveStartStreamName = Nothing+ }++-- | The name of the stream to start the list with.+lsExclusiveStartStreamName :: Lens' ListStreams (Maybe Text)+lsExclusiveStartStreamName =+ lens _lsExclusiveStartStreamName+ (\s a -> s { _lsExclusiveStartStreamName = a })++-- | The maximum number of streams to list.+lsLimit :: Lens' ListStreams (Maybe Natural)+lsLimit = lens _lsLimit (\s a -> s { _lsLimit = a }) . mapping _Nat++data ListStreamsResponse = ListStreamsResponse+ { _lsrHasMoreStreams :: Bool+ , _lsrStreamNames :: List "StreamNames" Text+ } deriving (Eq, Ord, Show)++-- | 'ListStreamsResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lsrHasMoreStreams' @::@ 'Bool'+--+-- * 'lsrStreamNames' @::@ ['Text']+--+listStreamsResponse :: Bool -- ^ 'lsrHasMoreStreams'+ -> ListStreamsResponse+listStreamsResponse p1 = ListStreamsResponse+ { _lsrHasMoreStreams = p1+ , _lsrStreamNames = mempty+ }++-- | If set to true, there are more streams available to list.+lsrHasMoreStreams :: Lens' ListStreamsResponse Bool+lsrHasMoreStreams =+ lens _lsrHasMoreStreams (\s a -> s { _lsrHasMoreStreams = a })++-- | The names of the streams that are associated with the AWS account making+-- the ListStreams request.+lsrStreamNames :: Lens' ListStreamsResponse [Text]+lsrStreamNames = lens _lsrStreamNames (\s a -> s { _lsrStreamNames = a }) . _List++instance ToPath ListStreams where+ toPath = const "/"++instance ToQuery ListStreams where+ toQuery = const mempty++instance ToHeaders ListStreams++instance ToJSON ListStreams where+ toJSON ListStreams{..} = object+ [ "Limit" .= _lsLimit+ , "ExclusiveStartStreamName" .= _lsExclusiveStartStreamName+ ]++instance AWSRequest ListStreams where+ type Sv ListStreams = Kinesis+ type Rs ListStreams = ListStreamsResponse++ request = post "ListStreams"+ response = jsonResponse++instance FromJSON ListStreamsResponse where+ parseJSON = withObject "ListStreamsResponse" $ \o -> ListStreamsResponse+ <$> o .: "HasMoreStreams"+ <*> o .: "StreamNames"++instance AWSPager ListStreams where+ page rq rs+ | stop (rs ^. lsrHasMoreStreams) = Nothing+ | otherwise = Just $ rq+ & lsExclusiveStartStreamName .~ rs ^. index lsrStreamNames (to id)
+ gen/Network/AWS/Kinesis/ListTagsForStream.hs view
@@ -0,0 +1,149 @@+{-# 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.Kinesis.ListTagsForStream+-- 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 tags for the specified Amazon Kinesis stream.+--+-- <http://docs.aws.amazon.com/kinesis/latest/APIReference/API_ListTagsForStream.html>+module Network.AWS.Kinesis.ListTagsForStream+ (+ -- * Request+ ListTagsForStream+ -- ** Request constructor+ , listTagsForStream+ -- ** Request lenses+ , ltfsExclusiveStartTagKey+ , ltfsLimit+ , ltfsStreamName++ -- * Response+ , ListTagsForStreamResponse+ -- ** Response constructor+ , listTagsForStreamResponse+ -- ** Response lenses+ , ltfsrHasMoreTags+ , ltfsrTags+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.JSON+import Network.AWS.Kinesis.Types+import qualified GHC.Exts++data ListTagsForStream = ListTagsForStream+ { _ltfsExclusiveStartTagKey :: Maybe Text+ , _ltfsLimit :: Maybe Nat+ , _ltfsStreamName :: Text+ } deriving (Eq, Ord, Show)++-- | 'ListTagsForStream' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ltfsExclusiveStartTagKey' @::@ 'Maybe' 'Text'+--+-- * 'ltfsLimit' @::@ 'Maybe' 'Natural'+--+-- * 'ltfsStreamName' @::@ 'Text'+--+listTagsForStream :: Text -- ^ 'ltfsStreamName'+ -> ListTagsForStream+listTagsForStream p1 = ListTagsForStream+ { _ltfsStreamName = p1+ , _ltfsExclusiveStartTagKey = Nothing+ , _ltfsLimit = Nothing+ }++-- | The key to use as the starting point for the list of tags. If this+-- parameter is set, ListTagsForStream gets all tags that occur after+-- ExclusiveStartTagKey.+ltfsExclusiveStartTagKey :: Lens' ListTagsForStream (Maybe Text)+ltfsExclusiveStartTagKey =+ lens _ltfsExclusiveStartTagKey+ (\s a -> s { _ltfsExclusiveStartTagKey = a })++-- | The number of tags to return. If this number is less than the total+-- number of tags associated with the stream, HasMoreTags is set to true. To+-- list additional tags, set ExclusiveStartTagKey to the last key in the+-- response.+ltfsLimit :: Lens' ListTagsForStream (Maybe Natural)+ltfsLimit = lens _ltfsLimit (\s a -> s { _ltfsLimit = a }) . mapping _Nat++-- | The name of the stream.+ltfsStreamName :: Lens' ListTagsForStream Text+ltfsStreamName = lens _ltfsStreamName (\s a -> s { _ltfsStreamName = a })++data ListTagsForStreamResponse = ListTagsForStreamResponse+ { _ltfsrHasMoreTags :: Bool+ , _ltfsrTags :: List "Tags" Tag+ } deriving (Eq, Show)++-- | 'ListTagsForStreamResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ltfsrHasMoreTags' @::@ 'Bool'+--+-- * 'ltfsrTags' @::@ ['Tag']+--+listTagsForStreamResponse :: Bool -- ^ 'ltfsrHasMoreTags'+ -> ListTagsForStreamResponse+listTagsForStreamResponse p1 = ListTagsForStreamResponse+ { _ltfsrHasMoreTags = p1+ , _ltfsrTags = mempty+ }++-- | If set to true, more tags are available. To request additional tags, set+-- ExclusiveStartTagKey to the key of the last tag returned.+ltfsrHasMoreTags :: Lens' ListTagsForStreamResponse Bool+ltfsrHasMoreTags = lens _ltfsrHasMoreTags (\s a -> s { _ltfsrHasMoreTags = a })++-- | A list of tags associated with StreamName, starting with the first tag+-- after ExclusiveStartTagKey and up to the specified Limit.+ltfsrTags :: Lens' ListTagsForStreamResponse [Tag]+ltfsrTags = lens _ltfsrTags (\s a -> s { _ltfsrTags = a }) . _List++instance ToPath ListTagsForStream where+ toPath = const "/"++instance ToQuery ListTagsForStream where+ toQuery = const mempty++instance ToHeaders ListTagsForStream++instance ToJSON ListTagsForStream where+ toJSON ListTagsForStream{..} = object+ [ "StreamName" .= _ltfsStreamName+ , "ExclusiveStartTagKey" .= _ltfsExclusiveStartTagKey+ , "Limit" .= _ltfsLimit+ ]++instance AWSRequest ListTagsForStream where+ type Sv ListTagsForStream = Kinesis+ type Rs ListTagsForStream = ListTagsForStreamResponse++ request = post "ListTagsForStream"+ response = jsonResponse++instance FromJSON ListTagsForStreamResponse where+ parseJSON = withObject "ListTagsForStreamResponse" $ \o -> ListTagsForStreamResponse+ <$> o .: "HasMoreTags"+ <*> o .: "Tags"
+ gen/Network/AWS/Kinesis/MergeShards.hs view
@@ -0,0 +1,141 @@+{-# 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.Kinesis.MergeShards+-- 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)++-- | Merges two adjacent shards in a stream and combines them into a single+-- shard to reduce the stream's capacity to ingest and transport data. Two+-- shards are considered adjacent if the union of the hash key ranges for the+-- two shards form a contiguous set with no gaps. For example, if you have two+-- shards, one with a hash key range of 276...381 and the other with a hash+-- key range of 382...454, then you could merge these two shards into a single+-- shard that would have a hash key range of 276...454. After the merge, the+-- single child shard receives data for all hash key values covered by the two+-- parent shards. MergeShards is called when there is a need to reduce the+-- overall capacity of a stream because of excess capacity that is not being+-- used. You must specify the shard to be merged and the adjacent shard for a+-- stream. For more information about merging shards, see Merge Two Shards in+-- the Amazon Kinesis Developer Guide. If the stream is in the ACTIVE state,+-- you can call MergeShards. If a stream is in the CREATING, UPDATING, or+-- DELETING state, MergeShards returns a ResourceInUseException. If the+-- specified stream does not exist, MergeShards returns a+-- ResourceNotFoundException. You can use DescribeStream to check the state of+-- the stream, which is returned in StreamStatus. MergeShards is an+-- asynchronous operation. Upon receiving a MergeShards request, Amazon+-- Kinesis immediately returns a response and sets the StreamStatus to+-- UPDATING. After the operation is completed, Amazon Kinesis sets the+-- StreamStatus to ACTIVE. Read and write operations continue to work while+-- the stream is in the UPDATING state. You use DescribeStream to determine+-- the shard IDs that are specified in the MergeShards request. If you try to+-- operate on too many streams in parallel using CreateStream, DeleteStream,+-- MergeShards or SplitShard, you will receive a LimitExceededException.+-- MergeShards has limit of 5 transactions per second per account.+--+-- <http://docs.aws.amazon.com/kinesis/latest/APIReference/API_MergeShards.html>+module Network.AWS.Kinesis.MergeShards+ (+ -- * Request+ MergeShards+ -- ** Request constructor+ , mergeShards+ -- ** Request lenses+ , msAdjacentShardToMerge+ , msShardToMerge+ , msStreamName++ -- * Response+ , MergeShardsResponse+ -- ** Response constructor+ , mergeShardsResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.JSON+import Network.AWS.Kinesis.Types+import qualified GHC.Exts++data MergeShards = MergeShards+ { _msAdjacentShardToMerge :: Text+ , _msShardToMerge :: Text+ , _msStreamName :: Text+ } deriving (Eq, Ord, Show)++-- | 'MergeShards' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'msAdjacentShardToMerge' @::@ 'Text'+--+-- * 'msShardToMerge' @::@ 'Text'+--+-- * 'msStreamName' @::@ 'Text'+--+mergeShards :: Text -- ^ 'msStreamName'+ -> Text -- ^ 'msShardToMerge'+ -> Text -- ^ 'msAdjacentShardToMerge'+ -> MergeShards+mergeShards p1 p2 p3 = MergeShards+ { _msStreamName = p1+ , _msShardToMerge = p2+ , _msAdjacentShardToMerge = p3+ }++-- | The shard ID of the adjacent shard for the merge.+msAdjacentShardToMerge :: Lens' MergeShards Text+msAdjacentShardToMerge =+ lens _msAdjacentShardToMerge (\s a -> s { _msAdjacentShardToMerge = a })++-- | The shard ID of the shard to combine with the adjacent shard for the+-- merge.+msShardToMerge :: Lens' MergeShards Text+msShardToMerge = lens _msShardToMerge (\s a -> s { _msShardToMerge = a })++-- | The name of the stream for the merge.+msStreamName :: Lens' MergeShards Text+msStreamName = lens _msStreamName (\s a -> s { _msStreamName = a })++data MergeShardsResponse = MergeShardsResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'MergeShardsResponse' constructor.+mergeShardsResponse :: MergeShardsResponse+mergeShardsResponse = MergeShardsResponse++instance ToPath MergeShards where+ toPath = const "/"++instance ToQuery MergeShards where+ toQuery = const mempty++instance ToHeaders MergeShards++instance ToJSON MergeShards where+ toJSON MergeShards{..} = object+ [ "StreamName" .= _msStreamName+ , "ShardToMerge" .= _msShardToMerge+ , "AdjacentShardToMerge" .= _msAdjacentShardToMerge+ ]++instance AWSRequest MergeShards where+ type Sv MergeShards = Kinesis+ type Rs MergeShards = MergeShardsResponse++ request = post "MergeShards"+ response = nullResponse MergeShardsResponse
+ gen/Network/AWS/Kinesis/PutRecord.hs view
@@ -0,0 +1,210 @@+{-# 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.Kinesis.PutRecord+-- 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)++-- | Puts a data record from a producer into an Amazon Kinesis stream. You must+-- call PutRecord to send data from the producer into the Amazon Kinesis+-- stream for real-time ingestion and subsequent processing. You must specify+-- the name of the stream that captures, stores, and transports the data; a+-- partition key; and the data blob itself. The data blob could be a segment+-- from a log file, geographic/location data, website clickstream data, or any+-- other data type. The partition key is used to distribute data across+-- shards. Amazon Kinesis segregates the data records that belong to a data+-- stream into multiple shards, using the partition key associated with each+-- data record to determine which shard a given data record belongs to.+-- Partition keys are Unicode strings, with a maximum length limit of 256+-- bytes. An MD5 hash function is used to map partition keys to 128-bit+-- integer values and to map associated data records to shards using the hash+-- key ranges of the shards. You can override hashing the partition key to+-- determine the shard by explicitly specifying a hash value using the+-- ExplicitHashKey parameter. For more information, see Partition Key in the+-- Amazon Kinesis Developer Guide. PutRecord returns the shard ID of where the+-- data record was placed and the sequence number that was assigned to the+-- data record. Sequence numbers generally increase over time. To guarantee+-- strictly increasing ordering, use the SequenceNumberForOrdering parameter.+-- For more information, see Sequence Number in the Amazon Kinesis Developer+-- Guide. If a PutRecord request cannot be processed because of insufficient+-- provisioned throughput on the shard involved in the request, PutRecord+-- throws ProvisionedThroughputExceededException. Data records are accessible+-- for only 24 hours from the time that they are added to an Amazon Kinesis+-- stream.+--+-- <http://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecord.html>+module Network.AWS.Kinesis.PutRecord+ (+ -- * Request+ PutRecord+ -- ** Request constructor+ , putRecord+ -- ** Request lenses+ , prData+ , prExplicitHashKey+ , prPartitionKey+ , prSequenceNumberForOrdering+ , prStreamName++ -- * Response+ , PutRecordResponse+ -- ** Response constructor+ , putRecordResponse+ -- ** Response lenses+ , prrSequenceNumber+ , prrShardId+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.JSON+import Network.AWS.Kinesis.Types+import qualified GHC.Exts++data PutRecord = PutRecord+ { _prData :: Base64+ , _prExplicitHashKey :: Maybe Text+ , _prPartitionKey :: Text+ , _prSequenceNumberForOrdering :: Maybe Text+ , _prStreamName :: Text+ } deriving (Eq, Show)++-- | 'PutRecord' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'prData' @::@ 'Base64'+--+-- * 'prExplicitHashKey' @::@ 'Maybe' 'Text'+--+-- * 'prPartitionKey' @::@ 'Text'+--+-- * 'prSequenceNumberForOrdering' @::@ 'Maybe' 'Text'+--+-- * 'prStreamName' @::@ 'Text'+--+putRecord :: Text -- ^ 'prStreamName'+ -> Base64 -- ^ 'prData'+ -> Text -- ^ 'prPartitionKey'+ -> PutRecord+putRecord p1 p2 p3 = PutRecord+ { _prStreamName = p1+ , _prData = p2+ , _prPartitionKey = p3+ , _prExplicitHashKey = Nothing+ , _prSequenceNumberForOrdering = Nothing+ }++-- | The data blob to put into the record, which is Base64-encoded when the+-- blob is serialized. The maximum size of the data blob (the payload before+-- Base64-encoding) is 50 kilobytes (KB).+prData :: Lens' PutRecord Base64+prData = lens _prData (\s a -> s { _prData = a })++-- | The hash value used to explicitly determine the shard the data record is+-- assigned to by overriding the partition key hash.+prExplicitHashKey :: Lens' PutRecord (Maybe Text)+prExplicitHashKey =+ lens _prExplicitHashKey (\s a -> s { _prExplicitHashKey = a })++-- | Determines which shard in the stream the data record is assigned to.+-- Partition keys are Unicode strings with a maximum length limit of 256+-- bytes. Amazon Kinesis uses the partition key as input to a hash function+-- that maps the partition key and associated data to a specific shard.+-- Specifically, an MD5 hash function is used to map partition keys to+-- 128-bit integer values and to map associated data records to shards. As a+-- result of this hashing mechanism, all data records with the same+-- partition key will map to the same shard within the stream.+prPartitionKey :: Lens' PutRecord Text+prPartitionKey = lens _prPartitionKey (\s a -> s { _prPartitionKey = a })++-- | Guarantees strictly increasing sequence numbers, for puts from the same+-- client and to the same partition key. Usage: set the+-- SequenceNumberForOrdering of record n to the sequence number of record+-- n-1 (as returned in the PutRecordResult when putting record n-1). If this+-- parameter is not set, records will be coarsely ordered based on arrival+-- time.+prSequenceNumberForOrdering :: Lens' PutRecord (Maybe Text)+prSequenceNumberForOrdering =+ lens _prSequenceNumberForOrdering+ (\s a -> s { _prSequenceNumberForOrdering = a })++-- | The name of the stream to put the data record into.+prStreamName :: Lens' PutRecord Text+prStreamName = lens _prStreamName (\s a -> s { _prStreamName = a })++data PutRecordResponse = PutRecordResponse+ { _prrSequenceNumber :: Text+ , _prrShardId :: Text+ } deriving (Eq, Ord, Show)++-- | 'PutRecordResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'prrSequenceNumber' @::@ 'Text'+--+-- * 'prrShardId' @::@ 'Text'+--+putRecordResponse :: Text -- ^ 'prrShardId'+ -> Text -- ^ 'prrSequenceNumber'+ -> PutRecordResponse+putRecordResponse p1 p2 = PutRecordResponse+ { _prrShardId = p1+ , _prrSequenceNumber = p2+ }++-- | The sequence number identifier that was assigned to the put data record.+-- The sequence number for the record is unique across all records in the+-- stream. A sequence number is the identifier associated with every record+-- put into the stream.+prrSequenceNumber :: Lens' PutRecordResponse Text+prrSequenceNumber =+ lens _prrSequenceNumber (\s a -> s { _prrSequenceNumber = a })++-- | The shard ID of the shard where the data record was placed.+prrShardId :: Lens' PutRecordResponse Text+prrShardId = lens _prrShardId (\s a -> s { _prrShardId = a })++instance ToPath PutRecord where+ toPath = const "/"++instance ToQuery PutRecord where+ toQuery = const mempty++instance ToHeaders PutRecord++instance ToJSON PutRecord where+ toJSON PutRecord{..} = object+ [ "StreamName" .= _prStreamName+ , "Data" .= _prData+ , "PartitionKey" .= _prPartitionKey+ , "ExplicitHashKey" .= _prExplicitHashKey+ , "SequenceNumberForOrdering" .= _prSequenceNumberForOrdering+ ]++instance AWSRequest PutRecord where+ type Sv PutRecord = Kinesis+ type Rs PutRecord = PutRecordResponse++ request = post "PutRecord"+ response = jsonResponse++instance FromJSON PutRecordResponse where+ parseJSON = withObject "PutRecordResponse" $ \o -> PutRecordResponse+ <$> o .: "SequenceNumber"+ <*> o .: "ShardId"
+ gen/Network/AWS/Kinesis/RemoveTagsFromStream.hs view
@@ -0,0 +1,103 @@+{-# 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.Kinesis.RemoveTagsFromStream+-- 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 tags from the specified Amazon Kinesis stream. If you specify a tag+-- that does not exist, it is ignored.+--+-- <http://docs.aws.amazon.com/kinesis/latest/APIReference/API_RemoveTagsFromStream.html>+module Network.AWS.Kinesis.RemoveTagsFromStream+ (+ -- * Request+ RemoveTagsFromStream+ -- ** Request constructor+ , removeTagsFromStream+ -- ** Request lenses+ , rtfsStreamName+ , rtfsTagKeys++ -- * Response+ , RemoveTagsFromStreamResponse+ -- ** Response constructor+ , removeTagsFromStreamResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.JSON+import Network.AWS.Kinesis.Types+import qualified GHC.Exts++data RemoveTagsFromStream = RemoveTagsFromStream+ { _rtfsStreamName :: Text+ , _rtfsTagKeys :: List1 "TagKeys" Text+ } deriving (Eq, Ord, Show)++-- | 'RemoveTagsFromStream' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'rtfsStreamName' @::@ 'Text'+--+-- * 'rtfsTagKeys' @::@ 'NonEmpty' 'Text'+--+removeTagsFromStream :: Text -- ^ 'rtfsStreamName'+ -> NonEmpty Text -- ^ 'rtfsTagKeys'+ -> RemoveTagsFromStream+removeTagsFromStream p1 p2 = RemoveTagsFromStream+ { _rtfsStreamName = p1+ , _rtfsTagKeys = withIso _List1 (const id) p2+ }++-- | The name of the stream.+rtfsStreamName :: Lens' RemoveTagsFromStream Text+rtfsStreamName = lens _rtfsStreamName (\s a -> s { _rtfsStreamName = a })++-- | A list of tag keys. Each corresponding tag is removed from the stream.+rtfsTagKeys :: Lens' RemoveTagsFromStream (NonEmpty Text)+rtfsTagKeys = lens _rtfsTagKeys (\s a -> s { _rtfsTagKeys = a }) . _List1++data RemoveTagsFromStreamResponse = RemoveTagsFromStreamResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'RemoveTagsFromStreamResponse' constructor.+removeTagsFromStreamResponse :: RemoveTagsFromStreamResponse+removeTagsFromStreamResponse = RemoveTagsFromStreamResponse++instance ToPath RemoveTagsFromStream where+ toPath = const "/"++instance ToQuery RemoveTagsFromStream where+ toQuery = const mempty++instance ToHeaders RemoveTagsFromStream++instance ToJSON RemoveTagsFromStream where+ toJSON RemoveTagsFromStream{..} = object+ [ "StreamName" .= _rtfsStreamName+ , "TagKeys" .= _rtfsTagKeys+ ]++instance AWSRequest RemoveTagsFromStream where+ type Sv RemoveTagsFromStream = Kinesis+ type Rs RemoveTagsFromStream = RemoveTagsFromStreamResponse++ request = post "RemoveTagsFromStream"+ response = nullResponse RemoveTagsFromStreamResponse
+ gen/Network/AWS/Kinesis/SplitShard.hs view
@@ -0,0 +1,154 @@+{-# 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.Kinesis.SplitShard+-- 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)++-- | Splits a shard into two new shards in the stream, to increase the stream's+-- capacity to ingest and transport data. SplitShard is called when there is a+-- need to increase the overall capacity of stream because of an expected+-- increase in the volume of data records being ingested. You can also use+-- SplitShard when a shard appears to be approaching its maximum utilization,+-- for example, when the set of producers sending data into the specific shard+-- are suddenly sending more than previously anticipated. You can also call+-- SplitShard to increase stream capacity, so that more Amazon Kinesis+-- applications can simultaneously read data from the stream for real-time+-- processing. You must specify the shard to be split and the new hash key,+-- which is the position in the shard where the shard gets split in two. In+-- many cases, the new hash key might simply be the average of the beginning+-- and ending hash key, but it can be any hash key value in the range being+-- mapped into the shard. For more information about splitting shards, see+-- Split a Shard in the Amazon Kinesis Developer Guide. You can use+-- DescribeStream to determine the shard ID and hash key values for the+-- ShardToSplit and NewStartingHashKey parameters that are specified in the+-- SplitShard request. SplitShard is an asynchronous operation. Upon receiving+-- a SplitShard request, Amazon Kinesis immediately returns a response and+-- sets the stream status to UPDATING. After the operation is completed,+-- Amazon Kinesis sets the stream status to ACTIVE. Read and write operations+-- continue to work while the stream is in the UPDATING state. You can use+-- DescribeStream to check the status of the stream, which is returned in+-- StreamStatus. If the stream is in the ACTIVE state, you can call+-- SplitShard. If a stream is in CREATING or UPDATING or DELETING states,+-- DescribeStream returns a ResourceInUseException. If the specified stream+-- does not exist, DescribeStream returns a ResourceNotFoundException. If you+-- try to create more shards than are authorized for your account, you receive+-- a LimitExceededException. The default limit for an AWS account is 10 shards+-- per stream. If you need to create a stream with more than 10 shards,+-- contact AWS Support to increase the limit on your account. If you try to+-- operate on too many streams in parallel using CreateStream, DeleteStream,+-- MergeShards or SplitShard, you receive a LimitExceededException. SplitShard+-- has limit of 5 transactions per second per account.+--+-- <http://docs.aws.amazon.com/kinesis/latest/APIReference/API_SplitShard.html>+module Network.AWS.Kinesis.SplitShard+ (+ -- * Request+ SplitShard+ -- ** Request constructor+ , splitShard+ -- ** Request lenses+ , ssNewStartingHashKey+ , ssShardToSplit+ , ssStreamName++ -- * Response+ , SplitShardResponse+ -- ** Response constructor+ , splitShardResponse+ ) where++import Network.AWS.Prelude+import Network.AWS.Request.JSON+import Network.AWS.Kinesis.Types+import qualified GHC.Exts++data SplitShard = SplitShard+ { _ssNewStartingHashKey :: Text+ , _ssShardToSplit :: Text+ , _ssStreamName :: Text+ } deriving (Eq, Ord, Show)++-- | 'SplitShard' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ssNewStartingHashKey' @::@ 'Text'+--+-- * 'ssShardToSplit' @::@ 'Text'+--+-- * 'ssStreamName' @::@ 'Text'+--+splitShard :: Text -- ^ 'ssStreamName'+ -> Text -- ^ 'ssShardToSplit'+ -> Text -- ^ 'ssNewStartingHashKey'+ -> SplitShard+splitShard p1 p2 p3 = SplitShard+ { _ssStreamName = p1+ , _ssShardToSplit = p2+ , _ssNewStartingHashKey = p3+ }++-- | A hash key value for the starting hash key of one of the child shards+-- created by the split. The hash key range for a given shard constitutes a+-- set of ordered contiguous positive integers. The value for+-- NewStartingHashKey must be in the range of hash keys being mapped into+-- the shard. The NewStartingHashKey hash key value and all higher hash key+-- values in hash key range are distributed to one of the child shards. All+-- the lower hash key values in the range are distributed to the other child+-- shard.+ssNewStartingHashKey :: Lens' SplitShard Text+ssNewStartingHashKey =+ lens _ssNewStartingHashKey (\s a -> s { _ssNewStartingHashKey = a })++-- | The shard ID of the shard to split.+ssShardToSplit :: Lens' SplitShard Text+ssShardToSplit = lens _ssShardToSplit (\s a -> s { _ssShardToSplit = a })++-- | The name of the stream for the shard split.+ssStreamName :: Lens' SplitShard Text+ssStreamName = lens _ssStreamName (\s a -> s { _ssStreamName = a })++data SplitShardResponse = SplitShardResponse+ deriving (Eq, Ord, Show, Generic)++-- | 'SplitShardResponse' constructor.+splitShardResponse :: SplitShardResponse+splitShardResponse = SplitShardResponse++instance ToPath SplitShard where+ toPath = const "/"++instance ToQuery SplitShard where+ toQuery = const mempty++instance ToHeaders SplitShard++instance ToJSON SplitShard where+ toJSON SplitShard{..} = object+ [ "StreamName" .= _ssStreamName+ , "ShardToSplit" .= _ssShardToSplit+ , "NewStartingHashKey" .= _ssNewStartingHashKey+ ]++instance AWSRequest SplitShard where+ type Sv SplitShard = Kinesis+ type Rs SplitShard = SplitShardResponse++ request = post "SplitShard"+ response = nullResponse SplitShardResponse
+ gen/Network/AWS/Kinesis/Types.hs view
@@ -0,0 +1,492 @@+{-# 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.Kinesis.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.Kinesis.Types+ (+ -- * Service+ Kinesis+ -- ** Error+ , JSONError++ -- * Shard+ , Shard+ , shard+ , sAdjacentParentShardId+ , sHashKeyRange+ , sParentShardId+ , sSequenceNumberRange+ , sShardId++ -- * Tag+ , Tag+ , tag+ , tagKey+ , tagValue++ -- * StreamDescription+ , StreamDescription+ , streamDescription+ , sdHasMoreShards+ , sdShards+ , sdStreamARN+ , sdStreamName+ , sdStreamStatus++ -- * StreamStatus+ , StreamStatus (..)++ -- * HashKeyRange+ , HashKeyRange+ , hashKeyRange+ , hkrEndingHashKey+ , hkrStartingHashKey++ -- * Record+ , Record+ , record+ , rData+ , rPartitionKey+ , rSequenceNumber++ -- * SequenceNumberRange+ , SequenceNumberRange+ , sequenceNumberRange+ , snrEndingSequenceNumber+ , snrStartingSequenceNumber++ -- * ShardIteratorType+ , ShardIteratorType (..)+ ) where++import Data.Char (isUpper)+import Network.AWS.Error+import Network.AWS.Prelude+import Network.AWS.Signing.V4+import qualified GHC.Exts++-- | Version @2013-12-02@ of the Amazon Kinesis service.+data Kinesis++instance AWSService Kinesis where+ type Sg Kinesis = V4+ type Er Kinesis = JSONError++ service = Service+ { _svcEndpoint = regional+ , _svcAbbrev = "Kinesis"+ , _svcPrefix = "kinesis"+ , _svcVersion = "2013-12-02"+ , _svcTargetPrefix = Just "Kinesis_20131202"+ , _svcJSONVersion = Just "1.1"+ }++ handle = jsonError statusSuccess++data Shard = Shard+ { _sAdjacentParentShardId :: Maybe Text+ , _sHashKeyRange :: HashKeyRange+ , _sParentShardId :: Maybe Text+ , _sSequenceNumberRange :: SequenceNumberRange+ , _sShardId :: Text+ } deriving (Eq, Show)++-- | 'Shard' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'sAdjacentParentShardId' @::@ 'Maybe' 'Text'+--+-- * 'sHashKeyRange' @::@ 'HashKeyRange'+--+-- * 'sParentShardId' @::@ 'Maybe' 'Text'+--+-- * 'sSequenceNumberRange' @::@ 'SequenceNumberRange'+--+-- * 'sShardId' @::@ 'Text'+--+shard :: Text -- ^ 'sShardId'+ -> HashKeyRange -- ^ 'sHashKeyRange'+ -> SequenceNumberRange -- ^ 'sSequenceNumberRange'+ -> Shard+shard p1 p2 p3 = Shard+ { _sShardId = p1+ , _sHashKeyRange = p2+ , _sSequenceNumberRange = p3+ , _sParentShardId = Nothing+ , _sAdjacentParentShardId = Nothing+ }++-- | The shard Id of the shard adjacent to the shard's parent.+sAdjacentParentShardId :: Lens' Shard (Maybe Text)+sAdjacentParentShardId =+ lens _sAdjacentParentShardId (\s a -> s { _sAdjacentParentShardId = a })++-- | The range of possible hash key values for the shard, which is a set of+-- ordered contiguous positive integers.+sHashKeyRange :: Lens' Shard HashKeyRange+sHashKeyRange = lens _sHashKeyRange (\s a -> s { _sHashKeyRange = a })++-- | The shard Id of the shard's parent.+sParentShardId :: Lens' Shard (Maybe Text)+sParentShardId = lens _sParentShardId (\s a -> s { _sParentShardId = a })++-- | The range of possible sequence numbers for the shard.+sSequenceNumberRange :: Lens' Shard SequenceNumberRange+sSequenceNumberRange =+ lens _sSequenceNumberRange (\s a -> s { _sSequenceNumberRange = a })++-- | The unique identifier of the shard within the Amazon Kinesis stream.+sShardId :: Lens' Shard Text+sShardId = lens _sShardId (\s a -> s { _sShardId = a })++instance FromJSON Shard where+ parseJSON = withObject "Shard" $ \o -> Shard+ <$> o .:? "AdjacentParentShardId"+ <*> o .: "HashKeyRange"+ <*> o .:? "ParentShardId"+ <*> o .: "SequenceNumberRange"+ <*> o .: "ShardId"++instance ToJSON Shard where+ toJSON Shard{..} = object+ [ "ShardId" .= _sShardId+ , "ParentShardId" .= _sParentShardId+ , "AdjacentParentShardId" .= _sAdjacentParentShardId+ , "HashKeyRange" .= _sHashKeyRange+ , "SequenceNumberRange" .= _sSequenceNumberRange+ ]++data Tag = Tag+ { _tagKey :: Text+ , _tagValue :: Maybe Text+ } deriving (Eq, Ord, Show)++-- | 'Tag' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'tagKey' @::@ 'Text'+--+-- * 'tagValue' @::@ 'Maybe' 'Text'+--+tag :: Text -- ^ 'tagKey'+ -> Tag+tag p1 = Tag+ { _tagKey = p1+ , _tagValue = Nothing+ }++-- | A unique identifier for the tag. Maximum length: 128 characters. Valid+-- characters: Unicode letters, digits, white space, _ . / = + - % @.+tagKey :: Lens' Tag Text+tagKey = lens _tagKey (\s a -> s { _tagKey = a })++-- | An optional string, typically used to describe or define the tag. Maximum+-- length: 256 characters. Valid characters: Unicode letters, digits, white+-- space, _ . / = + - % @.+tagValue :: Lens' Tag (Maybe Text)+tagValue = lens _tagValue (\s a -> s { _tagValue = a })++instance FromJSON Tag where+ parseJSON = withObject "Tag" $ \o -> Tag+ <$> o .: "Key"+ <*> o .:? "Value"++instance ToJSON Tag where+ toJSON Tag{..} = object+ [ "Key" .= _tagKey+ , "Value" .= _tagValue+ ]++data StreamDescription = StreamDescription+ { _sdHasMoreShards :: Bool+ , _sdShards :: List "Shards" Shard+ , _sdStreamARN :: Text+ , _sdStreamName :: Text+ , _sdStreamStatus :: Text+ } deriving (Eq, Show)++-- | 'StreamDescription' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'sdHasMoreShards' @::@ 'Bool'+--+-- * 'sdShards' @::@ ['Shard']+--+-- * 'sdStreamARN' @::@ 'Text'+--+-- * 'sdStreamName' @::@ 'Text'+--+-- * 'sdStreamStatus' @::@ 'Text'+--+streamDescription :: Text -- ^ 'sdStreamName'+ -> Text -- ^ 'sdStreamARN'+ -> Text -- ^ 'sdStreamStatus'+ -> Bool -- ^ 'sdHasMoreShards'+ -> StreamDescription+streamDescription p1 p2 p3 p4 = StreamDescription+ { _sdStreamName = p1+ , _sdStreamARN = p2+ , _sdStreamStatus = p3+ , _sdHasMoreShards = p4+ , _sdShards = mempty+ }++-- | If set to true, more shards in the stream are available to describe.+sdHasMoreShards :: Lens' StreamDescription Bool+sdHasMoreShards = lens _sdHasMoreShards (\s a -> s { _sdHasMoreShards = a })++-- | The shards that comprise the stream.+sdShards :: Lens' StreamDescription [Shard]+sdShards = lens _sdShards (\s a -> s { _sdShards = a }) . _List++-- | The Amazon Resource Name (ARN) for the stream being described.+sdStreamARN :: Lens' StreamDescription Text+sdStreamARN = lens _sdStreamARN (\s a -> s { _sdStreamARN = a })++-- | The name of the stream being described.+sdStreamName :: Lens' StreamDescription Text+sdStreamName = lens _sdStreamName (\s a -> s { _sdStreamName = a })++-- | The current status of the stream being described. The stream status is+-- one of the following states: CREATING - The stream is being created.+-- Amazon Kinesis immediately returns and sets StreamStatus to CREATING.+-- DELETING - The stream is being deleted. The specified stream is in the+-- DELETING state until Amazon Kinesis completes the deletion. ACTIVE - The+-- stream exists and is ready for read and write operations or deletion. You+-- should perform read and write operations only on an ACTIVE stream.+-- UPDATING - Shards in the stream are being merged or split. Read and write+-- operations continue to work while the stream is in the UPDATING state.+sdStreamStatus :: Lens' StreamDescription Text+sdStreamStatus = lens _sdStreamStatus (\s a -> s { _sdStreamStatus = a })++instance FromJSON StreamDescription where+ parseJSON = withObject "StreamDescription" $ \o -> StreamDescription+ <$> o .: "HasMoreShards"+ <*> o .: "Shards"+ <*> o .: "StreamARN"+ <*> o .: "StreamName"+ <*> o .: "StreamStatus"++instance ToJSON StreamDescription where+ toJSON StreamDescription{..} = object+ [ "StreamName" .= _sdStreamName+ , "StreamARN" .= _sdStreamARN+ , "StreamStatus" .= _sdStreamStatus+ , "Shards" .= _sdShards+ , "HasMoreShards" .= _sdHasMoreShards+ ]++data StreamStatus+ = Active -- ^ ACTIVE+ | Creating -- ^ CREATING+ | Deleting -- ^ DELETING+ | Updating -- ^ UPDATING+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable StreamStatus++instance FromText StreamStatus where+ parser = match "ACTIVE" Active+ <|> match "CREATING" Creating+ <|> match "DELETING" Deleting+ <|> match "UPDATING" Updating++instance ToText StreamStatus where+ toText = \case+ Active -> "ACTIVE"+ Creating -> "CREATING"+ Deleting -> "DELETING"+ Updating -> "UPDATING"++instance FromJSON StreamStatus where+ parseJSON = parseJSONText "StreamStatus"++instance ToJSON StreamStatus where+ toJSON = toJSONText++data HashKeyRange = HashKeyRange+ { _hkrEndingHashKey :: Text+ , _hkrStartingHashKey :: Text+ } deriving (Eq, Ord, Show)++-- | 'HashKeyRange' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'hkrEndingHashKey' @::@ 'Text'+--+-- * 'hkrStartingHashKey' @::@ 'Text'+--+hashKeyRange :: Text -- ^ 'hkrStartingHashKey'+ -> Text -- ^ 'hkrEndingHashKey'+ -> HashKeyRange+hashKeyRange p1 p2 = HashKeyRange+ { _hkrStartingHashKey = p1+ , _hkrEndingHashKey = p2+ }++-- | The ending hash key of the hash key range.+hkrEndingHashKey :: Lens' HashKeyRange Text+hkrEndingHashKey = lens _hkrEndingHashKey (\s a -> s { _hkrEndingHashKey = a })++-- | The starting hash key of the hash key range.+hkrStartingHashKey :: Lens' HashKeyRange Text+hkrStartingHashKey =+ lens _hkrStartingHashKey (\s a -> s { _hkrStartingHashKey = a })++instance FromJSON HashKeyRange where+ parseJSON = withObject "HashKeyRange" $ \o -> HashKeyRange+ <$> o .: "EndingHashKey"+ <*> o .: "StartingHashKey"++instance ToJSON HashKeyRange where+ toJSON HashKeyRange{..} = object+ [ "StartingHashKey" .= _hkrStartingHashKey+ , "EndingHashKey" .= _hkrEndingHashKey+ ]++data Record = Record+ { _rData :: Base64+ , _rPartitionKey :: Text+ , _rSequenceNumber :: Text+ } deriving (Eq, Show)++-- | 'Record' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'rData' @::@ 'Base64'+--+-- * 'rPartitionKey' @::@ 'Text'+--+-- * 'rSequenceNumber' @::@ 'Text'+--+record :: Text -- ^ 'rSequenceNumber'+ -> Base64 -- ^ 'rData'+ -> Text -- ^ 'rPartitionKey'+ -> Record+record p1 p2 p3 = Record+ { _rSequenceNumber = p1+ , _rData = p2+ , _rPartitionKey = p3+ }++-- | The data blob. The data in the blob is both opaque and immutable to the+-- Amazon Kinesis service, which does not inspect, interpret, or change the+-- data in the blob in any way. The maximum size of the data blob (the+-- payload before Base64-encoding) is 50 kilobytes (KB).+rData :: Lens' Record Base64+rData = lens _rData (\s a -> s { _rData = a })++-- | Identifies which shard in the stream the data record is assigned to.+rPartitionKey :: Lens' Record Text+rPartitionKey = lens _rPartitionKey (\s a -> s { _rPartitionKey = a })++-- | The unique identifier for the record in the Amazon Kinesis stream.+rSequenceNumber :: Lens' Record Text+rSequenceNumber = lens _rSequenceNumber (\s a -> s { _rSequenceNumber = a })++instance FromJSON Record where+ parseJSON = withObject "Record" $ \o -> Record+ <$> o .: "Data"+ <*> o .: "PartitionKey"+ <*> o .: "SequenceNumber"++instance ToJSON Record where+ toJSON Record{..} = object+ [ "SequenceNumber" .= _rSequenceNumber+ , "Data" .= _rData+ , "PartitionKey" .= _rPartitionKey+ ]++data SequenceNumberRange = SequenceNumberRange+ { _snrEndingSequenceNumber :: Maybe Text+ , _snrStartingSequenceNumber :: Text+ } deriving (Eq, Ord, Show)++-- | 'SequenceNumberRange' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'snrEndingSequenceNumber' @::@ 'Maybe' 'Text'+--+-- * 'snrStartingSequenceNumber' @::@ 'Text'+--+sequenceNumberRange :: Text -- ^ 'snrStartingSequenceNumber'+ -> SequenceNumberRange+sequenceNumberRange p1 = SequenceNumberRange+ { _snrStartingSequenceNumber = p1+ , _snrEndingSequenceNumber = Nothing+ }++-- | The ending sequence number for the range. Shards that are in the OPEN+-- state have an ending sequence number of null.+snrEndingSequenceNumber :: Lens' SequenceNumberRange (Maybe Text)+snrEndingSequenceNumber =+ lens _snrEndingSequenceNumber (\s a -> s { _snrEndingSequenceNumber = a })++-- | The starting sequence number for the range.+snrStartingSequenceNumber :: Lens' SequenceNumberRange Text+snrStartingSequenceNumber =+ lens _snrStartingSequenceNumber+ (\s a -> s { _snrStartingSequenceNumber = a })++instance FromJSON SequenceNumberRange where+ parseJSON = withObject "SequenceNumberRange" $ \o -> SequenceNumberRange+ <$> o .:? "EndingSequenceNumber"+ <*> o .: "StartingSequenceNumber"++instance ToJSON SequenceNumberRange where+ toJSON SequenceNumberRange{..} = object+ [ "StartingSequenceNumber" .= _snrStartingSequenceNumber+ , "EndingSequenceNumber" .= _snrEndingSequenceNumber+ ]++data ShardIteratorType+ = AfterSequenceNumber -- ^ AFTER_SEQUENCE_NUMBER+ | AtSequenceNumber -- ^ AT_SEQUENCE_NUMBER+ | Latest -- ^ LATEST+ | TrimHorizon -- ^ TRIM_HORIZON+ deriving (Eq, Ord, Show, Generic, Enum)++instance Hashable ShardIteratorType++instance FromText ShardIteratorType where+ parser = match "AFTER_SEQUENCE_NUMBER" AfterSequenceNumber+ <|> match "AT_SEQUENCE_NUMBER" AtSequenceNumber+ <|> match "LATEST" Latest+ <|> match "TRIM_HORIZON" TrimHorizon++instance ToText ShardIteratorType where+ toText = \case+ AfterSequenceNumber -> "AFTER_SEQUENCE_NUMBER"+ AtSequenceNumber -> "AT_SEQUENCE_NUMBER"+ Latest -> "LATEST"+ TrimHorizon -> "TRIM_HORIZON"++instance FromJSON ShardIteratorType where+ parseJSON = parseJSONText "ShardIteratorType"++instance ToJSON ShardIteratorType where+ toJSON = toJSONText