amazonka-shield (empty) → 1.4.5
raw patch · 41 files changed
+3110/−0 lines, 41 filesdep +amazonka-coredep +amazonka-shielddep +amazonka-testsetup-changed
Dependencies added: amazonka-core, amazonka-shield, amazonka-test, base, bytestring, tasty, tasty-hunit, text, time, unordered-containers
Files
- LICENSE +367/−0
- README.md +45/−0
- Setup.hs +2/−0
- amazonka-shield.cabal +89/−0
- fixture/CreateProtection.yaml +10/−0
- fixture/CreateProtectionResponse.proto +0/−0
- fixture/CreateSubscription.yaml +10/−0
- fixture/CreateSubscriptionResponse.proto +0/−0
- fixture/DeleteProtection.yaml +10/−0
- fixture/DeleteProtectionResponse.proto +0/−0
- fixture/DeleteSubscription.yaml +10/−0
- fixture/DeleteSubscriptionResponse.proto +0/−0
- fixture/DescribeAttack.yaml +10/−0
- fixture/DescribeAttackResponse.proto +0/−0
- fixture/DescribeProtection.yaml +10/−0
- fixture/DescribeProtectionResponse.proto +0/−0
- fixture/DescribeSubscription.yaml +10/−0
- fixture/DescribeSubscriptionResponse.proto +0/−0
- fixture/ListAttacks.yaml +10/−0
- fixture/ListAttacksResponse.proto +0/−0
- fixture/ListProtections.yaml +10/−0
- fixture/ListProtectionsResponse.proto +0/−0
- gen/Network/AWS/Shield.hs +205/−0
- gen/Network/AWS/Shield/CreateProtection.hs +145/−0
- gen/Network/AWS/Shield/CreateSubscription.hs +109/−0
- gen/Network/AWS/Shield/DeleteProtection.hs +123/−0
- gen/Network/AWS/Shield/DeleteSubscription.hs +109/−0
- gen/Network/AWS/Shield/DescribeAttack.hs +132/−0
- gen/Network/AWS/Shield/DescribeProtection.hs +135/−0
- gen/Network/AWS/Shield/DescribeSubscription.hs +119/−0
- gen/Network/AWS/Shield/ListAttacks.hs +183/−0
- gen/Network/AWS/Shield/ListProtections.hs +153/−0
- gen/Network/AWS/Shield/Types.hs +203/−0
- gen/Network/AWS/Shield/Types/Product.hs +583/−0
- gen/Network/AWS/Shield/Types/Sum.hs +46/−0
- gen/Network/AWS/Shield/Waiters.hs +21/−0
- src/.gitkeep +0/−0
- test/Main.hs +21/−0
- test/Test/AWS/Gen/Shield.hs +201/−0
- test/Test/AWS/Shield.hs +20/−0
- test/Test/AWS/Shield/Internal.hs +9/−0
+ LICENSE view
@@ -0,0 +1,367 @@+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.
+ README.md view
@@ -0,0 +1,45 @@+# Amazon Shield SDK++* [Version](#version)+* [Description](#description)+* [Contribute](#contribute)+* [Licence](#licence)+++## Version++`1.4.5`+++## Description++Documentation is available via [Hackage](http://hackage.haskell.org/package/amazonka-shield)+and the [AWS API Reference](https://aws.amazon.com/documentation/).++The types from this library are intended to be used with [amazonka](http://hackage.haskell.org/package/amazonka),+which provides mechanisms for specifying AuthN/AuthZ information, sending requests,+and receiving responses.++Lenses are used for constructing and manipulating types,+due to the depth of nesting of AWS types and transparency regarding+de/serialisation into more palatable Haskell values.+The provided lenses should be compatible with any of the major lens libraries+[lens](http://hackage.haskell.org/package/lens) or [lens-family-core](http://hackage.haskell.org/package/lens-family-core).++See [Network.AWS.Shield](http://hackage.haskell.org/package/amazonka-shield/docs/Network-AWS-Shield.html)+or [the AWS documentation](https://aws.amazon.com/documentation/) to get started.+++## 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-shield` is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/).++Parts of the code are derived from AWS service descriptions, licensed under Apache 2.0.+Source files subject to this contain an additional licensing clause in their header.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ amazonka-shield.cabal view
@@ -0,0 +1,89 @@+name: amazonka-shield+version: 1.4.5+synopsis: Amazon Shield SDK.+homepage: https://github.com/brendanhay/amazonka+bug-reports: https://github.com/brendanhay/amazonka/issues+license: OtherLicense+license-file: LICENSE+author: Brendan Hay+maintainer: Brendan Hay <brendan.g.hay@gmail.com>+copyright: Copyright (c) 2013-2016 Brendan Hay+category: Network, AWS, Cloud, Distributed Computing+build-type: Simple+cabal-version: >= 1.10+extra-source-files: README.md fixture/*.yaml fixture/*.proto src/.gitkeep+description:+ The types from this library are intended to be used with+ <http://hackage.haskell.org/package/amazonka amazonka>, which provides+ mechanisms for specifying AuthN/AuthZ information, sending requests,+ and receiving responses.+ .+ Lenses are used for constructing and manipulating types,+ due to the depth of nesting of AWS types and transparency regarding+ de/serialisation into more palatable Haskell values.+ The provided lenses should be compatible with any of the major lens libraries+ such as <http://hackage.haskell.org/package/lens lens> or+ <http://hackage.haskell.org/package/lens-family-core lens-family-core>.+ .+ See "Network.AWS.Shield" or <https://aws.amazon.com/documentation/ the AWS documentation>+ to get started.++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.Shield+ , Network.AWS.Shield.CreateProtection+ , Network.AWS.Shield.CreateSubscription+ , Network.AWS.Shield.DeleteProtection+ , Network.AWS.Shield.DeleteSubscription+ , Network.AWS.Shield.DescribeAttack+ , Network.AWS.Shield.DescribeProtection+ , Network.AWS.Shield.DescribeSubscription+ , Network.AWS.Shield.ListAttacks+ , Network.AWS.Shield.ListProtections+ , Network.AWS.Shield.Types+ , Network.AWS.Shield.Waiters++ other-modules:+ Network.AWS.Shield.Types.Product+ , Network.AWS.Shield.Types.Sum++ build-depends:+ amazonka-core == 1.4.5.*+ , base >= 4.7 && < 5++test-suite amazonka-shield-test+ type: exitcode-stdio-1.0+ default-language: Haskell2010+ hs-source-dirs: test+ main-is: Main.hs++ ghc-options: -Wall -threaded++ -- This section is encoded by the template and any modules added by+ -- hand outside these namespaces will not correctly be added to the+ -- distribution package.+ other-modules:+ Test.AWS.Shield+ , Test.AWS.Gen.Shield+ , Test.AWS.Shield.Internal++ build-depends:+ amazonka-core == 1.4.5.*+ , amazonka-test == 1.4.5.*+ , amazonka-shield == 1.4.5.*+ , base+ , bytestring+ , tasty+ , tasty-hunit+ , text+ , time+ , unordered-containers
+ fixture/CreateProtection.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/shield/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: shield.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/CreateProtectionResponse.proto view
+ fixture/CreateSubscription.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/shield/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: shield.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/CreateSubscriptionResponse.proto view
+ fixture/DeleteProtection.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/shield/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: shield.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/DeleteProtectionResponse.proto view
+ fixture/DeleteSubscription.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/shield/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: shield.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/DeleteSubscriptionResponse.proto view
+ fixture/DescribeAttack.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/shield/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: shield.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/DescribeAttackResponse.proto view
+ fixture/DescribeProtection.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/shield/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: shield.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/DescribeProtectionResponse.proto view
+ fixture/DescribeSubscription.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/shield/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: shield.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/DescribeSubscriptionResponse.proto view
+ fixture/ListAttacks.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/shield/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: shield.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/ListAttacksResponse.proto view
+ fixture/ListProtections.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/shield/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: shield.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/ListProtectionsResponse.proto view
+ gen/Network/AWS/Shield.hs view
@@ -0,0 +1,205 @@+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.Shield+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- __AWS Shield Advanced__+--+-- This is the /AWS Shield Advanced API Reference/ . This guide is for developers who need detailed information about the AWS Shield Advanced API actions, data types, and errors. For detailed information about AWS WAF and AWS Shield Advanced features and an overview of how to use the AWS WAF and AWS Shield Advanced APIs, see the <http://docs.aws.amazon.com/waf/latest/developerguide/ AWS WAF and AWS Shield Developer Guide> .+--+module Network.AWS.Shield+ (+ -- * Service Configuration+ shield++ -- * Errors+ -- $errors++ -- ** InvalidResourceException+ , _InvalidResourceException++ -- ** InvalidParameterException+ , _InvalidParameterException++ -- ** LimitsExceededException+ , _LimitsExceededException++ -- ** InternalErrorException+ , _InternalErrorException++ -- ** ResourceAlreadyExistsException+ , _ResourceAlreadyExistsException++ -- ** OptimisticLockException+ , _OptimisticLockException++ -- ** InvalidOperationException+ , _InvalidOperationException++ -- ** LockedSubscriptionException+ , _LockedSubscriptionException++ -- ** ResourceNotFoundException+ , _ResourceNotFoundException++ -- * Waiters+ -- $waiters++ -- * Operations+ -- $operations++ -- ** CreateSubscription+ , module Network.AWS.Shield.CreateSubscription++ -- ** ListProtections+ , module Network.AWS.Shield.ListProtections++ -- ** DeleteSubscription+ , module Network.AWS.Shield.DeleteSubscription++ -- ** DescribeAttack+ , module Network.AWS.Shield.DescribeAttack++ -- ** DescribeProtection+ , module Network.AWS.Shield.DescribeProtection++ -- ** ListAttacks+ , module Network.AWS.Shield.ListAttacks++ -- ** CreateProtection+ , module Network.AWS.Shield.CreateProtection++ -- ** DeleteProtection+ , module Network.AWS.Shield.DeleteProtection++ -- ** DescribeSubscription+ , module Network.AWS.Shield.DescribeSubscription++ -- * Types++ -- ** SubResourceType+ , SubResourceType (..)++ -- ** AttackDetail+ , AttackDetail+ , attackDetail+ , adAttackId+ , adStartTime+ , adSubResources+ , adMitigations+ , adAttackCounters+ , adResourceARN+ , adEndTime++ -- ** AttackSummary+ , AttackSummary+ , attackSummary+ , asAttackVectors+ , asAttackId+ , asStartTime+ , asResourceARN+ , asEndTime++ -- ** AttackVectorDescription+ , AttackVectorDescription+ , attackVectorDescription+ , avdVectorType++ -- ** Mitigation+ , Mitigation+ , mitigation+ , mMitigationName++ -- ** Protection+ , Protection+ , protection+ , pResourceARN+ , pName+ , pId++ -- ** SubResourceSummary+ , SubResourceSummary+ , subResourceSummary+ , srsCounters+ , srsAttackVectors+ , srsId+ , srsType++ -- ** Subscription+ , Subscription+ , subscription+ , sTimeCommitmentInSeconds+ , sStartTime++ -- ** SummarizedAttackVector+ , SummarizedAttackVector+ , summarizedAttackVector+ , savVectorCounters+ , savVectorType++ -- ** SummarizedCounter+ , SummarizedCounter+ , summarizedCounter+ , scMax+ , scAverage+ , scN+ , scName+ , scSum+ , scUnit++ -- ** TimeRange+ , TimeRange+ , timeRange+ , trFromInclusive+ , trToExclusive+ ) where++import Network.AWS.Shield.CreateProtection+import Network.AWS.Shield.CreateSubscription+import Network.AWS.Shield.DeleteProtection+import Network.AWS.Shield.DeleteSubscription+import Network.AWS.Shield.DescribeAttack+import Network.AWS.Shield.DescribeProtection+import Network.AWS.Shield.DescribeSubscription+import Network.AWS.Shield.ListAttacks+import Network.AWS.Shield.ListProtections+import Network.AWS.Shield.Types+import Network.AWS.Shield.Waiters++{- $errors+Error matchers are designed for use with the functions provided by+<http://hackage.haskell.org/package/lens/docs/Control-Exception-Lens.html Control.Exception.Lens>.+This allows catching (and rethrowing) service specific errors returned+by 'Shield'.+-}++{- $operations+Some AWS operations return results that are incomplete and require subsequent+requests in order to obtain the entire result set. The process of sending+subsequent requests to continue where a previous request left off is called+pagination. For example, the 'ListObjects' operation of Amazon S3 returns up to+1000 objects at a time, and you must send subsequent requests with the+appropriate Marker in order to retrieve the next page of results.++Operations that have an 'AWSPager' instance can transparently perform subsequent+requests, correctly setting Markers and other request facets to iterate through+the entire result set of a truncated API operation. Operations which support+this have an additional note in the documentation.++Many operations have the ability to filter results on the server side. See the+individual operation parameters for details.+-}++{- $waiters+Waiters poll by repeatedly sending a request until some remote success condition+configured by the 'Wait' specification is fulfilled. The 'Wait' specification+determines how many attempts should be made, in addition to delay and retry strategies.+-}
+ gen/Network/AWS/Shield/CreateProtection.hs view
@@ -0,0 +1,145 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.Shield.CreateProtection+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Enables AWS Shield Advanced for a specific AWS resource. The resource can be an Amazon CloudFront distribution, Elastic Load Balancing load balancer, or an Amazon Route 53 hosted zone.+--+--+module Network.AWS.Shield.CreateProtection+ (+ -- * Creating a Request+ createProtection+ , CreateProtection+ -- * Request Lenses+ , cpName+ , cpResourceARN++ -- * Destructuring the Response+ , createProtectionResponse+ , CreateProtectionResponse+ -- * Response Lenses+ , cprsProtectionId+ , cprsResponseStatus+ ) where++import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.Shield.Types+import Network.AWS.Shield.Types.Product++-- | /See:/ 'createProtection' smart constructor.+data CreateProtection = CreateProtection'+ { _cpName :: !Text+ , _cpResourceARN :: !Text+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'CreateProtection' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'cpName' - Friendly name for the @Protection@ you are creating.+--+-- * 'cpResourceARN' - The ARN (Amazon Resource Name) of the resource to be protected.+createProtection+ :: Text -- ^ 'cpName'+ -> Text -- ^ 'cpResourceARN'+ -> CreateProtection+createProtection pName_ pResourceARN_ =+ CreateProtection'+ { _cpName = pName_+ , _cpResourceARN = pResourceARN_+ }++-- | Friendly name for the @Protection@ you are creating.+cpName :: Lens' CreateProtection Text+cpName = lens _cpName (\ s a -> s{_cpName = a});++-- | The ARN (Amazon Resource Name) of the resource to be protected.+cpResourceARN :: Lens' CreateProtection Text+cpResourceARN = lens _cpResourceARN (\ s a -> s{_cpResourceARN = a});++instance AWSRequest CreateProtection where+ type Rs CreateProtection = CreateProtectionResponse+ request = postJSON shield+ response+ = receiveJSON+ (\ s h x ->+ CreateProtectionResponse' <$>+ (x .?> "ProtectionId") <*> (pure (fromEnum s)))++instance Hashable CreateProtection++instance NFData CreateProtection++instance ToHeaders CreateProtection where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSShield_20160616.CreateProtection" ::+ ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON CreateProtection where+ toJSON CreateProtection'{..}+ = object+ (catMaybes+ [Just ("Name" .= _cpName),+ Just ("ResourceArn" .= _cpResourceARN)])++instance ToPath CreateProtection where+ toPath = const "/"++instance ToQuery CreateProtection where+ toQuery = const mempty++-- | /See:/ 'createProtectionResponse' smart constructor.+data CreateProtectionResponse = CreateProtectionResponse'+ { _cprsProtectionId :: !(Maybe Text)+ , _cprsResponseStatus :: !Int+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'CreateProtectionResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'cprsProtectionId' - The unique identifier (ID) for the 'Protection' object that is created.+--+-- * 'cprsResponseStatus' - -- | The response status code.+createProtectionResponse+ :: Int -- ^ 'cprsResponseStatus'+ -> CreateProtectionResponse+createProtectionResponse pResponseStatus_ =+ CreateProtectionResponse'+ { _cprsProtectionId = Nothing+ , _cprsResponseStatus = pResponseStatus_+ }++-- | The unique identifier (ID) for the 'Protection' object that is created.+cprsProtectionId :: Lens' CreateProtectionResponse (Maybe Text)+cprsProtectionId = lens _cprsProtectionId (\ s a -> s{_cprsProtectionId = a});++-- | -- | The response status code.+cprsResponseStatus :: Lens' CreateProtectionResponse Int+cprsResponseStatus = lens _cprsResponseStatus (\ s a -> s{_cprsResponseStatus = a});++instance NFData CreateProtectionResponse
+ gen/Network/AWS/Shield/CreateSubscription.hs view
@@ -0,0 +1,109 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.Shield.CreateSubscription+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Activates AWS Shield Advanced for an account.+--+--+module Network.AWS.Shield.CreateSubscription+ (+ -- * Creating a Request+ createSubscription+ , CreateSubscription++ -- * Destructuring the Response+ , createSubscriptionResponse+ , CreateSubscriptionResponse+ -- * Response Lenses+ , csrsResponseStatus+ ) where++import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.Shield.Types+import Network.AWS.Shield.Types.Product++-- | /See:/ 'createSubscription' smart constructor.+data CreateSubscription =+ CreateSubscription'+ deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'CreateSubscription' with the minimum fields required to make a request.+--+createSubscription+ :: CreateSubscription+createSubscription = CreateSubscription'++instance AWSRequest CreateSubscription where+ type Rs CreateSubscription =+ CreateSubscriptionResponse+ request = postJSON shield+ response+ = receiveEmpty+ (\ s h x ->+ CreateSubscriptionResponse' <$> (pure (fromEnum s)))++instance Hashable CreateSubscription++instance NFData CreateSubscription++instance ToHeaders CreateSubscription where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSShield_20160616.CreateSubscription" ::+ ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON CreateSubscription where+ toJSON = const (Object mempty)++instance ToPath CreateSubscription where+ toPath = const "/"++instance ToQuery CreateSubscription where+ toQuery = const mempty++-- | /See:/ 'createSubscriptionResponse' smart constructor.+newtype CreateSubscriptionResponse = CreateSubscriptionResponse'+ { _csrsResponseStatus :: Int+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'CreateSubscriptionResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'csrsResponseStatus' - -- | The response status code.+createSubscriptionResponse+ :: Int -- ^ 'csrsResponseStatus'+ -> CreateSubscriptionResponse+createSubscriptionResponse pResponseStatus_ =+ CreateSubscriptionResponse'+ { _csrsResponseStatus = pResponseStatus_+ }++-- | -- | The response status code.+csrsResponseStatus :: Lens' CreateSubscriptionResponse Int+csrsResponseStatus = lens _csrsResponseStatus (\ s a -> s{_csrsResponseStatus = a});++instance NFData CreateSubscriptionResponse
+ gen/Network/AWS/Shield/DeleteProtection.hs view
@@ -0,0 +1,123 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.Shield.DeleteProtection+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Deletes an AWS Shield Advanced 'Protection' .+--+--+module Network.AWS.Shield.DeleteProtection+ (+ -- * Creating a Request+ deleteProtection+ , DeleteProtection+ -- * Request Lenses+ , dProtectionId++ -- * Destructuring the Response+ , deleteProtectionResponse+ , DeleteProtectionResponse+ -- * Response Lenses+ , delrsResponseStatus+ ) where++import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.Shield.Types+import Network.AWS.Shield.Types.Product++-- | /See:/ 'deleteProtection' smart constructor.+newtype DeleteProtection = DeleteProtection'+ { _dProtectionId :: Text+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'DeleteProtection' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'dProtectionId' - The unique identifier (ID) for the 'Protection' object to be deleted.+deleteProtection+ :: Text -- ^ 'dProtectionId'+ -> DeleteProtection+deleteProtection pProtectionId_ =+ DeleteProtection'+ { _dProtectionId = pProtectionId_+ }++-- | The unique identifier (ID) for the 'Protection' object to be deleted.+dProtectionId :: Lens' DeleteProtection Text+dProtectionId = lens _dProtectionId (\ s a -> s{_dProtectionId = a});++instance AWSRequest DeleteProtection where+ type Rs DeleteProtection = DeleteProtectionResponse+ request = postJSON shield+ response+ = receiveEmpty+ (\ s h x ->+ DeleteProtectionResponse' <$> (pure (fromEnum s)))++instance Hashable DeleteProtection++instance NFData DeleteProtection++instance ToHeaders DeleteProtection where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSShield_20160616.DeleteProtection" ::+ ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON DeleteProtection where+ toJSON DeleteProtection'{..}+ = object+ (catMaybes [Just ("ProtectionId" .= _dProtectionId)])++instance ToPath DeleteProtection where+ toPath = const "/"++instance ToQuery DeleteProtection where+ toQuery = const mempty++-- | /See:/ 'deleteProtectionResponse' smart constructor.+newtype DeleteProtectionResponse = DeleteProtectionResponse'+ { _delrsResponseStatus :: Int+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'DeleteProtectionResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'delrsResponseStatus' - -- | The response status code.+deleteProtectionResponse+ :: Int -- ^ 'delrsResponseStatus'+ -> DeleteProtectionResponse+deleteProtectionResponse pResponseStatus_ =+ DeleteProtectionResponse'+ { _delrsResponseStatus = pResponseStatus_+ }++-- | -- | The response status code.+delrsResponseStatus :: Lens' DeleteProtectionResponse Int+delrsResponseStatus = lens _delrsResponseStatus (\ s a -> s{_delrsResponseStatus = a});++instance NFData DeleteProtectionResponse
+ gen/Network/AWS/Shield/DeleteSubscription.hs view
@@ -0,0 +1,109 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.Shield.DeleteSubscription+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Removes AWS Shield Advanced from an account.+--+--+module Network.AWS.Shield.DeleteSubscription+ (+ -- * Creating a Request+ deleteSubscription+ , DeleteSubscription++ -- * Destructuring the Response+ , deleteSubscriptionResponse+ , DeleteSubscriptionResponse+ -- * Response Lenses+ , drsResponseStatus+ ) where++import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.Shield.Types+import Network.AWS.Shield.Types.Product++-- | /See:/ 'deleteSubscription' smart constructor.+data DeleteSubscription =+ DeleteSubscription'+ deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'DeleteSubscription' with the minimum fields required to make a request.+--+deleteSubscription+ :: DeleteSubscription+deleteSubscription = DeleteSubscription'++instance AWSRequest DeleteSubscription where+ type Rs DeleteSubscription =+ DeleteSubscriptionResponse+ request = postJSON shield+ response+ = receiveEmpty+ (\ s h x ->+ DeleteSubscriptionResponse' <$> (pure (fromEnum s)))++instance Hashable DeleteSubscription++instance NFData DeleteSubscription++instance ToHeaders DeleteSubscription where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSShield_20160616.DeleteSubscription" ::+ ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON DeleteSubscription where+ toJSON = const (Object mempty)++instance ToPath DeleteSubscription where+ toPath = const "/"++instance ToQuery DeleteSubscription where+ toQuery = const mempty++-- | /See:/ 'deleteSubscriptionResponse' smart constructor.+newtype DeleteSubscriptionResponse = DeleteSubscriptionResponse'+ { _drsResponseStatus :: Int+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'DeleteSubscriptionResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'drsResponseStatus' - -- | The response status code.+deleteSubscriptionResponse+ :: Int -- ^ 'drsResponseStatus'+ -> DeleteSubscriptionResponse+deleteSubscriptionResponse pResponseStatus_ =+ DeleteSubscriptionResponse'+ { _drsResponseStatus = pResponseStatus_+ }++-- | -- | The response status code.+drsResponseStatus :: Lens' DeleteSubscriptionResponse Int+drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a});++instance NFData DeleteSubscriptionResponse
+ gen/Network/AWS/Shield/DescribeAttack.hs view
@@ -0,0 +1,132 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.Shield.DescribeAttack+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Describes the details of a DDoS attack.+--+--+module Network.AWS.Shield.DescribeAttack+ (+ -- * Creating a Request+ describeAttack+ , DescribeAttack+ -- * Request Lenses+ , daAttackId++ -- * Destructuring the Response+ , describeAttackResponse+ , DescribeAttackResponse+ -- * Response Lenses+ , darsAttack+ , darsResponseStatus+ ) where++import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.Shield.Types+import Network.AWS.Shield.Types.Product++-- | /See:/ 'describeAttack' smart constructor.+newtype DescribeAttack = DescribeAttack'+ { _daAttackId :: Text+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'DescribeAttack' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'daAttackId' - The unique identifier (ID) for the attack that to be described.+describeAttack+ :: Text -- ^ 'daAttackId'+ -> DescribeAttack+describeAttack pAttackId_ =+ DescribeAttack'+ { _daAttackId = pAttackId_+ }++-- | The unique identifier (ID) for the attack that to be described.+daAttackId :: Lens' DescribeAttack Text+daAttackId = lens _daAttackId (\ s a -> s{_daAttackId = a});++instance AWSRequest DescribeAttack where+ type Rs DescribeAttack = DescribeAttackResponse+ request = postJSON shield+ response+ = receiveJSON+ (\ s h x ->+ DescribeAttackResponse' <$>+ (x .?> "Attack") <*> (pure (fromEnum s)))++instance Hashable DescribeAttack++instance NFData DescribeAttack++instance ToHeaders DescribeAttack where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSShield_20160616.DescribeAttack" :: ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON DescribeAttack where+ toJSON DescribeAttack'{..}+ = object+ (catMaybes [Just ("AttackId" .= _daAttackId)])++instance ToPath DescribeAttack where+ toPath = const "/"++instance ToQuery DescribeAttack where+ toQuery = const mempty++-- | /See:/ 'describeAttackResponse' smart constructor.+data DescribeAttackResponse = DescribeAttackResponse'+ { _darsAttack :: !(Maybe AttackDetail)+ , _darsResponseStatus :: !Int+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'DescribeAttackResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'darsAttack' - The attack that is described.+--+-- * 'darsResponseStatus' - -- | The response status code.+describeAttackResponse+ :: Int -- ^ 'darsResponseStatus'+ -> DescribeAttackResponse+describeAttackResponse pResponseStatus_ =+ DescribeAttackResponse'+ { _darsAttack = Nothing+ , _darsResponseStatus = pResponseStatus_+ }++-- | The attack that is described.+darsAttack :: Lens' DescribeAttackResponse (Maybe AttackDetail)+darsAttack = lens _darsAttack (\ s a -> s{_darsAttack = a});++-- | -- | The response status code.+darsResponseStatus :: Lens' DescribeAttackResponse Int+darsResponseStatus = lens _darsResponseStatus (\ s a -> s{_darsResponseStatus = a});++instance NFData DescribeAttackResponse
+ gen/Network/AWS/Shield/DescribeProtection.hs view
@@ -0,0 +1,135 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.Shield.DescribeProtection+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Lists the details of a 'Protection' object.+--+--+module Network.AWS.Shield.DescribeProtection+ (+ -- * Creating a Request+ describeProtection+ , DescribeProtection+ -- * Request Lenses+ , dpProtectionId++ -- * Destructuring the Response+ , describeProtectionResponse+ , DescribeProtectionResponse+ -- * Response Lenses+ , dprsProtection+ , dprsResponseStatus+ ) where++import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.Shield.Types+import Network.AWS.Shield.Types.Product++-- | /See:/ 'describeProtection' smart constructor.+newtype DescribeProtection = DescribeProtection'+ { _dpProtectionId :: Text+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'DescribeProtection' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'dpProtectionId' - The unique identifier (ID) for the 'Protection' object that is described.+describeProtection+ :: Text -- ^ 'dpProtectionId'+ -> DescribeProtection+describeProtection pProtectionId_ =+ DescribeProtection'+ { _dpProtectionId = pProtectionId_+ }++-- | The unique identifier (ID) for the 'Protection' object that is described.+dpProtectionId :: Lens' DescribeProtection Text+dpProtectionId = lens _dpProtectionId (\ s a -> s{_dpProtectionId = a});++instance AWSRequest DescribeProtection where+ type Rs DescribeProtection =+ DescribeProtectionResponse+ request = postJSON shield+ response+ = receiveJSON+ (\ s h x ->+ DescribeProtectionResponse' <$>+ (x .?> "Protection") <*> (pure (fromEnum s)))++instance Hashable DescribeProtection++instance NFData DescribeProtection++instance ToHeaders DescribeProtection where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSShield_20160616.DescribeProtection" ::+ ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON DescribeProtection where+ toJSON DescribeProtection'{..}+ = object+ (catMaybes+ [Just ("ProtectionId" .= _dpProtectionId)])++instance ToPath DescribeProtection where+ toPath = const "/"++instance ToQuery DescribeProtection where+ toQuery = const mempty++-- | /See:/ 'describeProtectionResponse' smart constructor.+data DescribeProtectionResponse = DescribeProtectionResponse'+ { _dprsProtection :: !(Maybe Protection)+ , _dprsResponseStatus :: !Int+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'DescribeProtectionResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'dprsProtection' - The 'Protection' object that is described.+--+-- * 'dprsResponseStatus' - -- | The response status code.+describeProtectionResponse+ :: Int -- ^ 'dprsResponseStatus'+ -> DescribeProtectionResponse+describeProtectionResponse pResponseStatus_ =+ DescribeProtectionResponse'+ { _dprsProtection = Nothing+ , _dprsResponseStatus = pResponseStatus_+ }++-- | The 'Protection' object that is described.+dprsProtection :: Lens' DescribeProtectionResponse (Maybe Protection)+dprsProtection = lens _dprsProtection (\ s a -> s{_dprsProtection = a});++-- | -- | The response status code.+dprsResponseStatus :: Lens' DescribeProtectionResponse Int+dprsResponseStatus = lens _dprsResponseStatus (\ s a -> s{_dprsResponseStatus = a});++instance NFData DescribeProtectionResponse
+ gen/Network/AWS/Shield/DescribeSubscription.hs view
@@ -0,0 +1,119 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.Shield.DescribeSubscription+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Provides details about the AWS Shield Advanced subscription for an account.+--+--+module Network.AWS.Shield.DescribeSubscription+ (+ -- * Creating a Request+ describeSubscription+ , DescribeSubscription++ -- * Destructuring the Response+ , describeSubscriptionResponse+ , DescribeSubscriptionResponse+ -- * Response Lenses+ , dsrsSubscription+ , dsrsResponseStatus+ ) where++import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.Shield.Types+import Network.AWS.Shield.Types.Product++-- | /See:/ 'describeSubscription' smart constructor.+data DescribeSubscription =+ DescribeSubscription'+ deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'DescribeSubscription' with the minimum fields required to make a request.+--+describeSubscription+ :: DescribeSubscription+describeSubscription = DescribeSubscription'++instance AWSRequest DescribeSubscription where+ type Rs DescribeSubscription =+ DescribeSubscriptionResponse+ request = postJSON shield+ response+ = receiveJSON+ (\ s h x ->+ DescribeSubscriptionResponse' <$>+ (x .?> "Subscription") <*> (pure (fromEnum s)))++instance Hashable DescribeSubscription++instance NFData DescribeSubscription++instance ToHeaders DescribeSubscription where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSShield_20160616.DescribeSubscription" ::+ ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON DescribeSubscription where+ toJSON = const (Object mempty)++instance ToPath DescribeSubscription where+ toPath = const "/"++instance ToQuery DescribeSubscription where+ toQuery = const mempty++-- | /See:/ 'describeSubscriptionResponse' smart constructor.+data DescribeSubscriptionResponse = DescribeSubscriptionResponse'+ { _dsrsSubscription :: !(Maybe Subscription)+ , _dsrsResponseStatus :: !Int+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'DescribeSubscriptionResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'dsrsSubscription' - The AWS Shield Advanced subscription details for an account.+--+-- * 'dsrsResponseStatus' - -- | The response status code.+describeSubscriptionResponse+ :: Int -- ^ 'dsrsResponseStatus'+ -> DescribeSubscriptionResponse+describeSubscriptionResponse pResponseStatus_ =+ DescribeSubscriptionResponse'+ { _dsrsSubscription = Nothing+ , _dsrsResponseStatus = pResponseStatus_+ }++-- | The AWS Shield Advanced subscription details for an account.+dsrsSubscription :: Lens' DescribeSubscriptionResponse (Maybe Subscription)+dsrsSubscription = lens _dsrsSubscription (\ s a -> s{_dsrsSubscription = a});++-- | -- | The response status code.+dsrsResponseStatus :: Lens' DescribeSubscriptionResponse Int+dsrsResponseStatus = lens _dsrsResponseStatus (\ s a -> s{_dsrsResponseStatus = a});++instance NFData DescribeSubscriptionResponse
+ gen/Network/AWS/Shield/ListAttacks.hs view
@@ -0,0 +1,183 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.Shield.ListAttacks+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Returns all ongoing DDoS attacks or all DDoS attacks during a specified time period.+--+--+module Network.AWS.Shield.ListAttacks+ (+ -- * Creating a Request+ listAttacks+ , ListAttacks+ -- * Request Lenses+ , laStartTime+ , laResourceARNs+ , laNextToken+ , laEndTime+ , laMaxResults++ -- * Destructuring the Response+ , listAttacksResponse+ , ListAttacksResponse+ -- * Response Lenses+ , larsAttackSummaries+ , larsNextToken+ , larsResponseStatus+ ) where++import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.Shield.Types+import Network.AWS.Shield.Types.Product++-- | /See:/ 'listAttacks' smart constructor.+data ListAttacks = ListAttacks'+ { _laStartTime :: !(Maybe TimeRange)+ , _laResourceARNs :: !(Maybe [Text])+ , _laNextToken :: !(Maybe Text)+ , _laEndTime :: !(Maybe TimeRange)+ , _laMaxResults :: !(Maybe Nat)+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'ListAttacks' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'laStartTime' - The time period for the attacks.+--+-- * 'laResourceARNs' - The ARN (Amazon Resource Name) of the resource that was attacked. If this is left blank, all applicable resources for this account will be included.+--+-- * 'laNextToken' - The @ListAttacksRequest.NextMarker@ value from a previous call to @ListAttacksRequest@ . Pass null if this is the first call.+--+-- * 'laEndTime' - The end of the time period for the attacks.+--+-- * 'laMaxResults' - The maximum number of 'AttackSummary' objects to be returned. If this is left blank, the first 20 results will be returned.+listAttacks+ :: ListAttacks+listAttacks =+ ListAttacks'+ { _laStartTime = Nothing+ , _laResourceARNs = Nothing+ , _laNextToken = Nothing+ , _laEndTime = Nothing+ , _laMaxResults = Nothing+ }++-- | The time period for the attacks.+laStartTime :: Lens' ListAttacks (Maybe TimeRange)+laStartTime = lens _laStartTime (\ s a -> s{_laStartTime = a});++-- | The ARN (Amazon Resource Name) of the resource that was attacked. If this is left blank, all applicable resources for this account will be included.+laResourceARNs :: Lens' ListAttacks [Text]+laResourceARNs = lens _laResourceARNs (\ s a -> s{_laResourceARNs = a}) . _Default . _Coerce;++-- | The @ListAttacksRequest.NextMarker@ value from a previous call to @ListAttacksRequest@ . Pass null if this is the first call.+laNextToken :: Lens' ListAttacks (Maybe Text)+laNextToken = lens _laNextToken (\ s a -> s{_laNextToken = a});++-- | The end of the time period for the attacks.+laEndTime :: Lens' ListAttacks (Maybe TimeRange)+laEndTime = lens _laEndTime (\ s a -> s{_laEndTime = a});++-- | The maximum number of 'AttackSummary' objects to be returned. If this is left blank, the first 20 results will be returned.+laMaxResults :: Lens' ListAttacks (Maybe Natural)+laMaxResults = lens _laMaxResults (\ s a -> s{_laMaxResults = a}) . mapping _Nat;++instance AWSRequest ListAttacks where+ type Rs ListAttacks = ListAttacksResponse+ request = postJSON shield+ response+ = receiveJSON+ (\ s h x ->+ ListAttacksResponse' <$>+ (x .?> "AttackSummaries" .!@ mempty) <*>+ (x .?> "NextToken")+ <*> (pure (fromEnum s)))++instance Hashable ListAttacks++instance NFData ListAttacks++instance ToHeaders ListAttacks where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSShield_20160616.ListAttacks" :: ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON ListAttacks where+ toJSON ListAttacks'{..}+ = object+ (catMaybes+ [("StartTime" .=) <$> _laStartTime,+ ("ResourceArns" .=) <$> _laResourceARNs,+ ("NextToken" .=) <$> _laNextToken,+ ("EndTime" .=) <$> _laEndTime,+ ("MaxResults" .=) <$> _laMaxResults])++instance ToPath ListAttacks where+ toPath = const "/"++instance ToQuery ListAttacks where+ toQuery = const mempty++-- | /See:/ 'listAttacksResponse' smart constructor.+data ListAttacksResponse = ListAttacksResponse'+ { _larsAttackSummaries :: !(Maybe [AttackSummary])+ , _larsNextToken :: !(Maybe Text)+ , _larsResponseStatus :: !Int+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'ListAttacksResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'larsAttackSummaries' - The attack information for the specified time range.+--+-- * 'larsNextToken' - The token returned by a previous call to indicate that there is more data available. If not null, more results are available. Pass this value for the @NextMarker@ parameter in a subsequent call to @ListAttacks@ to retrieve the next set of items.+--+-- * 'larsResponseStatus' - -- | The response status code.+listAttacksResponse+ :: Int -- ^ 'larsResponseStatus'+ -> ListAttacksResponse+listAttacksResponse pResponseStatus_ =+ ListAttacksResponse'+ { _larsAttackSummaries = Nothing+ , _larsNextToken = Nothing+ , _larsResponseStatus = pResponseStatus_+ }++-- | The attack information for the specified time range.+larsAttackSummaries :: Lens' ListAttacksResponse [AttackSummary]+larsAttackSummaries = lens _larsAttackSummaries (\ s a -> s{_larsAttackSummaries = a}) . _Default . _Coerce;++-- | The token returned by a previous call to indicate that there is more data available. If not null, more results are available. Pass this value for the @NextMarker@ parameter in a subsequent call to @ListAttacks@ to retrieve the next set of items.+larsNextToken :: Lens' ListAttacksResponse (Maybe Text)+larsNextToken = lens _larsNextToken (\ s a -> s{_larsNextToken = a});++-- | -- | The response status code.+larsResponseStatus :: Lens' ListAttacksResponse Int+larsResponseStatus = lens _larsResponseStatus (\ s a -> s{_larsResponseStatus = a});++instance NFData ListAttacksResponse
+ gen/Network/AWS/Shield/ListProtections.hs view
@@ -0,0 +1,153 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.Shield.ListProtections+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Lists all 'Protection' objects for the account.+--+--+module Network.AWS.Shield.ListProtections+ (+ -- * Creating a Request+ listProtections+ , ListProtections+ -- * Request Lenses+ , lpNextToken+ , lpMaxResults++ -- * Destructuring the Response+ , listProtectionsResponse+ , ListProtectionsResponse+ -- * Response Lenses+ , lprsProtections+ , lprsNextToken+ , lprsResponseStatus+ ) where++import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response+import Network.AWS.Shield.Types+import Network.AWS.Shield.Types.Product++-- | /See:/ 'listProtections' smart constructor.+data ListProtections = ListProtections'+ { _lpNextToken :: !(Maybe Text)+ , _lpMaxResults :: !(Maybe Nat)+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'ListProtections' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'lpNextToken' - The @ListProtectionsRequest.NextToken@ value from a previous call to @ListProtections@ . Pass null if this is the first call.+--+-- * 'lpMaxResults' - The maximum number of 'Protection' objects to be returned. If this is left blank the first 20 results will be returned.+listProtections+ :: ListProtections+listProtections =+ ListProtections'+ { _lpNextToken = Nothing+ , _lpMaxResults = Nothing+ }++-- | The @ListProtectionsRequest.NextToken@ value from a previous call to @ListProtections@ . Pass null if this is the first call.+lpNextToken :: Lens' ListProtections (Maybe Text)+lpNextToken = lens _lpNextToken (\ s a -> s{_lpNextToken = a});++-- | The maximum number of 'Protection' objects to be returned. If this is left blank the first 20 results will be returned.+lpMaxResults :: Lens' ListProtections (Maybe Natural)+lpMaxResults = lens _lpMaxResults (\ s a -> s{_lpMaxResults = a}) . mapping _Nat;++instance AWSRequest ListProtections where+ type Rs ListProtections = ListProtectionsResponse+ request = postJSON shield+ response+ = receiveJSON+ (\ s h x ->+ ListProtectionsResponse' <$>+ (x .?> "Protections" .!@ mempty) <*>+ (x .?> "NextToken")+ <*> (pure (fromEnum s)))++instance Hashable ListProtections++instance NFData ListProtections++instance ToHeaders ListProtections where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSShield_20160616.ListProtections" :: ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON ListProtections where+ toJSON ListProtections'{..}+ = object+ (catMaybes+ [("NextToken" .=) <$> _lpNextToken,+ ("MaxResults" .=) <$> _lpMaxResults])++instance ToPath ListProtections where+ toPath = const "/"++instance ToQuery ListProtections where+ toQuery = const mempty++-- | /See:/ 'listProtectionsResponse' smart constructor.+data ListProtectionsResponse = ListProtectionsResponse'+ { _lprsProtections :: !(Maybe [Protection])+ , _lprsNextToken :: !(Maybe Text)+ , _lprsResponseStatus :: !Int+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'ListProtectionsResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'lprsProtections' - The array of enabled 'Protection' objects.+--+-- * 'lprsNextToken' - If you specify a value for @MaxResults@ and you have more Protections than the value of MaxResults, AWS Shield Advanced returns a NextToken value in the response that allows you to list another group of Protections. For the second and subsequent ListProtections requests, specify the value of NextToken from the previous response to get information about another batch of Protections.+--+-- * 'lprsResponseStatus' - -- | The response status code.+listProtectionsResponse+ :: Int -- ^ 'lprsResponseStatus'+ -> ListProtectionsResponse+listProtectionsResponse pResponseStatus_ =+ ListProtectionsResponse'+ { _lprsProtections = Nothing+ , _lprsNextToken = Nothing+ , _lprsResponseStatus = pResponseStatus_+ }++-- | The array of enabled 'Protection' objects.+lprsProtections :: Lens' ListProtectionsResponse [Protection]+lprsProtections = lens _lprsProtections (\ s a -> s{_lprsProtections = a}) . _Default . _Coerce;++-- | If you specify a value for @MaxResults@ and you have more Protections than the value of MaxResults, AWS Shield Advanced returns a NextToken value in the response that allows you to list another group of Protections. For the second and subsequent ListProtections requests, specify the value of NextToken from the previous response to get information about another batch of Protections.+lprsNextToken :: Lens' ListProtectionsResponse (Maybe Text)+lprsNextToken = lens _lprsNextToken (\ s a -> s{_lprsNextToken = a});++-- | -- | The response status code.+lprsResponseStatus :: Lens' ListProtectionsResponse Int+lprsResponseStatus = lens _lprsResponseStatus (\ s a -> s{_lprsResponseStatus = a});++instance NFData ListProtectionsResponse
+ gen/Network/AWS/Shield/Types.hs view
@@ -0,0 +1,203 @@+{-# LANGUAGE OverloadedStrings #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.Shield.Types+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Network.AWS.Shield.Types+ (+ -- * Service Configuration+ shield++ -- * Errors+ , _InvalidResourceException+ , _InvalidParameterException+ , _LimitsExceededException+ , _InternalErrorException+ , _ResourceAlreadyExistsException+ , _OptimisticLockException+ , _InvalidOperationException+ , _LockedSubscriptionException+ , _ResourceNotFoundException++ -- * SubResourceType+ , SubResourceType (..)++ -- * AttackDetail+ , AttackDetail+ , attackDetail+ , adAttackId+ , adStartTime+ , adSubResources+ , adMitigations+ , adAttackCounters+ , adResourceARN+ , adEndTime++ -- * AttackSummary+ , AttackSummary+ , attackSummary+ , asAttackVectors+ , asAttackId+ , asStartTime+ , asResourceARN+ , asEndTime++ -- * AttackVectorDescription+ , AttackVectorDescription+ , attackVectorDescription+ , avdVectorType++ -- * Mitigation+ , Mitigation+ , mitigation+ , mMitigationName++ -- * Protection+ , Protection+ , protection+ , pResourceARN+ , pName+ , pId++ -- * SubResourceSummary+ , SubResourceSummary+ , subResourceSummary+ , srsCounters+ , srsAttackVectors+ , srsId+ , srsType++ -- * Subscription+ , Subscription+ , subscription+ , sTimeCommitmentInSeconds+ , sStartTime++ -- * SummarizedAttackVector+ , SummarizedAttackVector+ , summarizedAttackVector+ , savVectorCounters+ , savVectorType++ -- * SummarizedCounter+ , SummarizedCounter+ , summarizedCounter+ , scMax+ , scAverage+ , scN+ , scName+ , scSum+ , scUnit++ -- * TimeRange+ , TimeRange+ , timeRange+ , trFromInclusive+ , trToExclusive+ ) where++import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Shield.Types.Product+import Network.AWS.Shield.Types.Sum+import Network.AWS.Sign.V4++-- | API version @2016-06-02@ of the Amazon Shield SDK configuration.+shield :: Service+shield =+ Service+ { _svcAbbrev = "Shield"+ , _svcSigner = v4+ , _svcPrefix = "shield"+ , _svcVersion = "2016-06-02"+ , _svcEndpoint = defaultEndpoint shield+ , _svcTimeout = Just 70+ , _svcCheck = statusSuccess+ , _svcError = parseJSONError "Shield"+ , _svcRetry = retry+ }+ where+ retry =+ Exponential+ { _retryBase = 5.0e-2+ , _retryGrowth = 2+ , _retryAttempts = 5+ , _retryCheck = check+ }+ check e+ | has (hasStatus 429) e = Just "too_many_requests"+ | has (hasCode "ThrottlingException" . hasStatus 400) e =+ Just "throttling_exception"+ | has (hasCode "Throttling" . hasStatus 400) e = Just "throttling"+ | has (hasStatus 504) e = Just "gateway_timeout"+ | has (hasStatus 502) e = Just "bad_gateway"+ | has (hasStatus 503) e = Just "service_unavailable"+ | has (hasStatus 500) e = Just "general_server_error"+ | has (hasStatus 509) e = Just "limit_exceeded"+ | otherwise = Nothing++-- | Exception that indicates that the resource is invalid. You might not have access to the resource, or the resource might not exist.+--+--+_InvalidResourceException :: AsError a => Getting (First ServiceError) a ServiceError+_InvalidResourceException = _ServiceError . hasCode "InvalidResourceException"++-- | Exception that indicates that the parameters passed to the API are invalid.+--+--+_InvalidParameterException :: AsError a => Getting (First ServiceError) a ServiceError+_InvalidParameterException =+ _ServiceError . hasCode "InvalidParameterException"++-- | Exception that indicates that the operation would exceed a limit.+--+--+_LimitsExceededException :: AsError a => Getting (First ServiceError) a ServiceError+_LimitsExceededException = _ServiceError . hasCode "LimitsExceededException"++-- | Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.+--+--+_InternalErrorException :: AsError a => Getting (First ServiceError) a ServiceError+_InternalErrorException = _ServiceError . hasCode "InternalErrorException"++-- | Exception indicating the specified resource already exists.+--+--+_ResourceAlreadyExistsException :: AsError a => Getting (First ServiceError) a ServiceError+_ResourceAlreadyExistsException =+ _ServiceError . hasCode "ResourceAlreadyExistsException"++-- | Exception that indicates that the protection state has been modified by another client. You can retry the request.+--+--+_OptimisticLockException :: AsError a => Getting (First ServiceError) a ServiceError+_OptimisticLockException = _ServiceError . hasCode "OptimisticLockException"++-- | Exception that indicates that the operation would not cause any change to occur.+--+--+_InvalidOperationException :: AsError a => Getting (First ServiceError) a ServiceError+_InvalidOperationException =+ _ServiceError . hasCode "InvalidOperationException"++-- | Exception that indicates that the subscription has been modified by another client. You can retry the request.+--+--+_LockedSubscriptionException :: AsError a => Getting (First ServiceError) a ServiceError+_LockedSubscriptionException =+ _ServiceError . hasCode "LockedSubscriptionException"++-- | Exception indicating the specified resource does not exist.+--+--+_ResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError+_ResourceNotFoundException =+ _ServiceError . hasCode "ResourceNotFoundException"
+ gen/Network/AWS/Shield/Types/Product.hs view
@@ -0,0 +1,583 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.Shield.Types.Product+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Network.AWS.Shield.Types.Product where++import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Shield.Types.Sum++-- | The details of a DDoS attack.+--+--+--+-- /See:/ 'attackDetail' smart constructor.+data AttackDetail = AttackDetail'+ { _adAttackId :: !(Maybe Text)+ , _adStartTime :: !(Maybe POSIX)+ , _adSubResources :: !(Maybe [SubResourceSummary])+ , _adMitigations :: !(Maybe [Mitigation])+ , _adAttackCounters :: !(Maybe [SummarizedCounter])+ , _adResourceARN :: !(Maybe Text)+ , _adEndTime :: !(Maybe POSIX)+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'AttackDetail' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'adAttackId' - The unique identifier (ID) of the attack.+--+-- * 'adStartTime' - The time the attack started, in the format 2016-12-16T13:50Z.+--+-- * 'adSubResources' - If applicable, additional detail about the resource being attacked, for example, IP address or URL.+--+-- * 'adMitigations' - List of mitigation actions taken for the attack.+--+-- * 'adAttackCounters' - List of counters that describe the attack for the specified time period.+--+-- * 'adResourceARN' - The ARN (Amazon Resource Name) of the resource that was attacked.+--+-- * 'adEndTime' - The time the attack ended, in the format 2016-12-16T13:50Z.+attackDetail+ :: AttackDetail+attackDetail =+ AttackDetail'+ { _adAttackId = Nothing+ , _adStartTime = Nothing+ , _adSubResources = Nothing+ , _adMitigations = Nothing+ , _adAttackCounters = Nothing+ , _adResourceARN = Nothing+ , _adEndTime = Nothing+ }++-- | The unique identifier (ID) of the attack.+adAttackId :: Lens' AttackDetail (Maybe Text)+adAttackId = lens _adAttackId (\ s a -> s{_adAttackId = a});++-- | The time the attack started, in the format 2016-12-16T13:50Z.+adStartTime :: Lens' AttackDetail (Maybe UTCTime)+adStartTime = lens _adStartTime (\ s a -> s{_adStartTime = a}) . mapping _Time;++-- | If applicable, additional detail about the resource being attacked, for example, IP address or URL.+adSubResources :: Lens' AttackDetail [SubResourceSummary]+adSubResources = lens _adSubResources (\ s a -> s{_adSubResources = a}) . _Default . _Coerce;++-- | List of mitigation actions taken for the attack.+adMitigations :: Lens' AttackDetail [Mitigation]+adMitigations = lens _adMitigations (\ s a -> s{_adMitigations = a}) . _Default . _Coerce;++-- | List of counters that describe the attack for the specified time period.+adAttackCounters :: Lens' AttackDetail [SummarizedCounter]+adAttackCounters = lens _adAttackCounters (\ s a -> s{_adAttackCounters = a}) . _Default . _Coerce;++-- | The ARN (Amazon Resource Name) of the resource that was attacked.+adResourceARN :: Lens' AttackDetail (Maybe Text)+adResourceARN = lens _adResourceARN (\ s a -> s{_adResourceARN = a});++-- | The time the attack ended, in the format 2016-12-16T13:50Z.+adEndTime :: Lens' AttackDetail (Maybe UTCTime)+adEndTime = lens _adEndTime (\ s a -> s{_adEndTime = a}) . mapping _Time;++instance FromJSON AttackDetail where+ parseJSON+ = withObject "AttackDetail"+ (\ x ->+ AttackDetail' <$>+ (x .:? "AttackId") <*> (x .:? "StartTime") <*>+ (x .:? "SubResources" .!= mempty)+ <*> (x .:? "Mitigations" .!= mempty)+ <*> (x .:? "AttackCounters" .!= mempty)+ <*> (x .:? "ResourceArn")+ <*> (x .:? "EndTime"))++instance Hashable AttackDetail++instance NFData AttackDetail++-- | Summarizes all DDoS attacks for a specified time period.+--+--+--+-- /See:/ 'attackSummary' smart constructor.+data AttackSummary = AttackSummary'+ { _asAttackVectors :: !(Maybe [AttackVectorDescription])+ , _asAttackId :: !(Maybe Text)+ , _asStartTime :: !(Maybe POSIX)+ , _asResourceARN :: !(Maybe Text)+ , _asEndTime :: !(Maybe POSIX)+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'AttackSummary' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'asAttackVectors' - The list of attacks for a specified time period.+--+-- * 'asAttackId' - The unique identifier (ID) of the attack.+--+-- * 'asStartTime' - The start time of the attack, in the format 2016-12-16T13:50Z.+--+-- * 'asResourceARN' - The ARN (Amazon Resource Name) of the resource that was attacked.+--+-- * 'asEndTime' - The end time of the attack, in the format 2016-12-16T13:50Z.+attackSummary+ :: AttackSummary+attackSummary =+ AttackSummary'+ { _asAttackVectors = Nothing+ , _asAttackId = Nothing+ , _asStartTime = Nothing+ , _asResourceARN = Nothing+ , _asEndTime = Nothing+ }++-- | The list of attacks for a specified time period.+asAttackVectors :: Lens' AttackSummary [AttackVectorDescription]+asAttackVectors = lens _asAttackVectors (\ s a -> s{_asAttackVectors = a}) . _Default . _Coerce;++-- | The unique identifier (ID) of the attack.+asAttackId :: Lens' AttackSummary (Maybe Text)+asAttackId = lens _asAttackId (\ s a -> s{_asAttackId = a});++-- | The start time of the attack, in the format 2016-12-16T13:50Z.+asStartTime :: Lens' AttackSummary (Maybe UTCTime)+asStartTime = lens _asStartTime (\ s a -> s{_asStartTime = a}) . mapping _Time;++-- | The ARN (Amazon Resource Name) of the resource that was attacked.+asResourceARN :: Lens' AttackSummary (Maybe Text)+asResourceARN = lens _asResourceARN (\ s a -> s{_asResourceARN = a});++-- | The end time of the attack, in the format 2016-12-16T13:50Z.+asEndTime :: Lens' AttackSummary (Maybe UTCTime)+asEndTime = lens _asEndTime (\ s a -> s{_asEndTime = a}) . mapping _Time;++instance FromJSON AttackSummary where+ parseJSON+ = withObject "AttackSummary"+ (\ x ->+ AttackSummary' <$>+ (x .:? "AttackVectors" .!= mempty) <*>+ (x .:? "AttackId")+ <*> (x .:? "StartTime")+ <*> (x .:? "ResourceArn")+ <*> (x .:? "EndTime"))++instance Hashable AttackSummary++instance NFData AttackSummary++-- | Describes the attack.+--+--+--+-- /See:/ 'attackVectorDescription' smart constructor.+newtype AttackVectorDescription = AttackVectorDescription'+ { _avdVectorType :: Text+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'AttackVectorDescription' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'avdVectorType' - The attack type, for example, SNMP reflection or SYN flood.+attackVectorDescription+ :: Text -- ^ 'avdVectorType'+ -> AttackVectorDescription+attackVectorDescription pVectorType_ =+ AttackVectorDescription'+ { _avdVectorType = pVectorType_+ }++-- | The attack type, for example, SNMP reflection or SYN flood.+avdVectorType :: Lens' AttackVectorDescription Text+avdVectorType = lens _avdVectorType (\ s a -> s{_avdVectorType = a});++instance FromJSON AttackVectorDescription where+ parseJSON+ = withObject "AttackVectorDescription"+ (\ x ->+ AttackVectorDescription' <$> (x .: "VectorType"))++instance Hashable AttackVectorDescription++instance NFData AttackVectorDescription++-- | The mitigation applied to a DDoS attack.+--+--+--+-- /See:/ 'mitigation' smart constructor.+newtype Mitigation = Mitigation'+ { _mMitigationName :: Maybe Text+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'Mitigation' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'mMitigationName' - The name of the mitigation taken for this attack.+mitigation+ :: Mitigation+mitigation =+ Mitigation'+ { _mMitigationName = Nothing+ }++-- | The name of the mitigation taken for this attack.+mMitigationName :: Lens' Mitigation (Maybe Text)+mMitigationName = lens _mMitigationName (\ s a -> s{_mMitigationName = a});++instance FromJSON Mitigation where+ parseJSON+ = withObject "Mitigation"+ (\ x -> Mitigation' <$> (x .:? "MitigationName"))++instance Hashable Mitigation++instance NFData Mitigation++-- | An object that represents a resource that is under DDoS protection.+--+--+--+-- /See:/ 'protection' smart constructor.+data Protection = Protection'+ { _pResourceARN :: !(Maybe Text)+ , _pName :: !(Maybe Text)+ , _pId :: !(Maybe Text)+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'Protection' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'pResourceARN' - The ARN (Amazon Resource Name) of the AWS resource that is protected.+--+-- * 'pName' - The friendly name of the protection. For example, @My CloudFront distributions@ .+--+-- * 'pId' - The unique identifier (ID) of the protection.+protection+ :: Protection+protection =+ Protection'+ { _pResourceARN = Nothing+ , _pName = Nothing+ , _pId = Nothing+ }++-- | The ARN (Amazon Resource Name) of the AWS resource that is protected.+pResourceARN :: Lens' Protection (Maybe Text)+pResourceARN = lens _pResourceARN (\ s a -> s{_pResourceARN = a});++-- | The friendly name of the protection. For example, @My CloudFront distributions@ .+pName :: Lens' Protection (Maybe Text)+pName = lens _pName (\ s a -> s{_pName = a});++-- | The unique identifier (ID) of the protection.+pId :: Lens' Protection (Maybe Text)+pId = lens _pId (\ s a -> s{_pId = a});++instance FromJSON Protection where+ parseJSON+ = withObject "Protection"+ (\ x ->+ Protection' <$>+ (x .:? "ResourceArn") <*> (x .:? "Name") <*>+ (x .:? "Id"))++instance Hashable Protection++instance NFData Protection++-- | The attack information for the specified SubResource.+--+--+--+-- /See:/ 'subResourceSummary' smart constructor.+data SubResourceSummary = SubResourceSummary'+ { _srsCounters :: !(Maybe [SummarizedCounter])+ , _srsAttackVectors :: !(Maybe [SummarizedAttackVector])+ , _srsId :: !(Maybe Text)+ , _srsType :: !(Maybe SubResourceType)+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'SubResourceSummary' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'srsCounters' - The counters that describe the details of the attack.+--+-- * 'srsAttackVectors' - The list of attack types and associated counters.+--+-- * 'srsId' - The unique identifier (ID) of the @SubResource@ .+--+-- * 'srsType' - The @SubResource@ type.+subResourceSummary+ :: SubResourceSummary+subResourceSummary =+ SubResourceSummary'+ { _srsCounters = Nothing+ , _srsAttackVectors = Nothing+ , _srsId = Nothing+ , _srsType = Nothing+ }++-- | The counters that describe the details of the attack.+srsCounters :: Lens' SubResourceSummary [SummarizedCounter]+srsCounters = lens _srsCounters (\ s a -> s{_srsCounters = a}) . _Default . _Coerce;++-- | The list of attack types and associated counters.+srsAttackVectors :: Lens' SubResourceSummary [SummarizedAttackVector]+srsAttackVectors = lens _srsAttackVectors (\ s a -> s{_srsAttackVectors = a}) . _Default . _Coerce;++-- | The unique identifier (ID) of the @SubResource@ .+srsId :: Lens' SubResourceSummary (Maybe Text)+srsId = lens _srsId (\ s a -> s{_srsId = a});++-- | The @SubResource@ type.+srsType :: Lens' SubResourceSummary (Maybe SubResourceType)+srsType = lens _srsType (\ s a -> s{_srsType = a});++instance FromJSON SubResourceSummary where+ parseJSON+ = withObject "SubResourceSummary"+ (\ x ->+ SubResourceSummary' <$>+ (x .:? "Counters" .!= mempty) <*>+ (x .:? "AttackVectors" .!= mempty)+ <*> (x .:? "Id")+ <*> (x .:? "Type"))++instance Hashable SubResourceSummary++instance NFData SubResourceSummary++-- | Information about the AWS Shield Advanced subscription for an account.+--+--+--+-- /See:/ 'subscription' smart constructor.+data Subscription = Subscription'+ { _sTimeCommitmentInSeconds :: !(Maybe Nat)+ , _sStartTime :: !(Maybe POSIX)+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'Subscription' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'sTimeCommitmentInSeconds' - The length, in seconds, of the AWS Shield Advanced subscription for the account.+--+-- * 'sStartTime' - The start time of the subscription, in the format "2016-12-16T13:50Z".+subscription+ :: Subscription+subscription =+ Subscription'+ { _sTimeCommitmentInSeconds = Nothing+ , _sStartTime = Nothing+ }++-- | The length, in seconds, of the AWS Shield Advanced subscription for the account.+sTimeCommitmentInSeconds :: Lens' Subscription (Maybe Natural)+sTimeCommitmentInSeconds = lens _sTimeCommitmentInSeconds (\ s a -> s{_sTimeCommitmentInSeconds = a}) . mapping _Nat;++-- | The start time of the subscription, in the format "2016-12-16T13:50Z".+sStartTime :: Lens' Subscription (Maybe UTCTime)+sStartTime = lens _sStartTime (\ s a -> s{_sStartTime = a}) . mapping _Time;++instance FromJSON Subscription where+ parseJSON+ = withObject "Subscription"+ (\ x ->+ Subscription' <$>+ (x .:? "TimeCommitmentInSeconds") <*>+ (x .:? "StartTime"))++instance Hashable Subscription++instance NFData Subscription++-- | A summary of information about the attack.+--+--+--+-- /See:/ 'summarizedAttackVector' smart constructor.+data SummarizedAttackVector = SummarizedAttackVector'+ { _savVectorCounters :: !(Maybe [SummarizedCounter])+ , _savVectorType :: !Text+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'SummarizedAttackVector' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'savVectorCounters' - The list of counters that describe the details of the attack.+--+-- * 'savVectorType' - The attack type, for example, SNMP reflection or SYN flood.+summarizedAttackVector+ :: Text -- ^ 'savVectorType'+ -> SummarizedAttackVector+summarizedAttackVector pVectorType_ =+ SummarizedAttackVector'+ { _savVectorCounters = Nothing+ , _savVectorType = pVectorType_+ }++-- | The list of counters that describe the details of the attack.+savVectorCounters :: Lens' SummarizedAttackVector [SummarizedCounter]+savVectorCounters = lens _savVectorCounters (\ s a -> s{_savVectorCounters = a}) . _Default . _Coerce;++-- | The attack type, for example, SNMP reflection or SYN flood.+savVectorType :: Lens' SummarizedAttackVector Text+savVectorType = lens _savVectorType (\ s a -> s{_savVectorType = a});++instance FromJSON SummarizedAttackVector where+ parseJSON+ = withObject "SummarizedAttackVector"+ (\ x ->+ SummarizedAttackVector' <$>+ (x .:? "VectorCounters" .!= mempty) <*>+ (x .: "VectorType"))++instance Hashable SummarizedAttackVector++instance NFData SummarizedAttackVector++-- | The counter that describes a DDoS attack.+--+--+--+-- /See:/ 'summarizedCounter' smart constructor.+data SummarizedCounter = SummarizedCounter'+ { _scMax :: !(Maybe Double)+ , _scAverage :: !(Maybe Double)+ , _scN :: !(Maybe Int)+ , _scName :: !(Maybe Text)+ , _scSum :: !(Maybe Double)+ , _scUnit :: !(Maybe Text)+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'SummarizedCounter' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'scMax' - The maximum value of the counter for a specified time period.+--+-- * 'scAverage' - The average value of the counter for a specified time period.+--+-- * 'scN' - The number of counters for a specified time period.+--+-- * 'scName' - The counter name.+--+-- * 'scSum' - The total of counter values for a specified time period.+--+-- * 'scUnit' - The unit of the counters.+summarizedCounter+ :: SummarizedCounter+summarizedCounter =+ SummarizedCounter'+ { _scMax = Nothing+ , _scAverage = Nothing+ , _scN = Nothing+ , _scName = Nothing+ , _scSum = Nothing+ , _scUnit = Nothing+ }++-- | The maximum value of the counter for a specified time period.+scMax :: Lens' SummarizedCounter (Maybe Double)+scMax = lens _scMax (\ s a -> s{_scMax = a});++-- | The average value of the counter for a specified time period.+scAverage :: Lens' SummarizedCounter (Maybe Double)+scAverage = lens _scAverage (\ s a -> s{_scAverage = a});++-- | The number of counters for a specified time period.+scN :: Lens' SummarizedCounter (Maybe Int)+scN = lens _scN (\ s a -> s{_scN = a});++-- | The counter name.+scName :: Lens' SummarizedCounter (Maybe Text)+scName = lens _scName (\ s a -> s{_scName = a});++-- | The total of counter values for a specified time period.+scSum :: Lens' SummarizedCounter (Maybe Double)+scSum = lens _scSum (\ s a -> s{_scSum = a});++-- | The unit of the counters.+scUnit :: Lens' SummarizedCounter (Maybe Text)+scUnit = lens _scUnit (\ s a -> s{_scUnit = a});++instance FromJSON SummarizedCounter where+ parseJSON+ = withObject "SummarizedCounter"+ (\ x ->+ SummarizedCounter' <$>+ (x .:? "Max") <*> (x .:? "Average") <*> (x .:? "N")+ <*> (x .:? "Name")+ <*> (x .:? "Sum")+ <*> (x .:? "Unit"))++instance Hashable SummarizedCounter++instance NFData SummarizedCounter++-- | The time range.+--+--+--+-- /See:/ 'timeRange' smart constructor.+data TimeRange = TimeRange'+ { _trFromInclusive :: !(Maybe POSIX)+ , _trToExclusive :: !(Maybe POSIX)+ } deriving (Eq,Read,Show,Data,Typeable,Generic)++-- | Creates a value of 'TimeRange' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'trFromInclusive' - The start time, in the format 2016-12-16T13:50Z.+--+-- * 'trToExclusive' - The end time, in the format 2016-12-16T15:50Z.+timeRange+ :: TimeRange+timeRange =+ TimeRange'+ { _trFromInclusive = Nothing+ , _trToExclusive = Nothing+ }++-- | The start time, in the format 2016-12-16T13:50Z.+trFromInclusive :: Lens' TimeRange (Maybe UTCTime)+trFromInclusive = lens _trFromInclusive (\ s a -> s{_trFromInclusive = a}) . mapping _Time;++-- | The end time, in the format 2016-12-16T15:50Z.+trToExclusive :: Lens' TimeRange (Maybe UTCTime)+trToExclusive = lens _trToExclusive (\ s a -> s{_trToExclusive = a}) . mapping _Time;++instance Hashable TimeRange++instance NFData TimeRange++instance ToJSON TimeRange where+ toJSON TimeRange'{..}+ = object+ (catMaybes+ [("FromInclusive" .=) <$> _trFromInclusive,+ ("ToExclusive" .=) <$> _trToExclusive])
+ gen/Network/AWS/Shield/Types/Sum.hs view
@@ -0,0 +1,46 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.Shield.Types.Sum+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Network.AWS.Shield.Types.Sum where++import Network.AWS.Prelude++data SubResourceType+ = IP+ | URL+ deriving (Eq,Ord,Read,Show,Enum,Bounded,Data,Typeable,Generic)++instance FromText SubResourceType where+ parser = takeLowerText >>= \case+ "ip" -> pure IP+ "url" -> pure URL+ e -> fromTextError $ "Failure parsing SubResourceType from value: '" <> e+ <> "'. Accepted values: ip, url"++instance ToText SubResourceType where+ toText = \case+ IP -> "IP"+ URL -> "URL"++instance Hashable SubResourceType+instance NFData SubResourceType+instance ToByteString SubResourceType+instance ToQuery SubResourceType+instance ToHeader SubResourceType++instance FromJSON SubResourceType where+ parseJSON = parseJSONText "SubResourceType"
+ gen/Network/AWS/Shield/Waiters.hs view
@@ -0,0 +1,21 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.Shield.Waiters+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Network.AWS.Shield.Waiters where++import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Shield.Types+import Network.AWS.Waiter
+ src/.gitkeep view
+ test/Main.hs view
@@ -0,0 +1,21 @@+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Main+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Main (main) where++import Test.Tasty+import Test.AWS.Shield+import Test.AWS.Shield.Internal++main :: IO ()+main = defaultMain $ testGroup "Shield"+ [ testGroup "tests" tests+ , testGroup "fixtures" fixtures+ ]
+ test/Test/AWS/Gen/Shield.hs view
@@ -0,0 +1,201 @@+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-orphans #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Test.AWS.Gen.Shield+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Test.AWS.Gen.Shield where++import Data.Proxy+import Test.AWS.Fixture+import Test.AWS.Prelude+import Test.Tasty+import Network.AWS.Shield+import Test.AWS.Shield.Internal++-- Auto-generated: the actual test selection needs to be manually placed into+-- the top-level so that real test data can be incrementally added.+--+-- This commented snippet is what the entire set should look like:++-- fixtures :: TestTree+-- fixtures =+-- [ testGroup "request"+-- [ requestCreateSubscription $+-- createSubscription+--+-- , requestListProtections $+-- listProtections+--+-- , requestDeleteSubscription $+-- deleteSubscription+--+-- , requestDescribeAttack $+-- describeAttack+--+-- , requestDescribeProtection $+-- describeProtection+--+-- , requestListAttacks $+-- listAttacks+--+-- , requestCreateProtection $+-- createProtection+--+-- , requestDeleteProtection $+-- deleteProtection+--+-- , requestDescribeSubscription $+-- describeSubscription+--+-- ]++-- , testGroup "response"+-- [ responseCreateSubscription $+-- createSubscriptionResponse+--+-- , responseListProtections $+-- listProtectionsResponse+--+-- , responseDeleteSubscription $+-- deleteSubscriptionResponse+--+-- , responseDescribeAttack $+-- describeAttackResponse+--+-- , responseDescribeProtection $+-- describeProtectionResponse+--+-- , responseListAttacks $+-- listAttacksResponse+--+-- , responseCreateProtection $+-- createProtectionResponse+--+-- , responseDeleteProtection $+-- deleteProtectionResponse+--+-- , responseDescribeSubscription $+-- describeSubscriptionResponse+--+-- ]+-- ]++-- Requests++requestCreateSubscription :: CreateSubscription -> TestTree+requestCreateSubscription = req+ "CreateSubscription"+ "fixture/CreateSubscription.yaml"++requestListProtections :: ListProtections -> TestTree+requestListProtections = req+ "ListProtections"+ "fixture/ListProtections.yaml"++requestDeleteSubscription :: DeleteSubscription -> TestTree+requestDeleteSubscription = req+ "DeleteSubscription"+ "fixture/DeleteSubscription.yaml"++requestDescribeAttack :: DescribeAttack -> TestTree+requestDescribeAttack = req+ "DescribeAttack"+ "fixture/DescribeAttack.yaml"++requestDescribeProtection :: DescribeProtection -> TestTree+requestDescribeProtection = req+ "DescribeProtection"+ "fixture/DescribeProtection.yaml"++requestListAttacks :: ListAttacks -> TestTree+requestListAttacks = req+ "ListAttacks"+ "fixture/ListAttacks.yaml"++requestCreateProtection :: CreateProtection -> TestTree+requestCreateProtection = req+ "CreateProtection"+ "fixture/CreateProtection.yaml"++requestDeleteProtection :: DeleteProtection -> TestTree+requestDeleteProtection = req+ "DeleteProtection"+ "fixture/DeleteProtection.yaml"++requestDescribeSubscription :: DescribeSubscription -> TestTree+requestDescribeSubscription = req+ "DescribeSubscription"+ "fixture/DescribeSubscription.yaml"++-- Responses++responseCreateSubscription :: CreateSubscriptionResponse -> TestTree+responseCreateSubscription = res+ "CreateSubscriptionResponse"+ "fixture/CreateSubscriptionResponse.proto"+ shield+ (Proxy :: Proxy CreateSubscription)++responseListProtections :: ListProtectionsResponse -> TestTree+responseListProtections = res+ "ListProtectionsResponse"+ "fixture/ListProtectionsResponse.proto"+ shield+ (Proxy :: Proxy ListProtections)++responseDeleteSubscription :: DeleteSubscriptionResponse -> TestTree+responseDeleteSubscription = res+ "DeleteSubscriptionResponse"+ "fixture/DeleteSubscriptionResponse.proto"+ shield+ (Proxy :: Proxy DeleteSubscription)++responseDescribeAttack :: DescribeAttackResponse -> TestTree+responseDescribeAttack = res+ "DescribeAttackResponse"+ "fixture/DescribeAttackResponse.proto"+ shield+ (Proxy :: Proxy DescribeAttack)++responseDescribeProtection :: DescribeProtectionResponse -> TestTree+responseDescribeProtection = res+ "DescribeProtectionResponse"+ "fixture/DescribeProtectionResponse.proto"+ shield+ (Proxy :: Proxy DescribeProtection)++responseListAttacks :: ListAttacksResponse -> TestTree+responseListAttacks = res+ "ListAttacksResponse"+ "fixture/ListAttacksResponse.proto"+ shield+ (Proxy :: Proxy ListAttacks)++responseCreateProtection :: CreateProtectionResponse -> TestTree+responseCreateProtection = res+ "CreateProtectionResponse"+ "fixture/CreateProtectionResponse.proto"+ shield+ (Proxy :: Proxy CreateProtection)++responseDeleteProtection :: DeleteProtectionResponse -> TestTree+responseDeleteProtection = res+ "DeleteProtectionResponse"+ "fixture/DeleteProtectionResponse.proto"+ shield+ (Proxy :: Proxy DeleteProtection)++responseDescribeSubscription :: DescribeSubscriptionResponse -> TestTree+responseDescribeSubscription = res+ "DescribeSubscriptionResponse"+ "fixture/DescribeSubscriptionResponse.proto"+ shield+ (Proxy :: Proxy DescribeSubscription)
+ test/Test/AWS/Shield.hs view
@@ -0,0 +1,20 @@+-- |+-- Module : Test.AWS.Shield+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Test.AWS.Shield+ ( tests+ , fixtures+ ) where++import Test.Tasty (TestTree)++tests :: [TestTree]+tests = []++fixtures :: [TestTree]+fixtures = []
+ test/Test/AWS/Shield/Internal.hs view
@@ -0,0 +1,9 @@+-- |+-- Module : Test.AWS.Shield.Internal+-- Copyright : (c) 2013-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Test.AWS.Shield.Internal where