amazonka-shield 1.5.0 → 1.6.0
raw patch · 23 files changed
+658/−179 lines, 23 filesdep ~amazonka-coredep ~amazonka-testPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: amazonka-core, amazonka-test
API changes (from Hackage documentation)
+ Network.AWS.Shield: Active :: SubscriptionState
+ Network.AWS.Shield: Application :: AttackLayer
+ Network.AWS.Shield: Bits :: Unit
+ Network.AWS.Shield: Bytes :: Unit
+ Network.AWS.Shield: DestinationURL :: AttackPropertyIdentifier
+ Network.AWS.Shield: Inactive :: SubscriptionState
+ Network.AWS.Shield: Network :: AttackLayer
+ Network.AWS.Shield: Packets :: Unit
+ Network.AWS.Shield: Referrer :: AttackPropertyIdentifier
+ Network.AWS.Shield: Requests :: Unit
+ Network.AWS.Shield: SourceASN :: AttackPropertyIdentifier
+ Network.AWS.Shield: SourceCountry :: AttackPropertyIdentifier
+ Network.AWS.Shield: SourceIPAddress :: AttackPropertyIdentifier
+ Network.AWS.Shield: SourceUserAgent :: AttackPropertyIdentifier
+ Network.AWS.Shield: adAttackProperties :: Lens' AttackDetail [AttackProperty]
+ Network.AWS.Shield: apAttackLayer :: Lens' AttackProperty (Maybe AttackLayer)
+ Network.AWS.Shield: apAttackPropertyIdentifier :: Lens' AttackProperty (Maybe AttackPropertyIdentifier)
+ Network.AWS.Shield: apTopContributors :: Lens' AttackProperty [Contributor]
+ Network.AWS.Shield: apTotal :: Lens' AttackProperty (Maybe Integer)
+ Network.AWS.Shield: apUnit :: Lens' AttackProperty (Maybe Unit)
+ Network.AWS.Shield: attackProperty :: AttackProperty
+ Network.AWS.Shield: cName :: Lens' Contributor (Maybe Text)
+ Network.AWS.Shield: cValue :: Lens' Contributor (Maybe Integer)
+ Network.AWS.Shield: contributor :: Contributor
+ Network.AWS.Shield: data AttackLayer
+ Network.AWS.Shield: data AttackProperty
+ Network.AWS.Shield: data AttackPropertyIdentifier
+ Network.AWS.Shield: data Contributor
+ Network.AWS.Shield: data SubscriptionState
+ Network.AWS.Shield: data Unit
+ Network.AWS.Shield.GetSubscriptionState: data GetSubscriptionState
+ Network.AWS.Shield.GetSubscriptionState: data GetSubscriptionStateResponse
+ Network.AWS.Shield.GetSubscriptionState: getSubscriptionState :: GetSubscriptionState
+ Network.AWS.Shield.GetSubscriptionState: getSubscriptionStateResponse :: Int -> SubscriptionState -> GetSubscriptionStateResponse
+ Network.AWS.Shield.GetSubscriptionState: gssrsResponseStatus :: Lens' GetSubscriptionStateResponse Int
+ Network.AWS.Shield.GetSubscriptionState: gssrsSubscriptionState :: Lens' GetSubscriptionStateResponse SubscriptionState
+ Network.AWS.Shield.GetSubscriptionState: instance Control.DeepSeq.NFData Network.AWS.Shield.GetSubscriptionState.GetSubscriptionState
+ Network.AWS.Shield.GetSubscriptionState: instance Control.DeepSeq.NFData Network.AWS.Shield.GetSubscriptionState.GetSubscriptionStateResponse
+ Network.AWS.Shield.GetSubscriptionState: instance Data.Aeson.Types.ToJSON.ToJSON Network.AWS.Shield.GetSubscriptionState.GetSubscriptionState
+ Network.AWS.Shield.GetSubscriptionState: instance Data.Data.Data Network.AWS.Shield.GetSubscriptionState.GetSubscriptionState
+ Network.AWS.Shield.GetSubscriptionState: instance Data.Data.Data Network.AWS.Shield.GetSubscriptionState.GetSubscriptionStateResponse
+ Network.AWS.Shield.GetSubscriptionState: instance Data.Hashable.Class.Hashable Network.AWS.Shield.GetSubscriptionState.GetSubscriptionState
+ Network.AWS.Shield.GetSubscriptionState: instance GHC.Classes.Eq Network.AWS.Shield.GetSubscriptionState.GetSubscriptionState
+ Network.AWS.Shield.GetSubscriptionState: instance GHC.Classes.Eq Network.AWS.Shield.GetSubscriptionState.GetSubscriptionStateResponse
+ Network.AWS.Shield.GetSubscriptionState: instance GHC.Generics.Generic Network.AWS.Shield.GetSubscriptionState.GetSubscriptionState
+ Network.AWS.Shield.GetSubscriptionState: instance GHC.Generics.Generic Network.AWS.Shield.GetSubscriptionState.GetSubscriptionStateResponse
+ Network.AWS.Shield.GetSubscriptionState: instance GHC.Read.Read Network.AWS.Shield.GetSubscriptionState.GetSubscriptionState
+ Network.AWS.Shield.GetSubscriptionState: instance GHC.Read.Read Network.AWS.Shield.GetSubscriptionState.GetSubscriptionStateResponse
+ Network.AWS.Shield.GetSubscriptionState: instance GHC.Show.Show Network.AWS.Shield.GetSubscriptionState.GetSubscriptionState
+ Network.AWS.Shield.GetSubscriptionState: instance GHC.Show.Show Network.AWS.Shield.GetSubscriptionState.GetSubscriptionStateResponse
+ Network.AWS.Shield.GetSubscriptionState: instance Network.AWS.Data.Headers.ToHeaders Network.AWS.Shield.GetSubscriptionState.GetSubscriptionState
+ Network.AWS.Shield.GetSubscriptionState: instance Network.AWS.Data.Path.ToPath Network.AWS.Shield.GetSubscriptionState.GetSubscriptionState
+ Network.AWS.Shield.GetSubscriptionState: instance Network.AWS.Data.Query.ToQuery Network.AWS.Shield.GetSubscriptionState.GetSubscriptionState
+ Network.AWS.Shield.GetSubscriptionState: instance Network.AWS.Types.AWSRequest Network.AWS.Shield.GetSubscriptionState.GetSubscriptionState
+ Network.AWS.Shield.ListProtections: instance Network.AWS.Pager.AWSPager Network.AWS.Shield.ListProtections.ListProtections
+ Network.AWS.Shield.Types: Active :: SubscriptionState
+ Network.AWS.Shield.Types: Application :: AttackLayer
+ Network.AWS.Shield.Types: Bits :: Unit
+ Network.AWS.Shield.Types: Bytes :: Unit
+ Network.AWS.Shield.Types: DestinationURL :: AttackPropertyIdentifier
+ Network.AWS.Shield.Types: Inactive :: SubscriptionState
+ Network.AWS.Shield.Types: Network :: AttackLayer
+ Network.AWS.Shield.Types: Packets :: Unit
+ Network.AWS.Shield.Types: Referrer :: AttackPropertyIdentifier
+ Network.AWS.Shield.Types: Requests :: Unit
+ Network.AWS.Shield.Types: SourceASN :: AttackPropertyIdentifier
+ Network.AWS.Shield.Types: SourceCountry :: AttackPropertyIdentifier
+ Network.AWS.Shield.Types: SourceIPAddress :: AttackPropertyIdentifier
+ Network.AWS.Shield.Types: SourceUserAgent :: AttackPropertyIdentifier
+ Network.AWS.Shield.Types: adAttackProperties :: Lens' AttackDetail [AttackProperty]
+ Network.AWS.Shield.Types: apAttackLayer :: Lens' AttackProperty (Maybe AttackLayer)
+ Network.AWS.Shield.Types: apAttackPropertyIdentifier :: Lens' AttackProperty (Maybe AttackPropertyIdentifier)
+ Network.AWS.Shield.Types: apTopContributors :: Lens' AttackProperty [Contributor]
+ Network.AWS.Shield.Types: apTotal :: Lens' AttackProperty (Maybe Integer)
+ Network.AWS.Shield.Types: apUnit :: Lens' AttackProperty (Maybe Unit)
+ Network.AWS.Shield.Types: attackProperty :: AttackProperty
+ Network.AWS.Shield.Types: cName :: Lens' Contributor (Maybe Text)
+ Network.AWS.Shield.Types: cValue :: Lens' Contributor (Maybe Integer)
+ Network.AWS.Shield.Types: contributor :: Contributor
+ Network.AWS.Shield.Types: data AttackLayer
+ Network.AWS.Shield.Types: data AttackProperty
+ Network.AWS.Shield.Types: data AttackPropertyIdentifier
+ Network.AWS.Shield.Types: data Contributor
+ Network.AWS.Shield.Types: data SubscriptionState
+ Network.AWS.Shield.Types: data Unit
Files
- README.md +1/−1
- amazonka-shield.cabal +6/−5
- fixture/GetSubscriptionState.yaml +10/−0
- fixture/GetSubscriptionStateResponse.proto +0/−0
- gen/Network/AWS/Shield.hs +34/−2
- gen/Network/AWS/Shield/CreateProtection.hs +9/−9
- gen/Network/AWS/Shield/CreateSubscription.hs +2/−2
- gen/Network/AWS/Shield/DeleteProtection.hs +3/−3
- gen/Network/AWS/Shield/DeleteSubscription.hs +3/−3
- gen/Network/AWS/Shield/DescribeAttack.hs +5/−5
- gen/Network/AWS/Shield/DescribeProtection.hs +5/−5
- gen/Network/AWS/Shield/DescribeSubscription.hs +4/−4
- gen/Network/AWS/Shield/GetSubscriptionState.hs +124/−0
- gen/Network/AWS/Shield/ListAttacks.hs +23/−23
- gen/Network/AWS/Shield/ListProtections.hs +20/−10
- gen/Network/AWS/Shield/Types.hs +51/−17
- gen/Network/AWS/Shield/Types/Product.hs +208/−84
- gen/Network/AWS/Shield/Types/Sum.hs +127/−1
- gen/Network/AWS/Shield/Waiters.hs +1/−1
- test/Main.hs +1/−1
- test/Test/AWS/Gen/Shield.hs +19/−1
- test/Test/AWS/Shield.hs +1/−1
- test/Test/AWS/Shield/Internal.hs +1/−1
README.md view
@@ -8,7 +8,7 @@ ## Version -`1.5.0`+`1.6.0` ## Description
amazonka-shield.cabal view
@@ -1,5 +1,5 @@ name: amazonka-shield-version: 1.5.0+version: 1.6.0 synopsis: Amazon Shield SDK. homepage: https://github.com/brendanhay/amazonka bug-reports: https://github.com/brendanhay/amazonka/issues@@ -7,7 +7,7 @@ license-file: LICENSE author: Brendan Hay maintainer: Brendan Hay <brendan.g.hay+amazonka@gmail.com>-copyright: Copyright (c) 2013-2017 Brendan Hay+copyright: Copyright (c) 2013-2018 Brendan Hay category: Network, AWS, Cloud, Distributed Computing build-type: Simple cabal-version: >= 1.10@@ -52,6 +52,7 @@ , Network.AWS.Shield.DescribeAttack , Network.AWS.Shield.DescribeProtection , Network.AWS.Shield.DescribeSubscription+ , Network.AWS.Shield.GetSubscriptionState , Network.AWS.Shield.ListAttacks , Network.AWS.Shield.ListProtections , Network.AWS.Shield.Types@@ -62,7 +63,7 @@ , Network.AWS.Shield.Types.Sum build-depends:- amazonka-core == 1.5.0.*+ amazonka-core == 1.6.0.* , base >= 4.7 && < 5 test-suite amazonka-shield-test@@ -82,8 +83,8 @@ , Test.AWS.Shield.Internal build-depends:- amazonka-core == 1.5.0.*- , amazonka-test == 1.5.0.*+ amazonka-core == 1.6.0.*+ , amazonka-test == 1.6.0.* , amazonka-shield , base , bytestring
+ fixture/GetSubscriptionState.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/GetSubscriptionStateResponse.proto view
gen/Network/AWS/Shield.hs view
@@ -5,7 +5,7 @@ -- | -- Module : Network.AWS.Shield--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated@@ -59,7 +59,7 @@ -- ** CreateSubscription , module Network.AWS.Shield.CreateSubscription - -- ** ListProtections+ -- ** ListProtections (Paginated) , module Network.AWS.Shield.ListProtections -- ** DeleteSubscription@@ -80,14 +80,29 @@ -- ** DeleteProtection , module Network.AWS.Shield.DeleteProtection + -- ** GetSubscriptionState+ , module Network.AWS.Shield.GetSubscriptionState+ -- ** DescribeSubscription , module Network.AWS.Shield.DescribeSubscription -- * Types + -- ** AttackLayer+ , AttackLayer (..)++ -- ** AttackPropertyIdentifier+ , AttackPropertyIdentifier (..)+ -- ** SubResourceType , SubResourceType (..) + -- ** SubscriptionState+ , SubscriptionState (..)++ -- ** Unit+ , Unit (..)+ -- ** AttackDetail , AttackDetail , attackDetail@@ -95,10 +110,20 @@ , adStartTime , adSubResources , adMitigations+ , adAttackProperties , adAttackCounters , adResourceARN , adEndTime + -- ** AttackProperty+ , AttackProperty+ , attackProperty+ , apAttackLayer+ , apTopContributors+ , apAttackPropertyIdentifier+ , apTotal+ , apUnit+ -- ** AttackSummary , AttackSummary , attackSummary@@ -113,6 +138,12 @@ , attackVectorDescription , avdVectorType + -- ** Contributor+ , Contributor+ , contributor+ , cValue+ , cName+ -- ** Mitigation , Mitigation , mitigation@@ -169,6 +200,7 @@ import Network.AWS.Shield.DescribeAttack import Network.AWS.Shield.DescribeProtection import Network.AWS.Shield.DescribeSubscription+import Network.AWS.Shield.GetSubscriptionState import Network.AWS.Shield.ListAttacks import Network.AWS.Shield.ListProtections import Network.AWS.Shield.Types
gen/Network/AWS/Shield/CreateProtection.hs view
@@ -12,13 +12,13 @@ -- | -- Module : Network.AWS.Shield.CreateProtection--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@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.+-- Enables AWS Shield Advanced for a specific AWS resource. The resource can be an Amazon CloudFront distribution, Elastic Load Balancing load balancer, Elastic IP Address, or an Amazon Route 53 hosted zone. -- -- module Network.AWS.Shield.CreateProtection@@ -58,7 +58,7 @@ -- -- * 'cpName' - Friendly name for the @Protection@ you are creating. ----- * 'cpResourceARN' - The ARN (Amazon Resource Name) of the resource to be protected.+-- * 'cpResourceARN' - The ARN (Amazon Resource Name) of the resource to be protected. The ARN should be in one of the following formats: * For an Application Load Balancer: @arn:aws:elasticloadbalancing:/region/ :/account-id/ :loadbalancer/app//load-balancer-name/ //load-balancer-id/ @ * For an Elastic Load Balancer (Classic Load Balancer): @arn:aws:elasticloadbalancing:/region/ :/account-id/ :loadbalancer//load-balancer-name/ @ * For AWS CloudFront distribution: @arn:aws:cloudfront::/account-id/ :distribution//distribution-id/ @ * For Amazon Route 53: @arn:aws:route53::/account-id/ :hostedzone//hosted-zone-id/ @ * For an Elastic IP address: @arn:aws:ec2:/region/ :/account-id/ :eip-allocation//allocation-id/ @ createProtection :: Text -- ^ 'cpName' -> Text -- ^ 'cpResourceARN'@@ -69,11 +69,11 @@ -- | Friendly name for the @Protection@ you are creating. cpName :: Lens' CreateProtection Text-cpName = lens _cpName (\ s a -> s{_cpName = a});+cpName = lens _cpName (\ s a -> s{_cpName = a}) --- | The ARN (Amazon Resource Name) of the resource to be protected.+-- | The ARN (Amazon Resource Name) of the resource to be protected. The ARN should be in one of the following formats: * For an Application Load Balancer: @arn:aws:elasticloadbalancing:/region/ :/account-id/ :loadbalancer/app//load-balancer-name/ //load-balancer-id/ @ * For an Elastic Load Balancer (Classic Load Balancer): @arn:aws:elasticloadbalancing:/region/ :/account-id/ :loadbalancer//load-balancer-name/ @ * For AWS CloudFront distribution: @arn:aws:cloudfront::/account-id/ :distribution//distribution-id/ @ * For Amazon Route 53: @arn:aws:route53::/account-id/ :hostedzone//hosted-zone-id/ @ * For an Elastic IP address: @arn:aws:ec2:/region/ :/account-id/ :eip-allocation//allocation-id/ @ cpResourceARN :: Lens' CreateProtection Text-cpResourceARN = lens _cpResourceARN (\ s a -> s{_cpResourceARN = a});+cpResourceARN = lens _cpResourceARN (\ s a -> s{_cpResourceARN = a}) instance AWSRequest CreateProtection where type Rs CreateProtection = CreateProtectionResponse@@ -130,15 +130,15 @@ -> CreateProtectionResponse createProtectionResponse pResponseStatus_ = CreateProtectionResponse'- {_cprsProtectionId = Nothing, _cprsResponseStatus = pResponseStatus_}+ {_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});+cprsProtectionId = lens _cprsProtectionId (\ s a -> s{_cprsProtectionId = a}) -- | -- | The response status code. cprsResponseStatus :: Lens' CreateProtectionResponse Int-cprsResponseStatus = lens _cprsResponseStatus (\ s a -> s{_cprsResponseStatus = a});+cprsResponseStatus = lens _cprsResponseStatus (\ s a -> s{_cprsResponseStatus = a}) instance NFData CreateProtectionResponse where
gen/Network/AWS/Shield/CreateSubscription.hs view
@@ -12,7 +12,7 @@ -- | -- Module : Network.AWS.Shield.CreateSubscription--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated@@ -106,6 +106,6 @@ -- | -- | The response status code. csrsResponseStatus :: Lens' CreateSubscriptionResponse Int-csrsResponseStatus = lens _csrsResponseStatus (\ s a -> s{_csrsResponseStatus = a});+csrsResponseStatus = lens _csrsResponseStatus (\ s a -> s{_csrsResponseStatus = a}) instance NFData CreateSubscriptionResponse where
gen/Network/AWS/Shield/DeleteProtection.hs view
@@ -12,7 +12,7 @@ -- | -- Module : Network.AWS.Shield.DeleteProtection--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated@@ -63,7 +63,7 @@ -- | The unique identifier (ID) for the 'Protection' object to be deleted. dProtectionId :: Lens' DeleteProtection Text-dProtectionId = lens _dProtectionId (\ s a -> s{_dProtectionId = a});+dProtectionId = lens _dProtectionId (\ s a -> s{_dProtectionId = a}) instance AWSRequest DeleteProtection where type Rs DeleteProtection = DeleteProtectionResponse@@ -118,6 +118,6 @@ -- | -- | The response status code. delrsResponseStatus :: Lens' DeleteProtectionResponse Int-delrsResponseStatus = lens _delrsResponseStatus (\ s a -> s{_delrsResponseStatus = a});+delrsResponseStatus = lens _delrsResponseStatus (\ s a -> s{_delrsResponseStatus = a}) instance NFData DeleteProtectionResponse where
gen/Network/AWS/Shield/DeleteSubscription.hs view
@@ -12,13 +12,13 @@ -- | -- Module : Network.AWS.Shield.DeleteSubscription--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) ----- Removes AWS Shield Advanced from an account.+-- Removes AWS Shield Advanced from an account. AWS Shield Advanced requires a 1-year subscription commitment. You cannot delete a subscription prior to the completion of that commitment. -- -- module Network.AWS.Shield.DeleteSubscription@@ -106,6 +106,6 @@ -- | -- | The response status code. drsResponseStatus :: Lens' DeleteSubscriptionResponse Int-drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a});+drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a}) instance NFData DeleteSubscriptionResponse where
gen/Network/AWS/Shield/DescribeAttack.hs view
@@ -12,7 +12,7 @@ -- | -- Module : Network.AWS.Shield.DescribeAttack--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated@@ -63,7 +63,7 @@ -- | The unique identifier (ID) for the attack that to be described. daAttackId :: Lens' DescribeAttack Text-daAttackId = lens _daAttackId (\ s a -> s{_daAttackId = a});+daAttackId = lens _daAttackId (\ s a -> s{_daAttackId = a}) instance AWSRequest DescribeAttack where type Rs DescribeAttack = DescribeAttackResponse@@ -117,15 +117,15 @@ -> DescribeAttackResponse describeAttackResponse pResponseStatus_ = DescribeAttackResponse'- {_darsAttack = Nothing, _darsResponseStatus = pResponseStatus_}+ {_darsAttack = Nothing, _darsResponseStatus = pResponseStatus_} -- | The attack that is described. darsAttack :: Lens' DescribeAttackResponse (Maybe AttackDetail)-darsAttack = lens _darsAttack (\ s a -> s{_darsAttack = a});+darsAttack = lens _darsAttack (\ s a -> s{_darsAttack = a}) -- | -- | The response status code. darsResponseStatus :: Lens' DescribeAttackResponse Int-darsResponseStatus = lens _darsResponseStatus (\ s a -> s{_darsResponseStatus = a});+darsResponseStatus = lens _darsResponseStatus (\ s a -> s{_darsResponseStatus = a}) instance NFData DescribeAttackResponse where
gen/Network/AWS/Shield/DescribeProtection.hs view
@@ -12,7 +12,7 @@ -- | -- Module : Network.AWS.Shield.DescribeProtection--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated@@ -64,7 +64,7 @@ -- | The unique identifier (ID) for the 'Protection' object that is described. dpProtectionId :: Lens' DescribeProtection Text-dpProtectionId = lens _dpProtectionId (\ s a -> s{_dpProtectionId = a});+dpProtectionId = lens _dpProtectionId (\ s a -> s{_dpProtectionId = a}) instance AWSRequest DescribeProtection where type Rs DescribeProtection =@@ -121,15 +121,15 @@ -> DescribeProtectionResponse describeProtectionResponse pResponseStatus_ = DescribeProtectionResponse'- {_dprsProtection = Nothing, _dprsResponseStatus = pResponseStatus_}+ {_dprsProtection = Nothing, _dprsResponseStatus = pResponseStatus_} -- | The 'Protection' object that is described. dprsProtection :: Lens' DescribeProtectionResponse (Maybe Protection)-dprsProtection = lens _dprsProtection (\ s a -> s{_dprsProtection = a});+dprsProtection = lens _dprsProtection (\ s a -> s{_dprsProtection = a}) -- | -- | The response status code. dprsResponseStatus :: Lens' DescribeProtectionResponse Int-dprsResponseStatus = lens _dprsResponseStatus (\ s a -> s{_dprsResponseStatus = a});+dprsResponseStatus = lens _dprsResponseStatus (\ s a -> s{_dprsResponseStatus = a}) instance NFData DescribeProtectionResponse where
gen/Network/AWS/Shield/DescribeSubscription.hs view
@@ -12,7 +12,7 @@ -- | -- Module : Network.AWS.Shield.DescribeSubscription--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated@@ -107,15 +107,15 @@ -> DescribeSubscriptionResponse describeSubscriptionResponse pResponseStatus_ = DescribeSubscriptionResponse'- {_dsrsSubscription = Nothing, _dsrsResponseStatus = pResponseStatus_}+ {_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});+dsrsSubscription = lens _dsrsSubscription (\ s a -> s{_dsrsSubscription = a}) -- | -- | The response status code. dsrsResponseStatus :: Lens' DescribeSubscriptionResponse Int-dsrsResponseStatus = lens _dsrsResponseStatus (\ s a -> s{_dsrsResponseStatus = a});+dsrsResponseStatus = lens _dsrsResponseStatus (\ s a -> s{_dsrsResponseStatus = a}) instance NFData DescribeSubscriptionResponse where
+ gen/Network/AWS/Shield/GetSubscriptionState.hs view
@@ -0,0 +1,124 @@+{-# 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.GetSubscriptionState+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Returns the @SubscriptionState@ , either @Active@ or @Inactive@ .+--+--+module Network.AWS.Shield.GetSubscriptionState+ (+ -- * Creating a Request+ getSubscriptionState+ , GetSubscriptionState++ -- * Destructuring the Response+ , getSubscriptionStateResponse+ , GetSubscriptionStateResponse+ -- * Response Lenses+ , gssrsResponseStatus+ , gssrsSubscriptionState+ ) 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:/ 'getSubscriptionState' smart constructor.+data GetSubscriptionState =+ GetSubscriptionState'+ deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GetSubscriptionState' with the minimum fields required to make a request.+--+getSubscriptionState+ :: GetSubscriptionState+getSubscriptionState = GetSubscriptionState'+++instance AWSRequest GetSubscriptionState where+ type Rs GetSubscriptionState =+ GetSubscriptionStateResponse+ request = postJSON shield+ response+ = receiveJSON+ (\ s h x ->+ GetSubscriptionStateResponse' <$>+ (pure (fromEnum s)) <*> (x .:> "SubscriptionState"))++instance Hashable GetSubscriptionState where++instance NFData GetSubscriptionState where++instance ToHeaders GetSubscriptionState where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSShield_20160616.GetSubscriptionState" ::+ ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON GetSubscriptionState where+ toJSON = const (Object mempty)++instance ToPath GetSubscriptionState where+ toPath = const "/"++instance ToQuery GetSubscriptionState where+ toQuery = const mempty++-- | /See:/ 'getSubscriptionStateResponse' smart constructor.+data GetSubscriptionStateResponse = GetSubscriptionStateResponse'+ { _gssrsResponseStatus :: !Int+ , _gssrsSubscriptionState :: !SubscriptionState+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GetSubscriptionStateResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'gssrsResponseStatus' - -- | The response status code.+--+-- * 'gssrsSubscriptionState' - The status of the subscription.+getSubscriptionStateResponse+ :: Int -- ^ 'gssrsResponseStatus'+ -> SubscriptionState -- ^ 'gssrsSubscriptionState'+ -> GetSubscriptionStateResponse+getSubscriptionStateResponse pResponseStatus_ pSubscriptionState_ =+ GetSubscriptionStateResponse'+ { _gssrsResponseStatus = pResponseStatus_+ , _gssrsSubscriptionState = pSubscriptionState_+ }+++-- | -- | The response status code.+gssrsResponseStatus :: Lens' GetSubscriptionStateResponse Int+gssrsResponseStatus = lens _gssrsResponseStatus (\ s a -> s{_gssrsResponseStatus = a})++-- | The status of the subscription.+gssrsSubscriptionState :: Lens' GetSubscriptionStateResponse SubscriptionState+gssrsSubscriptionState = lens _gssrsSubscriptionState (\ s a -> s{_gssrsSubscriptionState = a})++instance NFData GetSubscriptionStateResponse where
gen/Network/AWS/Shield/ListAttacks.hs view
@@ -12,7 +12,7 @@ -- | -- Module : Network.AWS.Shield.ListAttacks--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated@@ -63,46 +63,46 @@ -- -- Use one of the following lenses to modify other fields as desired: ----- * 'laStartTime' - The time period for the attacks.+-- * 'laStartTime' - The start of the time period for the attacks. This is a @timestamp@ type. The sample request above indicates a @number@ type because the default used by WAF is Unix time in seconds. However any valid <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp format> is allowed. -- -- * '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.+-- * 'laEndTime' - The end of the time period for the attacks. This is a @timestamp@ type. The sample request above indicates a @number@ type because the default used by WAF is Unix time in seconds. However any valid <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp format> is allowed. -- -- * '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- }+ { _laStartTime = Nothing+ , _laResourceARNs = Nothing+ , _laNextToken = Nothing+ , _laEndTime = Nothing+ , _laMaxResults = Nothing+ } --- | The time period for the attacks.+-- | The start of the time period for the attacks. This is a @timestamp@ type. The sample request above indicates a @number@ type because the default used by WAF is Unix time in seconds. However any valid <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp format> is allowed. laStartTime :: Lens' ListAttacks (Maybe TimeRange)-laStartTime = lens _laStartTime (\ s a -> s{_laStartTime = a});+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;+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});+laNextToken = lens _laNextToken (\ s a -> s{_laNextToken = a}) --- | The end of the time period for the attacks.+-- | The end of the time period for the attacks. This is a @timestamp@ type. The sample request above indicates a @number@ type because the default used by WAF is Unix time in seconds. However any valid <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp format> is allowed. laEndTime :: Lens' ListAttacks (Maybe TimeRange)-laEndTime = lens _laEndTime (\ s a -> s{_laEndTime = a});+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;+laMaxResults = lens _laMaxResults (\ s a -> s{_laMaxResults = a}) . mapping _Nat instance AWSRequest ListAttacks where type Rs ListAttacks = ListAttacksResponse@@ -166,22 +166,22 @@ -> ListAttacksResponse listAttacksResponse pResponseStatus_ = ListAttacksResponse'- { _larsAttackSummaries = Nothing- , _larsNextToken = Nothing- , _larsResponseStatus = pResponseStatus_- }+ { _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;+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});+larsNextToken = lens _larsNextToken (\ s a -> s{_larsNextToken = a}) -- | -- | The response status code. larsResponseStatus :: Lens' ListAttacksResponse Int-larsResponseStatus = lens _larsResponseStatus (\ s a -> s{_larsResponseStatus = a});+larsResponseStatus = lens _larsResponseStatus (\ s a -> s{_larsResponseStatus = a}) instance NFData ListAttacksResponse where
gen/Network/AWS/Shield/ListProtections.hs view
@@ -12,7 +12,7 @@ -- | -- Module : Network.AWS.Shield.ListProtections--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated@@ -21,6 +21,8 @@ -- Lists all 'Protection' objects for the account. -- --+--+-- This operation returns paginated results. module Network.AWS.Shield.ListProtections ( -- * Creating a Request@@ -40,6 +42,7 @@ ) where import Network.AWS.Lens+import Network.AWS.Pager import Network.AWS.Prelude import Network.AWS.Request import Network.AWS.Response@@ -68,12 +71,19 @@ -- | 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});+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;+lpMaxResults = lens _lpMaxResults (\ s a -> s{_lpMaxResults = a}) . mapping _Nat +instance AWSPager ListProtections where+ page rq rs+ | stop (rs ^. lprsNextToken) = Nothing+ | stop (rs ^. lprsProtections) = Nothing+ | otherwise =+ Just $ rq & lpNextToken .~ rs ^. lprsNextToken+ instance AWSRequest ListProtections where type Rs ListProtections = ListProtectionsResponse request = postJSON shield@@ -133,22 +143,22 @@ -> ListProtectionsResponse listProtectionsResponse pResponseStatus_ = ListProtectionsResponse'- { _lprsProtections = Nothing- , _lprsNextToken = Nothing- , _lprsResponseStatus = pResponseStatus_- }+ { _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;+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});+lprsNextToken = lens _lprsNextToken (\ s a -> s{_lprsNextToken = a}) -- | -- | The response status code. lprsResponseStatus :: Lens' ListProtectionsResponse Int-lprsResponseStatus = lens _lprsResponseStatus (\ s a -> s{_lprsResponseStatus = a});+lprsResponseStatus = lens _lprsResponseStatus (\ s a -> s{_lprsResponseStatus = a}) instance NFData ListProtectionsResponse where
gen/Network/AWS/Shield/Types.hs view
@@ -4,7 +4,7 @@ -- | -- Module : Network.AWS.Shield.Types--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated@@ -26,9 +26,21 @@ , _LockedSubscriptionException , _ResourceNotFoundException + -- * AttackLayer+ , AttackLayer (..)++ -- * AttackPropertyIdentifier+ , AttackPropertyIdentifier (..)+ -- * SubResourceType , SubResourceType (..) + -- * SubscriptionState+ , SubscriptionState (..)++ -- * Unit+ , Unit (..)+ -- * AttackDetail , AttackDetail , attackDetail@@ -36,10 +48,20 @@ , adStartTime , adSubResources , adMitigations+ , adAttackProperties , adAttackCounters , adResourceARN , adEndTime + -- * AttackProperty+ , AttackProperty+ , attackProperty+ , apAttackLayer+ , apTopContributors+ , apAttackPropertyIdentifier+ , apTotal+ , apUnit+ -- * AttackSummary , AttackSummary , attackSummary@@ -54,6 +76,12 @@ , attackVectorDescription , avdVectorType + -- * Contributor+ , Contributor+ , contributor+ , cValue+ , cName+ -- * Mitigation , Mitigation , mitigation@@ -113,24 +141,24 @@ 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- }+ { _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- }+ { _retryBase = 5.0e-2+ , _retryGrowth = 2+ , _retryAttempts = 5+ , _retryCheck = check+ } check e | has (hasCode "ThrottledException" . hasStatus 400) e = Just "throttled_exception"@@ -139,6 +167,8 @@ Just "throttling_exception" | has (hasCode "Throttling" . hasStatus 400) e = Just "throttling" | has (hasStatus 504) e = Just "gateway_timeout"+ | has (hasCode "RequestThrottledException" . hasStatus 400) e =+ Just "request_throttled_exception" | has (hasStatus 502) e = Just "bad_gateway" | has (hasStatus 503) e = Just "service_unavailable" | has (hasStatus 500) e = Just "general_server_error"@@ -164,6 +194,10 @@ -- | Exception that indicates that the operation would exceed a limit. -- --+-- @Type@ is the type of limit that would be exceeded.+--+-- @Limit@ is the threshold that would be exceeded.+-- _LimitsExceededException :: AsError a => Getting (First ServiceError) a ServiceError _LimitsExceededException = _MatchServiceError shield "LimitsExceededException" @@ -198,7 +232,7 @@ _MatchServiceError shield "InvalidOperationException" --- | Exception that indicates that the subscription has been modified by another client. You can retry the request.+-- | Exception that indicates that the subscription you are trying to delete has not yet completed the 1-year commitment. You cannot delete this subscription. -- -- _LockedSubscriptionException :: AsError a => Getting (First ServiceError) a ServiceError
gen/Network/AWS/Shield/Types/Product.hs view
@@ -9,7 +9,7 @@ -- | -- Module : Network.AWS.Shield.Types.Product--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated@@ -27,13 +27,14 @@ -- -- /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)+ { _adAttackId :: !(Maybe Text)+ , _adStartTime :: !(Maybe POSIX)+ , _adSubResources :: !(Maybe [SubResourceSummary])+ , _adMitigations :: !(Maybe [Mitigation])+ , _adAttackProperties :: !(Maybe [AttackProperty])+ , _adAttackCounters :: !(Maybe [SummarizedCounter])+ , _adResourceARN :: !(Maybe Text)+ , _adEndTime :: !(Maybe POSIX) } deriving (Eq, Read, Show, Data, Typeable, Generic) @@ -43,58 +44,65 @@ -- -- * 'adAttackId' - The unique identifier (ID) of the attack. ----- * 'adStartTime' - The time the attack started, in the format 2016-12-16T13:50Z.+-- * 'adStartTime' - The time the attack started, in Unix time in seconds. For more information see <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp> . -- -- * '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. --+-- * 'adAttackProperties' - The array of 'AttackProperty' objects.+-- -- * '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.+-- * 'adEndTime' - The time the attack ended, in Unix time in seconds. For more information see <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp> . attackDetail :: AttackDetail attackDetail = AttackDetail'- { _adAttackId = Nothing- , _adStartTime = Nothing- , _adSubResources = Nothing- , _adMitigations = Nothing- , _adAttackCounters = Nothing- , _adResourceARN = Nothing- , _adEndTime = Nothing- }+ { _adAttackId = Nothing+ , _adStartTime = Nothing+ , _adSubResources = Nothing+ , _adMitigations = Nothing+ , _adAttackProperties = 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});+adAttackId = lens _adAttackId (\ s a -> s{_adAttackId = a}) --- | The time the attack started, in the format 2016-12-16T13:50Z.+-- | The time the attack started, in Unix time in seconds. For more information see <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp> . adStartTime :: Lens' AttackDetail (Maybe UTCTime)-adStartTime = lens _adStartTime (\ s a -> s{_adStartTime = a}) . mapping _Time;+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;+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;+adMitigations = lens _adMitigations (\ s a -> s{_adMitigations = a}) . _Default . _Coerce +-- | The array of 'AttackProperty' objects.+adAttackProperties :: Lens' AttackDetail [AttackProperty]+adAttackProperties = lens _adAttackProperties (\ s a -> s{_adAttackProperties = 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;+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});+adResourceARN = lens _adResourceARN (\ s a -> s{_adResourceARN = a}) --- | The time the attack ended, in the format 2016-12-16T13:50Z.+-- | The time the attack ended, in Unix time in seconds. For more information see <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp> . adEndTime :: Lens' AttackDetail (Maybe UTCTime)-adEndTime = lens _adEndTime (\ s a -> s{_adEndTime = a}) . mapping _Time;+adEndTime = lens _adEndTime (\ s a -> s{_adEndTime = a}) . mapping _Time instance FromJSON AttackDetail where parseJSON@@ -104,6 +112,7 @@ (x .:? "AttackId") <*> (x .:? "StartTime") <*> (x .:? "SubResources" .!= mempty) <*> (x .:? "Mitigations" .!= mempty)+ <*> (x .:? "AttackProperties" .!= mempty) <*> (x .:? "AttackCounters" .!= mempty) <*> (x .:? "ResourceArn") <*> (x .:? "EndTime"))@@ -112,6 +121,80 @@ instance NFData AttackDetail where +-- | Details of the described attack.+--+--+--+-- /See:/ 'attackProperty' smart constructor.+data AttackProperty = AttackProperty'+ { _apAttackLayer :: !(Maybe AttackLayer)+ , _apTopContributors :: !(Maybe [Contributor])+ , _apAttackPropertyIdentifier :: !(Maybe AttackPropertyIdentifier)+ , _apTotal :: !(Maybe Integer)+ , _apUnit :: !(Maybe Unit)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'AttackProperty' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'apAttackLayer' - The type of DDoS event that was observed. @NETWORK@ indicates layer 3 and layer 4 events and @APPLICATION@ indicates layer 7 events.+--+-- * 'apTopContributors' - The array of 'Contributor' objects that includes the top five contributors to an attack.+--+-- * 'apAttackPropertyIdentifier' - Defines the DDoS attack property information that is provided.+--+-- * 'apTotal' - The total contributions made to this attack by all contributors, not just the five listed in the @TopContributors@ list.+--+-- * 'apUnit' - The unit of the @Value@ of the contributions.+attackProperty+ :: AttackProperty+attackProperty =+ AttackProperty'+ { _apAttackLayer = Nothing+ , _apTopContributors = Nothing+ , _apAttackPropertyIdentifier = Nothing+ , _apTotal = Nothing+ , _apUnit = Nothing+ }+++-- | The type of DDoS event that was observed. @NETWORK@ indicates layer 3 and layer 4 events and @APPLICATION@ indicates layer 7 events.+apAttackLayer :: Lens' AttackProperty (Maybe AttackLayer)+apAttackLayer = lens _apAttackLayer (\ s a -> s{_apAttackLayer = a})++-- | The array of 'Contributor' objects that includes the top five contributors to an attack.+apTopContributors :: Lens' AttackProperty [Contributor]+apTopContributors = lens _apTopContributors (\ s a -> s{_apTopContributors = a}) . _Default . _Coerce++-- | Defines the DDoS attack property information that is provided.+apAttackPropertyIdentifier :: Lens' AttackProperty (Maybe AttackPropertyIdentifier)+apAttackPropertyIdentifier = lens _apAttackPropertyIdentifier (\ s a -> s{_apAttackPropertyIdentifier = a})++-- | The total contributions made to this attack by all contributors, not just the five listed in the @TopContributors@ list.+apTotal :: Lens' AttackProperty (Maybe Integer)+apTotal = lens _apTotal (\ s a -> s{_apTotal = a})++-- | The unit of the @Value@ of the contributions.+apUnit :: Lens' AttackProperty (Maybe Unit)+apUnit = lens _apUnit (\ s a -> s{_apUnit = a})++instance FromJSON AttackProperty where+ parseJSON+ = withObject "AttackProperty"+ (\ x ->+ AttackProperty' <$>+ (x .:? "AttackLayer") <*>+ (x .:? "TopContributors" .!= mempty)+ <*> (x .:? "AttackPropertyIdentifier")+ <*> (x .:? "Total")+ <*> (x .:? "Unit"))++instance Hashable AttackProperty where++instance NFData AttackProperty where+ -- | Summarizes all DDoS attacks for a specified time period. -- --@@ -134,42 +217,42 @@ -- -- * 'asAttackId' - The unique identifier (ID) of the attack. ----- * 'asStartTime' - The start time of the attack, in the format 2016-12-16T13:50Z.+-- * 'asStartTime' - The start time of the attack, in Unix time in seconds. For more information see <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp> . -- -- * '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.+-- * 'asEndTime' - The end time of the attack, in Unix time in seconds. For more information see <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp> . attackSummary :: AttackSummary attackSummary = AttackSummary'- { _asAttackVectors = Nothing- , _asAttackId = Nothing- , _asStartTime = Nothing- , _asResourceARN = Nothing- , _asEndTime = Nothing- }+ { _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;+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});+asAttackId = lens _asAttackId (\ s a -> s{_asAttackId = a}) --- | The start time of the attack, in the format 2016-12-16T13:50Z.+-- | The start time of the attack, in Unix time in seconds. For more information see <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp> . asStartTime :: Lens' AttackSummary (Maybe UTCTime)-asStartTime = lens _asStartTime (\ s a -> s{_asStartTime = a}) . mapping _Time;+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});+asResourceARN = lens _asResourceARN (\ s a -> s{_asResourceARN = a}) --- | The end time of the attack, in the format 2016-12-16T13:50Z.+-- | The end time of the attack, in Unix time in seconds. For more information see <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp> . asEndTime :: Lens' AttackSummary (Maybe UTCTime)-asEndTime = lens _asEndTime (\ s a -> s{_asEndTime = a}) . mapping _Time;+asEndTime = lens _asEndTime (\ s a -> s{_asEndTime = a}) . mapping _Time instance FromJSON AttackSummary where parseJSON@@ -200,7 +283,7 @@ -- -- Use one of the following lenses to modify other fields as desired: ----- * 'avdVectorType' - The attack type, for example, SNMP reflection or SYN flood.+-- * 'avdVectorType' - The attack type. Valid values: * UDP_TRAFFIC * UDP_FRAGMENT * GENERIC_UDP_REFLECTION * DNS_REFLECTION * NTP_REFLECTION * CHARGEN_REFLECTION * SSDP_REFLECTION * PORT_MAPPER * RIP_REFLECTION * SNMP_REFLECTION * MSSQL_REFLECTION * NET_BIOS_REFLECTION * SYN_FLOOD * ACK_FLOOD * REQUEST_FLOOD attackVectorDescription :: Text -- ^ 'avdVectorType' -> AttackVectorDescription@@ -208,9 +291,9 @@ AttackVectorDescription' {_avdVectorType = pVectorType_} --- | The attack type, for example, SNMP reflection or SYN flood.+-- | The attack type. Valid values: * UDP_TRAFFIC * UDP_FRAGMENT * GENERIC_UDP_REFLECTION * DNS_REFLECTION * NTP_REFLECTION * CHARGEN_REFLECTION * SSDP_REFLECTION * PORT_MAPPER * RIP_REFLECTION * SNMP_REFLECTION * MSSQL_REFLECTION * NET_BIOS_REFLECTION * SYN_FLOOD * ACK_FLOOD * REQUEST_FLOOD avdVectorType :: Lens' AttackVectorDescription Text-avdVectorType = lens _avdVectorType (\ s a -> s{_avdVectorType = a});+avdVectorType = lens _avdVectorType (\ s a -> s{_avdVectorType = a}) instance FromJSON AttackVectorDescription where parseJSON@@ -222,6 +305,47 @@ instance NFData AttackVectorDescription where +-- | A contributor to the attack and their contribution.+--+--+--+-- /See:/ 'contributor' smart constructor.+data Contributor = Contributor'+ { _cValue :: !(Maybe Integer)+ , _cName :: !(Maybe Text)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'Contributor' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'cValue' - The contribution of this contributor expressed in 'Protection' units. For example @10,000@ .+--+-- * 'cName' - The name of the contributor. This is dependent on the @AttackPropertyIdentifier@ . For example, if the @AttackPropertyIdentifier@ is @SOURCE_COUNTRY@ , the @Name@ could be @United States@ .+contributor+ :: Contributor+contributor = Contributor' {_cValue = Nothing, _cName = Nothing}+++-- | The contribution of this contributor expressed in 'Protection' units. For example @10,000@ .+cValue :: Lens' Contributor (Maybe Integer)+cValue = lens _cValue (\ s a -> s{_cValue = a})++-- | The name of the contributor. This is dependent on the @AttackPropertyIdentifier@ . For example, if the @AttackPropertyIdentifier@ is @SOURCE_COUNTRY@ , the @Name@ could be @United States@ .+cName :: Lens' Contributor (Maybe Text)+cName = lens _cName (\ s a -> s{_cName = a})++instance FromJSON Contributor where+ parseJSON+ = withObject "Contributor"+ (\ x ->+ Contributor' <$> (x .:? "Value") <*> (x .:? "Name"))++instance Hashable Contributor where++instance NFData Contributor where+ -- | The mitigation applied to a DDoS attack. -- --@@ -244,7 +368,7 @@ -- | The name of the mitigation taken for this attack. mMitigationName :: Lens' Mitigation (Maybe Text)-mMitigationName = lens _mMitigationName (\ s a -> s{_mMitigationName = a});+mMitigationName = lens _mMitigationName (\ s a -> s{_mMitigationName = a}) instance FromJSON Mitigation where parseJSON@@ -284,15 +408,15 @@ -- | 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});+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});+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});+pId = lens _pId (\ s a -> s{_pId = a}) instance FromJSON Protection where parseJSON@@ -334,28 +458,28 @@ :: SubResourceSummary subResourceSummary = SubResourceSummary'- { _srsCounters = Nothing- , _srsAttackVectors = Nothing- , _srsId = Nothing- , _srsType = Nothing- }+ { _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;+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;+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});+srsId = lens _srsId (\ s a -> s{_srsId = a}) -- | The @SubResource@ type. srsType :: Lens' SubResourceSummary (Maybe SubResourceType)-srsType = lens _srsType (\ s a -> s{_srsType = a});+srsType = lens _srsType (\ s a -> s{_srsType = a}) instance FromJSON SubResourceSummary where parseJSON@@ -388,7 +512,7 @@ -- -- * '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".+-- * 'sStartTime' - The start time of the subscription, in Unix time in seconds. For more information see <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp> . subscription :: Subscription subscription =@@ -397,11 +521,11 @@ -- | 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;+sTimeCommitmentInSeconds = lens _sTimeCommitmentInSeconds (\ s a -> s{_sTimeCommitmentInSeconds = a}) . mapping _Nat --- | The start time of the subscription, in the format "2016-12-16T13:50Z".+-- | The start time of the subscription, in Unix time in seconds. For more information see <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp> . sStartTime :: Lens' Subscription (Maybe UTCTime)-sStartTime = lens _sStartTime (\ s a -> s{_sStartTime = a}) . mapping _Time;+sStartTime = lens _sStartTime (\ s a -> s{_sStartTime = a}) . mapping _Time instance FromJSON Subscription where parseJSON@@ -438,16 +562,16 @@ -> SummarizedAttackVector summarizedAttackVector pVectorType_ = SummarizedAttackVector'- {_savVectorCounters = Nothing, _savVectorType = pVectorType_}+ {_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;+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});+savVectorType = lens _savVectorType (\ s a -> s{_savVectorType = a}) instance FromJSON SummarizedAttackVector where parseJSON@@ -495,38 +619,38 @@ :: SummarizedCounter summarizedCounter = SummarizedCounter'- { _scMax = Nothing- , _scAverage = Nothing- , _scN = Nothing- , _scName = Nothing- , _scSum = Nothing- , _scUnit = Nothing- }+ { _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});+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});+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});+scN = lens _scN (\ s a -> s{_scN = a}) -- | The counter name. scName :: Lens' SummarizedCounter (Maybe Text)-scName = lens _scName (\ s a -> s{_scName = a});+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});+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});+scUnit = lens _scUnit (\ s a -> s{_scUnit = a}) instance FromJSON SummarizedCounter where parseJSON@@ -557,21 +681,21 @@ -- -- Use one of the following lenses to modify other fields as desired: ----- * 'trFromInclusive' - The start time, in the format 2016-12-16T13:50Z.+-- * 'trFromInclusive' - The start time, in Unix time in seconds. For more information see <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp> . ----- * 'trToExclusive' - The end time, in the format 2016-12-16T15:50Z.+-- * 'trToExclusive' - The end time, in Unix time in seconds. For more information see <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp> . timeRange :: TimeRange timeRange = TimeRange' {_trFromInclusive = Nothing, _trToExclusive = Nothing} --- | The start time, in the format 2016-12-16T13:50Z.+-- | The start time, in Unix time in seconds. For more information see <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp> . trFromInclusive :: Lens' TimeRange (Maybe UTCTime)-trFromInclusive = lens _trFromInclusive (\ s a -> s{_trFromInclusive = a}) . mapping _Time;+trFromInclusive = lens _trFromInclusive (\ s a -> s{_trFromInclusive = a}) . mapping _Time --- | The end time, in the format 2016-12-16T15:50Z.+-- | The end time, in Unix time in seconds. For more information see <http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#parameter-types timestamp> . trToExclusive :: Lens' TimeRange (Maybe UTCTime)-trToExclusive = lens _trToExclusive (\ s a -> s{_trToExclusive = a}) . mapping _Time;+trToExclusive = lens _trToExclusive (\ s a -> s{_trToExclusive = a}) . mapping _Time instance Hashable TimeRange where
gen/Network/AWS/Shield/Types/Sum.hs view
@@ -9,7 +9,7 @@ -- | -- Module : Network.AWS.Shield.Types.Sum--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated@@ -19,6 +19,72 @@ import Network.AWS.Prelude +data AttackLayer+ = Application+ | Network+ deriving (Eq, Ord, Read, Show, Enum, Bounded, Data, Typeable, Generic)+++instance FromText AttackLayer where+ parser = takeLowerText >>= \case+ "application" -> pure Application+ "network" -> pure Network+ e -> fromTextError $ "Failure parsing AttackLayer from value: '" <> e+ <> "'. Accepted values: application, network"++instance ToText AttackLayer where+ toText = \case+ Application -> "APPLICATION"+ Network -> "NETWORK"++instance Hashable AttackLayer+instance NFData AttackLayer+instance ToByteString AttackLayer+instance ToQuery AttackLayer+instance ToHeader AttackLayer++instance FromJSON AttackLayer where+ parseJSON = parseJSONText "AttackLayer"++data AttackPropertyIdentifier+ = DestinationURL+ | Referrer+ | SourceASN+ | SourceCountry+ | SourceIPAddress+ | SourceUserAgent+ deriving (Eq, Ord, Read, Show, Enum, Bounded, Data, Typeable, Generic)+++instance FromText AttackPropertyIdentifier where+ parser = takeLowerText >>= \case+ "destination_url" -> pure DestinationURL+ "referrer" -> pure Referrer+ "source_asn" -> pure SourceASN+ "source_country" -> pure SourceCountry+ "source_ip_address" -> pure SourceIPAddress+ "source_user_agent" -> pure SourceUserAgent+ e -> fromTextError $ "Failure parsing AttackPropertyIdentifier from value: '" <> e+ <> "'. Accepted values: destination_url, referrer, source_asn, source_country, source_ip_address, source_user_agent"++instance ToText AttackPropertyIdentifier where+ toText = \case+ DestinationURL -> "DESTINATION_URL"+ Referrer -> "REFERRER"+ SourceASN -> "SOURCE_ASN"+ SourceCountry -> "SOURCE_COUNTRY"+ SourceIPAddress -> "SOURCE_IP_ADDRESS"+ SourceUserAgent -> "SOURCE_USER_AGENT"++instance Hashable AttackPropertyIdentifier+instance NFData AttackPropertyIdentifier+instance ToByteString AttackPropertyIdentifier+instance ToQuery AttackPropertyIdentifier+instance ToHeader AttackPropertyIdentifier++instance FromJSON AttackPropertyIdentifier where+ parseJSON = parseJSONText "AttackPropertyIdentifier"+ data SubResourceType = IP | URL@@ -45,3 +111,63 @@ instance FromJSON SubResourceType where parseJSON = parseJSONText "SubResourceType"++data SubscriptionState+ = Active+ | Inactive+ deriving (Eq, Ord, Read, Show, Enum, Bounded, Data, Typeable, Generic)+++instance FromText SubscriptionState where+ parser = takeLowerText >>= \case+ "active" -> pure Active+ "inactive" -> pure Inactive+ e -> fromTextError $ "Failure parsing SubscriptionState from value: '" <> e+ <> "'. Accepted values: active, inactive"++instance ToText SubscriptionState where+ toText = \case+ Active -> "ACTIVE"+ Inactive -> "INACTIVE"++instance Hashable SubscriptionState+instance NFData SubscriptionState+instance ToByteString SubscriptionState+instance ToQuery SubscriptionState+instance ToHeader SubscriptionState++instance FromJSON SubscriptionState where+ parseJSON = parseJSONText "SubscriptionState"++data Unit+ = Bits+ | Bytes+ | Packets+ | Requests+ deriving (Eq, Ord, Read, Show, Enum, Bounded, Data, Typeable, Generic)+++instance FromText Unit where+ parser = takeLowerText >>= \case+ "bits" -> pure Bits+ "bytes" -> pure Bytes+ "packets" -> pure Packets+ "requests" -> pure Requests+ e -> fromTextError $ "Failure parsing Unit from value: '" <> e+ <> "'. Accepted values: bits, bytes, packets, requests"++instance ToText Unit where+ toText = \case+ Bits -> "BITS"+ Bytes -> "BYTES"+ Packets -> "PACKETS"+ Requests -> "REQUESTS"++instance Hashable Unit+instance NFData Unit+instance ToByteString Unit+instance ToQuery Unit+instance ToHeader Unit++instance FromJSON Unit where+ parseJSON = parseJSONText "Unit"
gen/Network/AWS/Shield/Waiters.hs view
@@ -7,7 +7,7 @@ -- | -- Module : Network.AWS.Shield.Waiters--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated
test/Main.hs view
@@ -2,7 +2,7 @@ -- | -- Module : Main--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated
test/Test/AWS/Gen/Shield.hs view
@@ -5,7 +5,7 @@ -- | -- Module : Test.AWS.Gen.Shield--- Copyright : (c) 2013-2017 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com> -- Stability : auto-generated@@ -52,6 +52,9 @@ -- , requestDeleteProtection $ -- deleteProtection --+-- , requestGetSubscriptionState $+-- getSubscriptionState+-- -- , requestDescribeSubscription $ -- describeSubscription --@@ -82,6 +85,9 @@ -- , responseDeleteProtection $ -- deleteProtectionResponse --+-- , responseGetSubscriptionState $+-- getSubscriptionStateResponse+-- -- , responseDescribeSubscription $ -- describeSubscriptionResponse --@@ -130,6 +136,11 @@ "DeleteProtection" "fixture/DeleteProtection.yaml" +requestGetSubscriptionState :: GetSubscriptionState -> TestTree+requestGetSubscriptionState = req+ "GetSubscriptionState"+ "fixture/GetSubscriptionState.yaml"+ requestDescribeSubscription :: DescribeSubscription -> TestTree requestDescribeSubscription = req "DescribeSubscription"@@ -192,6 +203,13 @@ "fixture/DeleteProtectionResponse.proto" shield (Proxy :: Proxy DeleteProtection)++responseGetSubscriptionState :: GetSubscriptionStateResponse -> TestTree+responseGetSubscriptionState = res+ "GetSubscriptionStateResponse"+ "fixture/GetSubscriptionStateResponse.proto"+ shield+ (Proxy :: Proxy GetSubscriptionState) responseDescribeSubscription :: DescribeSubscriptionResponse -> TestTree responseDescribeSubscription = res
test/Test/AWS/Shield.hs view
@@ -1,6 +1,6 @@ -- | -- Module : Test.AWS.Shield--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated
test/Test/AWS/Shield/Internal.hs view
@@ -1,6 +1,6 @@ -- | -- Module : Test.AWS.Shield.Internal--- Copyright : (c) 2013-2016 Brendan Hay+-- Copyright : (c) 2013-2018 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated