{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.WAFV2.GetRateBasedStatementManagedKeys
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves the keys that are currently blocked by a rate-based rule
-- instance. The maximum number of managed keys that can be blocked for a
-- single rate-based rule instance is 10,000. If more than 10,000 addresses
-- exceed the rate limit, those with the highest rates are blocked.
--
-- For a rate-based rule that you\'ve defined inside a rule group, provide
-- the name of the rule group reference statement in your request, in
-- addition to the rate-based rule name and the web ACL name.
--
-- WAF monitors web requests and manages keys independently for each unique
-- combination of web ACL, optional rule group, and rate-based rule. For
-- example, if you define a rate-based rule inside a rule group, and then
-- use the rule group in a web ACL, WAF monitors web requests and manages
-- keys for that web ACL, rule group reference statement, and rate-based
-- rule instance. If you use the same rule group in a second web ACL, WAF
-- monitors web requests and manages keys for this second usage completely
-- independent of your first.
module Amazonka.WAFV2.GetRateBasedStatementManagedKeys
  ( -- * Creating a Request
    GetRateBasedStatementManagedKeys (..),
    newGetRateBasedStatementManagedKeys,

    -- * Request Lenses
    getRateBasedStatementManagedKeys_ruleGroupRuleName,
    getRateBasedStatementManagedKeys_scope,
    getRateBasedStatementManagedKeys_webACLName,
    getRateBasedStatementManagedKeys_webACLId,
    getRateBasedStatementManagedKeys_ruleName,

    -- * Destructuring the Response
    GetRateBasedStatementManagedKeysResponse (..),
    newGetRateBasedStatementManagedKeysResponse,

    -- * Response Lenses
    getRateBasedStatementManagedKeysResponse_managedKeysIPV4,
    getRateBasedStatementManagedKeysResponse_managedKeysIPV6,
    getRateBasedStatementManagedKeysResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WAFV2.Types

-- | /See:/ 'newGetRateBasedStatementManagedKeys' smart constructor.
data GetRateBasedStatementManagedKeys = GetRateBasedStatementManagedKeys'
  { -- | The name of the rule group reference statement in your web ACL. This is
    -- required only when you have the rate-based rule nested inside a rule
    -- group.
    GetRateBasedStatementManagedKeys -> Maybe Text
ruleGroupRuleName :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether this is for an Amazon CloudFront distribution or for a
    -- regional application. A regional application can be an Application Load
    -- Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API,
    -- or an Amazon Cognito user pool.
    --
    -- To work with CloudFront, you must also specify the Region US East (N.
    -- Virginia) as follows:
    --
    -- -   CLI - Specify the Region when you use the CloudFront scope:
    --     @--scope=CLOUDFRONT --region=us-east-1@.
    --
    -- -   API and SDKs - For all calls, use the Region endpoint us-east-1.
    GetRateBasedStatementManagedKeys -> Scope
scope :: Scope,
    -- | The name of the web ACL. You cannot change the name of a web ACL after
    -- you create it.
    GetRateBasedStatementManagedKeys -> Text
webACLName :: Prelude.Text,
    -- | The unique identifier for the web ACL. This ID is returned in the
    -- responses to create and list commands. You provide it to operations like
    -- update and delete.
    GetRateBasedStatementManagedKeys -> Text
webACLId :: Prelude.Text,
    -- | The name of the rate-based rule to get the keys for. If you have the
    -- rule defined inside a rule group that you\'re using in your web ACL,
    -- also provide the name of the rule group reference statement in the
    -- request parameter @RuleGroupRuleName@.
    GetRateBasedStatementManagedKeys -> Text
ruleName :: Prelude.Text
  }
  deriving (GetRateBasedStatementManagedKeys
-> GetRateBasedStatementManagedKeys -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRateBasedStatementManagedKeys
-> GetRateBasedStatementManagedKeys -> Bool
$c/= :: GetRateBasedStatementManagedKeys
-> GetRateBasedStatementManagedKeys -> Bool
== :: GetRateBasedStatementManagedKeys
-> GetRateBasedStatementManagedKeys -> Bool
$c== :: GetRateBasedStatementManagedKeys
-> GetRateBasedStatementManagedKeys -> Bool
Prelude.Eq, ReadPrec [GetRateBasedStatementManagedKeys]
ReadPrec GetRateBasedStatementManagedKeys
Int -> ReadS GetRateBasedStatementManagedKeys
ReadS [GetRateBasedStatementManagedKeys]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRateBasedStatementManagedKeys]
$creadListPrec :: ReadPrec [GetRateBasedStatementManagedKeys]
readPrec :: ReadPrec GetRateBasedStatementManagedKeys
$creadPrec :: ReadPrec GetRateBasedStatementManagedKeys
readList :: ReadS [GetRateBasedStatementManagedKeys]
$creadList :: ReadS [GetRateBasedStatementManagedKeys]
readsPrec :: Int -> ReadS GetRateBasedStatementManagedKeys
$creadsPrec :: Int -> ReadS GetRateBasedStatementManagedKeys
Prelude.Read, Int -> GetRateBasedStatementManagedKeys -> ShowS
[GetRateBasedStatementManagedKeys] -> ShowS
GetRateBasedStatementManagedKeys -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRateBasedStatementManagedKeys] -> ShowS
$cshowList :: [GetRateBasedStatementManagedKeys] -> ShowS
show :: GetRateBasedStatementManagedKeys -> String
$cshow :: GetRateBasedStatementManagedKeys -> String
showsPrec :: Int -> GetRateBasedStatementManagedKeys -> ShowS
$cshowsPrec :: Int -> GetRateBasedStatementManagedKeys -> ShowS
Prelude.Show, forall x.
Rep GetRateBasedStatementManagedKeys x
-> GetRateBasedStatementManagedKeys
forall x.
GetRateBasedStatementManagedKeys
-> Rep GetRateBasedStatementManagedKeys x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRateBasedStatementManagedKeys x
-> GetRateBasedStatementManagedKeys
$cfrom :: forall x.
GetRateBasedStatementManagedKeys
-> Rep GetRateBasedStatementManagedKeys x
Prelude.Generic)

-- |
-- Create a value of 'GetRateBasedStatementManagedKeys' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'ruleGroupRuleName', 'getRateBasedStatementManagedKeys_ruleGroupRuleName' - The name of the rule group reference statement in your web ACL. This is
-- required only when you have the rate-based rule nested inside a rule
-- group.
--
-- 'scope', 'getRateBasedStatementManagedKeys_scope' - Specifies whether this is for an Amazon CloudFront distribution or for a
-- regional application. A regional application can be an Application Load
-- Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API,
-- or an Amazon Cognito user pool.
--
-- To work with CloudFront, you must also specify the Region US East (N.
-- Virginia) as follows:
--
-- -   CLI - Specify the Region when you use the CloudFront scope:
--     @--scope=CLOUDFRONT --region=us-east-1@.
--
-- -   API and SDKs - For all calls, use the Region endpoint us-east-1.
--
-- 'webACLName', 'getRateBasedStatementManagedKeys_webACLName' - The name of the web ACL. You cannot change the name of a web ACL after
-- you create it.
--
-- 'webACLId', 'getRateBasedStatementManagedKeys_webACLId' - The unique identifier for the web ACL. This ID is returned in the
-- responses to create and list commands. You provide it to operations like
-- update and delete.
--
-- 'ruleName', 'getRateBasedStatementManagedKeys_ruleName' - The name of the rate-based rule to get the keys for. If you have the
-- rule defined inside a rule group that you\'re using in your web ACL,
-- also provide the name of the rule group reference statement in the
-- request parameter @RuleGroupRuleName@.
newGetRateBasedStatementManagedKeys ::
  -- | 'scope'
  Scope ->
  -- | 'webACLName'
  Prelude.Text ->
  -- | 'webACLId'
  Prelude.Text ->
  -- | 'ruleName'
  Prelude.Text ->
  GetRateBasedStatementManagedKeys
newGetRateBasedStatementManagedKeys :: Scope -> Text -> Text -> Text -> GetRateBasedStatementManagedKeys
newGetRateBasedStatementManagedKeys
  Scope
pScope_
  Text
pWebACLName_
  Text
pWebACLId_
  Text
pRuleName_ =
    GetRateBasedStatementManagedKeys'
      { $sel:ruleGroupRuleName:GetRateBasedStatementManagedKeys' :: Maybe Text
ruleGroupRuleName =
          forall a. Maybe a
Prelude.Nothing,
        $sel:scope:GetRateBasedStatementManagedKeys' :: Scope
scope = Scope
pScope_,
        $sel:webACLName:GetRateBasedStatementManagedKeys' :: Text
webACLName = Text
pWebACLName_,
        $sel:webACLId:GetRateBasedStatementManagedKeys' :: Text
webACLId = Text
pWebACLId_,
        $sel:ruleName:GetRateBasedStatementManagedKeys' :: Text
ruleName = Text
pRuleName_
      }

-- | The name of the rule group reference statement in your web ACL. This is
-- required only when you have the rate-based rule nested inside a rule
-- group.
getRateBasedStatementManagedKeys_ruleGroupRuleName :: Lens.Lens' GetRateBasedStatementManagedKeys (Prelude.Maybe Prelude.Text)
getRateBasedStatementManagedKeys_ruleGroupRuleName :: Lens' GetRateBasedStatementManagedKeys (Maybe Text)
getRateBasedStatementManagedKeys_ruleGroupRuleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRateBasedStatementManagedKeys' {Maybe Text
ruleGroupRuleName :: Maybe Text
$sel:ruleGroupRuleName:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Maybe Text
ruleGroupRuleName} -> Maybe Text
ruleGroupRuleName) (\s :: GetRateBasedStatementManagedKeys
s@GetRateBasedStatementManagedKeys' {} Maybe Text
a -> GetRateBasedStatementManagedKeys
s {$sel:ruleGroupRuleName:GetRateBasedStatementManagedKeys' :: Maybe Text
ruleGroupRuleName = Maybe Text
a} :: GetRateBasedStatementManagedKeys)

-- | Specifies whether this is for an Amazon CloudFront distribution or for a
-- regional application. A regional application can be an Application Load
-- Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API,
-- or an Amazon Cognito user pool.
--
-- To work with CloudFront, you must also specify the Region US East (N.
-- Virginia) as follows:
--
-- -   CLI - Specify the Region when you use the CloudFront scope:
--     @--scope=CLOUDFRONT --region=us-east-1@.
--
-- -   API and SDKs - For all calls, use the Region endpoint us-east-1.
getRateBasedStatementManagedKeys_scope :: Lens.Lens' GetRateBasedStatementManagedKeys Scope
getRateBasedStatementManagedKeys_scope :: Lens' GetRateBasedStatementManagedKeys Scope
getRateBasedStatementManagedKeys_scope = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRateBasedStatementManagedKeys' {Scope
scope :: Scope
$sel:scope:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Scope
scope} -> Scope
scope) (\s :: GetRateBasedStatementManagedKeys
s@GetRateBasedStatementManagedKeys' {} Scope
a -> GetRateBasedStatementManagedKeys
s {$sel:scope:GetRateBasedStatementManagedKeys' :: Scope
scope = Scope
a} :: GetRateBasedStatementManagedKeys)

-- | The name of the web ACL. You cannot change the name of a web ACL after
-- you create it.
getRateBasedStatementManagedKeys_webACLName :: Lens.Lens' GetRateBasedStatementManagedKeys Prelude.Text
getRateBasedStatementManagedKeys_webACLName :: Lens' GetRateBasedStatementManagedKeys Text
getRateBasedStatementManagedKeys_webACLName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRateBasedStatementManagedKeys' {Text
webACLName :: Text
$sel:webACLName:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Text
webACLName} -> Text
webACLName) (\s :: GetRateBasedStatementManagedKeys
s@GetRateBasedStatementManagedKeys' {} Text
a -> GetRateBasedStatementManagedKeys
s {$sel:webACLName:GetRateBasedStatementManagedKeys' :: Text
webACLName = Text
a} :: GetRateBasedStatementManagedKeys)

-- | The unique identifier for the web ACL. This ID is returned in the
-- responses to create and list commands. You provide it to operations like
-- update and delete.
getRateBasedStatementManagedKeys_webACLId :: Lens.Lens' GetRateBasedStatementManagedKeys Prelude.Text
getRateBasedStatementManagedKeys_webACLId :: Lens' GetRateBasedStatementManagedKeys Text
getRateBasedStatementManagedKeys_webACLId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRateBasedStatementManagedKeys' {Text
webACLId :: Text
$sel:webACLId:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Text
webACLId} -> Text
webACLId) (\s :: GetRateBasedStatementManagedKeys
s@GetRateBasedStatementManagedKeys' {} Text
a -> GetRateBasedStatementManagedKeys
s {$sel:webACLId:GetRateBasedStatementManagedKeys' :: Text
webACLId = Text
a} :: GetRateBasedStatementManagedKeys)

-- | The name of the rate-based rule to get the keys for. If you have the
-- rule defined inside a rule group that you\'re using in your web ACL,
-- also provide the name of the rule group reference statement in the
-- request parameter @RuleGroupRuleName@.
getRateBasedStatementManagedKeys_ruleName :: Lens.Lens' GetRateBasedStatementManagedKeys Prelude.Text
getRateBasedStatementManagedKeys_ruleName :: Lens' GetRateBasedStatementManagedKeys Text
getRateBasedStatementManagedKeys_ruleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRateBasedStatementManagedKeys' {Text
ruleName :: Text
$sel:ruleName:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Text
ruleName} -> Text
ruleName) (\s :: GetRateBasedStatementManagedKeys
s@GetRateBasedStatementManagedKeys' {} Text
a -> GetRateBasedStatementManagedKeys
s {$sel:ruleName:GetRateBasedStatementManagedKeys' :: Text
ruleName = Text
a} :: GetRateBasedStatementManagedKeys)

instance
  Core.AWSRequest
    GetRateBasedStatementManagedKeys
  where
  type
    AWSResponse GetRateBasedStatementManagedKeys =
      GetRateBasedStatementManagedKeysResponse
  request :: (Service -> Service)
-> GetRateBasedStatementManagedKeys
-> Request GetRateBasedStatementManagedKeys
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetRateBasedStatementManagedKeys
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetRateBasedStatementManagedKeys)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe RateBasedStatementManagedKeysIPSet
-> Maybe RateBasedStatementManagedKeysIPSet
-> Int
-> GetRateBasedStatementManagedKeysResponse
GetRateBasedStatementManagedKeysResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ManagedKeysIPV4")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ManagedKeysIPV6")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    GetRateBasedStatementManagedKeys
  where
  hashWithSalt :: Int -> GetRateBasedStatementManagedKeys -> Int
hashWithSalt
    Int
_salt
    GetRateBasedStatementManagedKeys' {Maybe Text
Text
Scope
ruleName :: Text
webACLId :: Text
webACLName :: Text
scope :: Scope
ruleGroupRuleName :: Maybe Text
$sel:ruleName:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Text
$sel:webACLId:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Text
$sel:webACLName:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Text
$sel:scope:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Scope
$sel:ruleGroupRuleName:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ruleGroupRuleName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Scope
scope
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
webACLName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
webACLId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleName

instance
  Prelude.NFData
    GetRateBasedStatementManagedKeys
  where
  rnf :: GetRateBasedStatementManagedKeys -> ()
rnf GetRateBasedStatementManagedKeys' {Maybe Text
Text
Scope
ruleName :: Text
webACLId :: Text
webACLName :: Text
scope :: Scope
ruleGroupRuleName :: Maybe Text
$sel:ruleName:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Text
$sel:webACLId:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Text
$sel:webACLName:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Text
$sel:scope:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Scope
$sel:ruleGroupRuleName:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ruleGroupRuleName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Scope
scope
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
webACLName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
webACLId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ruleName

instance
  Data.ToHeaders
    GetRateBasedStatementManagedKeys
  where
  toHeaders :: GetRateBasedStatementManagedKeys -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSWAF_20190729.GetRateBasedStatementManagedKeys" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON GetRateBasedStatementManagedKeys where
  toJSON :: GetRateBasedStatementManagedKeys -> Value
toJSON GetRateBasedStatementManagedKeys' {Maybe Text
Text
Scope
ruleName :: Text
webACLId :: Text
webACLName :: Text
scope :: Scope
ruleGroupRuleName :: Maybe Text
$sel:ruleName:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Text
$sel:webACLId:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Text
$sel:webACLName:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Text
$sel:scope:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Scope
$sel:ruleGroupRuleName:GetRateBasedStatementManagedKeys' :: GetRateBasedStatementManagedKeys -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"RuleGroupRuleName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
ruleGroupRuleName,
            forall a. a -> Maybe a
Prelude.Just (Key
"Scope" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Scope
scope),
            forall a. a -> Maybe a
Prelude.Just (Key
"WebACLName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
webACLName),
            forall a. a -> Maybe a
Prelude.Just (Key
"WebACLId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
webACLId),
            forall a. a -> Maybe a
Prelude.Just (Key
"RuleName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
ruleName)
          ]
      )

instance Data.ToPath GetRateBasedStatementManagedKeys where
  toPath :: GetRateBasedStatementManagedKeys -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance
  Data.ToQuery
    GetRateBasedStatementManagedKeys
  where
  toQuery :: GetRateBasedStatementManagedKeys -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetRateBasedStatementManagedKeysResponse' smart constructor.
data GetRateBasedStatementManagedKeysResponse = GetRateBasedStatementManagedKeysResponse'
  { -- | The keys that are of Internet Protocol version 4 (IPv4).
    GetRateBasedStatementManagedKeysResponse
-> Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV4 :: Prelude.Maybe RateBasedStatementManagedKeysIPSet,
    -- | The keys that are of Internet Protocol version 6 (IPv6).
    GetRateBasedStatementManagedKeysResponse
-> Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV6 :: Prelude.Maybe RateBasedStatementManagedKeysIPSet,
    -- | The response's http status code.
    GetRateBasedStatementManagedKeysResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetRateBasedStatementManagedKeysResponse
-> GetRateBasedStatementManagedKeysResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRateBasedStatementManagedKeysResponse
-> GetRateBasedStatementManagedKeysResponse -> Bool
$c/= :: GetRateBasedStatementManagedKeysResponse
-> GetRateBasedStatementManagedKeysResponse -> Bool
== :: GetRateBasedStatementManagedKeysResponse
-> GetRateBasedStatementManagedKeysResponse -> Bool
$c== :: GetRateBasedStatementManagedKeysResponse
-> GetRateBasedStatementManagedKeysResponse -> Bool
Prelude.Eq, ReadPrec [GetRateBasedStatementManagedKeysResponse]
ReadPrec GetRateBasedStatementManagedKeysResponse
Int -> ReadS GetRateBasedStatementManagedKeysResponse
ReadS [GetRateBasedStatementManagedKeysResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRateBasedStatementManagedKeysResponse]
$creadListPrec :: ReadPrec [GetRateBasedStatementManagedKeysResponse]
readPrec :: ReadPrec GetRateBasedStatementManagedKeysResponse
$creadPrec :: ReadPrec GetRateBasedStatementManagedKeysResponse
readList :: ReadS [GetRateBasedStatementManagedKeysResponse]
$creadList :: ReadS [GetRateBasedStatementManagedKeysResponse]
readsPrec :: Int -> ReadS GetRateBasedStatementManagedKeysResponse
$creadsPrec :: Int -> ReadS GetRateBasedStatementManagedKeysResponse
Prelude.Read, Int -> GetRateBasedStatementManagedKeysResponse -> ShowS
[GetRateBasedStatementManagedKeysResponse] -> ShowS
GetRateBasedStatementManagedKeysResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRateBasedStatementManagedKeysResponse] -> ShowS
$cshowList :: [GetRateBasedStatementManagedKeysResponse] -> ShowS
show :: GetRateBasedStatementManagedKeysResponse -> String
$cshow :: GetRateBasedStatementManagedKeysResponse -> String
showsPrec :: Int -> GetRateBasedStatementManagedKeysResponse -> ShowS
$cshowsPrec :: Int -> GetRateBasedStatementManagedKeysResponse -> ShowS
Prelude.Show, forall x.
Rep GetRateBasedStatementManagedKeysResponse x
-> GetRateBasedStatementManagedKeysResponse
forall x.
GetRateBasedStatementManagedKeysResponse
-> Rep GetRateBasedStatementManagedKeysResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRateBasedStatementManagedKeysResponse x
-> GetRateBasedStatementManagedKeysResponse
$cfrom :: forall x.
GetRateBasedStatementManagedKeysResponse
-> Rep GetRateBasedStatementManagedKeysResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetRateBasedStatementManagedKeysResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'managedKeysIPV4', 'getRateBasedStatementManagedKeysResponse_managedKeysIPV4' - The keys that are of Internet Protocol version 4 (IPv4).
--
-- 'managedKeysIPV6', 'getRateBasedStatementManagedKeysResponse_managedKeysIPV6' - The keys that are of Internet Protocol version 6 (IPv6).
--
-- 'httpStatus', 'getRateBasedStatementManagedKeysResponse_httpStatus' - The response's http status code.
newGetRateBasedStatementManagedKeysResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRateBasedStatementManagedKeysResponse
newGetRateBasedStatementManagedKeysResponse :: Int -> GetRateBasedStatementManagedKeysResponse
newGetRateBasedStatementManagedKeysResponse
  Int
pHttpStatus_ =
    GetRateBasedStatementManagedKeysResponse'
      { $sel:managedKeysIPV4:GetRateBasedStatementManagedKeysResponse' :: Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV4 =
          forall a. Maybe a
Prelude.Nothing,
        $sel:managedKeysIPV6:GetRateBasedStatementManagedKeysResponse' :: Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV6 = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetRateBasedStatementManagedKeysResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The keys that are of Internet Protocol version 4 (IPv4).
getRateBasedStatementManagedKeysResponse_managedKeysIPV4 :: Lens.Lens' GetRateBasedStatementManagedKeysResponse (Prelude.Maybe RateBasedStatementManagedKeysIPSet)
getRateBasedStatementManagedKeysResponse_managedKeysIPV4 :: Lens'
  GetRateBasedStatementManagedKeysResponse
  (Maybe RateBasedStatementManagedKeysIPSet)
getRateBasedStatementManagedKeysResponse_managedKeysIPV4 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRateBasedStatementManagedKeysResponse' {Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV4 :: Maybe RateBasedStatementManagedKeysIPSet
$sel:managedKeysIPV4:GetRateBasedStatementManagedKeysResponse' :: GetRateBasedStatementManagedKeysResponse
-> Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV4} -> Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV4) (\s :: GetRateBasedStatementManagedKeysResponse
s@GetRateBasedStatementManagedKeysResponse' {} Maybe RateBasedStatementManagedKeysIPSet
a -> GetRateBasedStatementManagedKeysResponse
s {$sel:managedKeysIPV4:GetRateBasedStatementManagedKeysResponse' :: Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV4 = Maybe RateBasedStatementManagedKeysIPSet
a} :: GetRateBasedStatementManagedKeysResponse)

-- | The keys that are of Internet Protocol version 6 (IPv6).
getRateBasedStatementManagedKeysResponse_managedKeysIPV6 :: Lens.Lens' GetRateBasedStatementManagedKeysResponse (Prelude.Maybe RateBasedStatementManagedKeysIPSet)
getRateBasedStatementManagedKeysResponse_managedKeysIPV6 :: Lens'
  GetRateBasedStatementManagedKeysResponse
  (Maybe RateBasedStatementManagedKeysIPSet)
getRateBasedStatementManagedKeysResponse_managedKeysIPV6 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRateBasedStatementManagedKeysResponse' {Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV6 :: Maybe RateBasedStatementManagedKeysIPSet
$sel:managedKeysIPV6:GetRateBasedStatementManagedKeysResponse' :: GetRateBasedStatementManagedKeysResponse
-> Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV6} -> Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV6) (\s :: GetRateBasedStatementManagedKeysResponse
s@GetRateBasedStatementManagedKeysResponse' {} Maybe RateBasedStatementManagedKeysIPSet
a -> GetRateBasedStatementManagedKeysResponse
s {$sel:managedKeysIPV6:GetRateBasedStatementManagedKeysResponse' :: Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV6 = Maybe RateBasedStatementManagedKeysIPSet
a} :: GetRateBasedStatementManagedKeysResponse)

-- | The response's http status code.
getRateBasedStatementManagedKeysResponse_httpStatus :: Lens.Lens' GetRateBasedStatementManagedKeysResponse Prelude.Int
getRateBasedStatementManagedKeysResponse_httpStatus :: Lens' GetRateBasedStatementManagedKeysResponse Int
getRateBasedStatementManagedKeysResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRateBasedStatementManagedKeysResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetRateBasedStatementManagedKeysResponse' :: GetRateBasedStatementManagedKeysResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetRateBasedStatementManagedKeysResponse
s@GetRateBasedStatementManagedKeysResponse' {} Int
a -> GetRateBasedStatementManagedKeysResponse
s {$sel:httpStatus:GetRateBasedStatementManagedKeysResponse' :: Int
httpStatus = Int
a} :: GetRateBasedStatementManagedKeysResponse)

instance
  Prelude.NFData
    GetRateBasedStatementManagedKeysResponse
  where
  rnf :: GetRateBasedStatementManagedKeysResponse -> ()
rnf GetRateBasedStatementManagedKeysResponse' {Int
Maybe RateBasedStatementManagedKeysIPSet
httpStatus :: Int
managedKeysIPV6 :: Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV4 :: Maybe RateBasedStatementManagedKeysIPSet
$sel:httpStatus:GetRateBasedStatementManagedKeysResponse' :: GetRateBasedStatementManagedKeysResponse -> Int
$sel:managedKeysIPV6:GetRateBasedStatementManagedKeysResponse' :: GetRateBasedStatementManagedKeysResponse
-> Maybe RateBasedStatementManagedKeysIPSet
$sel:managedKeysIPV4:GetRateBasedStatementManagedKeysResponse' :: GetRateBasedStatementManagedKeysResponse
-> Maybe RateBasedStatementManagedKeysIPSet
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV4
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RateBasedStatementManagedKeysIPSet
managedKeysIPV6
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus