{-# 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.WAF.GetRateBasedRuleManagedKeys
-- Copyright   : (c) 2013-2021 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)
--
-- This is __AWS WAF Classic__ documentation. For more information, see
-- <https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html AWS WAF Classic>
-- in the developer guide.
--
-- __For the latest version of AWS WAF__, use the AWS WAFV2 API and see the
-- <https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html AWS WAF Developer Guide>.
-- With the latest version, AWS WAF has a single set of endpoints for
-- regional and global use.
--
-- Returns an array of IP addresses currently being blocked by the
-- RateBasedRule that is specified by the @RuleId@. The maximum number of
-- managed keys that will be blocked is 10,000. If more than 10,000
-- addresses exceed the rate limit, the 10,000 addresses with the highest
-- rates will be blocked.
--
-- This operation returns paginated results.
module Amazonka.WAF.GetRateBasedRuleManagedKeys
  ( -- * Creating a Request
    GetRateBasedRuleManagedKeys (..),
    newGetRateBasedRuleManagedKeys,

    -- * Request Lenses
    getRateBasedRuleManagedKeys_nextMarker,
    getRateBasedRuleManagedKeys_ruleId,

    -- * Destructuring the Response
    GetRateBasedRuleManagedKeysResponse (..),
    newGetRateBasedRuleManagedKeysResponse,

    -- * Response Lenses
    getRateBasedRuleManagedKeysResponse_nextMarker,
    getRateBasedRuleManagedKeysResponse_managedKeys,
    getRateBasedRuleManagedKeysResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WAF.Types

-- | /See:/ 'newGetRateBasedRuleManagedKeys' smart constructor.
data GetRateBasedRuleManagedKeys = GetRateBasedRuleManagedKeys'
  { -- | A null value and not currently used. Do not include this in your
    -- request.
    GetRateBasedRuleManagedKeys -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | The @RuleId@ of the RateBasedRule for which you want to get a list of
    -- @ManagedKeys@. @RuleId@ is returned by CreateRateBasedRule and by
    -- ListRateBasedRules.
    GetRateBasedRuleManagedKeys -> Text
ruleId :: Prelude.Text
  }
  deriving (GetRateBasedRuleManagedKeys -> GetRateBasedRuleManagedKeys -> Bool
(GetRateBasedRuleManagedKeys
 -> GetRateBasedRuleManagedKeys -> Bool)
-> (GetRateBasedRuleManagedKeys
    -> GetRateBasedRuleManagedKeys -> Bool)
-> Eq GetRateBasedRuleManagedKeys
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRateBasedRuleManagedKeys -> GetRateBasedRuleManagedKeys -> Bool
$c/= :: GetRateBasedRuleManagedKeys -> GetRateBasedRuleManagedKeys -> Bool
== :: GetRateBasedRuleManagedKeys -> GetRateBasedRuleManagedKeys -> Bool
$c== :: GetRateBasedRuleManagedKeys -> GetRateBasedRuleManagedKeys -> Bool
Prelude.Eq, ReadPrec [GetRateBasedRuleManagedKeys]
ReadPrec GetRateBasedRuleManagedKeys
Int -> ReadS GetRateBasedRuleManagedKeys
ReadS [GetRateBasedRuleManagedKeys]
(Int -> ReadS GetRateBasedRuleManagedKeys)
-> ReadS [GetRateBasedRuleManagedKeys]
-> ReadPrec GetRateBasedRuleManagedKeys
-> ReadPrec [GetRateBasedRuleManagedKeys]
-> Read GetRateBasedRuleManagedKeys
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRateBasedRuleManagedKeys]
$creadListPrec :: ReadPrec [GetRateBasedRuleManagedKeys]
readPrec :: ReadPrec GetRateBasedRuleManagedKeys
$creadPrec :: ReadPrec GetRateBasedRuleManagedKeys
readList :: ReadS [GetRateBasedRuleManagedKeys]
$creadList :: ReadS [GetRateBasedRuleManagedKeys]
readsPrec :: Int -> ReadS GetRateBasedRuleManagedKeys
$creadsPrec :: Int -> ReadS GetRateBasedRuleManagedKeys
Prelude.Read, Int -> GetRateBasedRuleManagedKeys -> ShowS
[GetRateBasedRuleManagedKeys] -> ShowS
GetRateBasedRuleManagedKeys -> String
(Int -> GetRateBasedRuleManagedKeys -> ShowS)
-> (GetRateBasedRuleManagedKeys -> String)
-> ([GetRateBasedRuleManagedKeys] -> ShowS)
-> Show GetRateBasedRuleManagedKeys
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRateBasedRuleManagedKeys] -> ShowS
$cshowList :: [GetRateBasedRuleManagedKeys] -> ShowS
show :: GetRateBasedRuleManagedKeys -> String
$cshow :: GetRateBasedRuleManagedKeys -> String
showsPrec :: Int -> GetRateBasedRuleManagedKeys -> ShowS
$cshowsPrec :: Int -> GetRateBasedRuleManagedKeys -> ShowS
Prelude.Show, (forall x.
 GetRateBasedRuleManagedKeys -> Rep GetRateBasedRuleManagedKeys x)
-> (forall x.
    Rep GetRateBasedRuleManagedKeys x -> GetRateBasedRuleManagedKeys)
-> Generic GetRateBasedRuleManagedKeys
forall x.
Rep GetRateBasedRuleManagedKeys x -> GetRateBasedRuleManagedKeys
forall x.
GetRateBasedRuleManagedKeys -> Rep GetRateBasedRuleManagedKeys x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRateBasedRuleManagedKeys x -> GetRateBasedRuleManagedKeys
$cfrom :: forall x.
GetRateBasedRuleManagedKeys -> Rep GetRateBasedRuleManagedKeys x
Prelude.Generic)

-- |
-- Create a value of 'GetRateBasedRuleManagedKeys' 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:
--
-- 'nextMarker', 'getRateBasedRuleManagedKeys_nextMarker' - A null value and not currently used. Do not include this in your
-- request.
--
-- 'ruleId', 'getRateBasedRuleManagedKeys_ruleId' - The @RuleId@ of the RateBasedRule for which you want to get a list of
-- @ManagedKeys@. @RuleId@ is returned by CreateRateBasedRule and by
-- ListRateBasedRules.
newGetRateBasedRuleManagedKeys ::
  -- | 'ruleId'
  Prelude.Text ->
  GetRateBasedRuleManagedKeys
newGetRateBasedRuleManagedKeys :: Text -> GetRateBasedRuleManagedKeys
newGetRateBasedRuleManagedKeys Text
pRuleId_ =
  GetRateBasedRuleManagedKeys' :: Maybe Text -> Text -> GetRateBasedRuleManagedKeys
GetRateBasedRuleManagedKeys'
    { $sel:nextMarker:GetRateBasedRuleManagedKeys' :: Maybe Text
nextMarker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ruleId:GetRateBasedRuleManagedKeys' :: Text
ruleId = Text
pRuleId_
    }

-- | A null value and not currently used. Do not include this in your
-- request.
getRateBasedRuleManagedKeys_nextMarker :: Lens.Lens' GetRateBasedRuleManagedKeys (Prelude.Maybe Prelude.Text)
getRateBasedRuleManagedKeys_nextMarker :: (Maybe Text -> f (Maybe Text))
-> GetRateBasedRuleManagedKeys -> f GetRateBasedRuleManagedKeys
getRateBasedRuleManagedKeys_nextMarker = (GetRateBasedRuleManagedKeys -> Maybe Text)
-> (GetRateBasedRuleManagedKeys
    -> Maybe Text -> GetRateBasedRuleManagedKeys)
-> Lens
     GetRateBasedRuleManagedKeys
     GetRateBasedRuleManagedKeys
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRateBasedRuleManagedKeys' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:GetRateBasedRuleManagedKeys' :: GetRateBasedRuleManagedKeys -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: GetRateBasedRuleManagedKeys
s@GetRateBasedRuleManagedKeys' {} Maybe Text
a -> GetRateBasedRuleManagedKeys
s {$sel:nextMarker:GetRateBasedRuleManagedKeys' :: Maybe Text
nextMarker = Maybe Text
a} :: GetRateBasedRuleManagedKeys)

-- | The @RuleId@ of the RateBasedRule for which you want to get a list of
-- @ManagedKeys@. @RuleId@ is returned by CreateRateBasedRule and by
-- ListRateBasedRules.
getRateBasedRuleManagedKeys_ruleId :: Lens.Lens' GetRateBasedRuleManagedKeys Prelude.Text
getRateBasedRuleManagedKeys_ruleId :: (Text -> f Text)
-> GetRateBasedRuleManagedKeys -> f GetRateBasedRuleManagedKeys
getRateBasedRuleManagedKeys_ruleId = (GetRateBasedRuleManagedKeys -> Text)
-> (GetRateBasedRuleManagedKeys
    -> Text -> GetRateBasedRuleManagedKeys)
-> Lens
     GetRateBasedRuleManagedKeys GetRateBasedRuleManagedKeys Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRateBasedRuleManagedKeys' {Text
ruleId :: Text
$sel:ruleId:GetRateBasedRuleManagedKeys' :: GetRateBasedRuleManagedKeys -> Text
ruleId} -> Text
ruleId) (\s :: GetRateBasedRuleManagedKeys
s@GetRateBasedRuleManagedKeys' {} Text
a -> GetRateBasedRuleManagedKeys
s {$sel:ruleId:GetRateBasedRuleManagedKeys' :: Text
ruleId = Text
a} :: GetRateBasedRuleManagedKeys)

instance Core.AWSPager GetRateBasedRuleManagedKeys where
  page :: GetRateBasedRuleManagedKeys
-> AWSResponse GetRateBasedRuleManagedKeys
-> Maybe GetRateBasedRuleManagedKeys
page GetRateBasedRuleManagedKeys
rq AWSResponse GetRateBasedRuleManagedKeys
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetRateBasedRuleManagedKeys
GetRateBasedRuleManagedKeysResponse
rs
            GetRateBasedRuleManagedKeysResponse
-> Getting (First Text) GetRateBasedRuleManagedKeysResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetRateBasedRuleManagedKeysResponse
-> Const (First Text) GetRateBasedRuleManagedKeysResponse
Lens' GetRateBasedRuleManagedKeysResponse (Maybe Text)
getRateBasedRuleManagedKeysResponse_nextMarker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetRateBasedRuleManagedKeysResponse
 -> Const (First Text) GetRateBasedRuleManagedKeysResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetRateBasedRuleManagedKeysResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetRateBasedRuleManagedKeys
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetRateBasedRuleManagedKeys
GetRateBasedRuleManagedKeysResponse
rs
            GetRateBasedRuleManagedKeysResponse
-> Getting
     (First [Text]) GetRateBasedRuleManagedKeysResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> GetRateBasedRuleManagedKeysResponse
-> Const (First [Text]) GetRateBasedRuleManagedKeysResponse
Lens' GetRateBasedRuleManagedKeysResponse (Maybe [Text])
getRateBasedRuleManagedKeysResponse_managedKeys
              ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> GetRateBasedRuleManagedKeysResponse
 -> Const (First [Text]) GetRateBasedRuleManagedKeysResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting
     (First [Text]) GetRateBasedRuleManagedKeysResponse [Text]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> Const (First [Text]) [Text])
-> Maybe [Text] -> Const (First [Text]) (Maybe [Text])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetRateBasedRuleManagedKeys
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetRateBasedRuleManagedKeys -> Maybe GetRateBasedRuleManagedKeys
forall a. a -> Maybe a
Prelude.Just (GetRateBasedRuleManagedKeys -> Maybe GetRateBasedRuleManagedKeys)
-> GetRateBasedRuleManagedKeys -> Maybe GetRateBasedRuleManagedKeys
forall a b. (a -> b) -> a -> b
Prelude.$
        GetRateBasedRuleManagedKeys
rq
          GetRateBasedRuleManagedKeys
-> (GetRateBasedRuleManagedKeys -> GetRateBasedRuleManagedKeys)
-> GetRateBasedRuleManagedKeys
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetRateBasedRuleManagedKeys
-> Identity GetRateBasedRuleManagedKeys
Lens
  GetRateBasedRuleManagedKeys
  GetRateBasedRuleManagedKeys
  (Maybe Text)
  (Maybe Text)
getRateBasedRuleManagedKeys_nextMarker
          ((Maybe Text -> Identity (Maybe Text))
 -> GetRateBasedRuleManagedKeys
 -> Identity GetRateBasedRuleManagedKeys)
-> Maybe Text
-> GetRateBasedRuleManagedKeys
-> GetRateBasedRuleManagedKeys
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetRateBasedRuleManagedKeys
GetRateBasedRuleManagedKeysResponse
rs
          GetRateBasedRuleManagedKeysResponse
-> Getting (First Text) GetRateBasedRuleManagedKeysResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetRateBasedRuleManagedKeysResponse
-> Const (First Text) GetRateBasedRuleManagedKeysResponse
Lens' GetRateBasedRuleManagedKeysResponse (Maybe Text)
getRateBasedRuleManagedKeysResponse_nextMarker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetRateBasedRuleManagedKeysResponse
 -> Const (First Text) GetRateBasedRuleManagedKeysResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetRateBasedRuleManagedKeysResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest GetRateBasedRuleManagedKeys where
  type
    AWSResponse GetRateBasedRuleManagedKeys =
      GetRateBasedRuleManagedKeysResponse
  request :: GetRateBasedRuleManagedKeys -> Request GetRateBasedRuleManagedKeys
request = Service
-> GetRateBasedRuleManagedKeys
-> Request GetRateBasedRuleManagedKeys
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetRateBasedRuleManagedKeys
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetRateBasedRuleManagedKeys)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetRateBasedRuleManagedKeys))
-> Logger
-> Service
-> Proxy GetRateBasedRuleManagedKeys
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetRateBasedRuleManagedKeys)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [Text] -> Int -> GetRateBasedRuleManagedKeysResponse
GetRateBasedRuleManagedKeysResponse'
            (Maybe Text
 -> Maybe [Text] -> Int -> GetRateBasedRuleManagedKeysResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [Text] -> Int -> GetRateBasedRuleManagedKeysResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextMarker")
            Either
  String (Maybe [Text] -> Int -> GetRateBasedRuleManagedKeysResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> GetRateBasedRuleManagedKeysResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ManagedKeys" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetRateBasedRuleManagedKeysResponse)
-> Either String Int
-> Either String GetRateBasedRuleManagedKeysResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetRateBasedRuleManagedKeys

instance Prelude.NFData GetRateBasedRuleManagedKeys

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

instance Core.ToJSON GetRateBasedRuleManagedKeys where
  toJSON :: GetRateBasedRuleManagedKeys -> Value
toJSON GetRateBasedRuleManagedKeys' {Maybe Text
Text
ruleId :: Text
nextMarker :: Maybe Text
$sel:ruleId:GetRateBasedRuleManagedKeys' :: GetRateBasedRuleManagedKeys -> Text
$sel:nextMarker:GetRateBasedRuleManagedKeys' :: GetRateBasedRuleManagedKeys -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextMarker" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextMarker,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RuleId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
ruleId)
          ]
      )

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

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

-- | /See:/ 'newGetRateBasedRuleManagedKeysResponse' smart constructor.
data GetRateBasedRuleManagedKeysResponse = GetRateBasedRuleManagedKeysResponse'
  { -- | A null value and not currently used.
    GetRateBasedRuleManagedKeysResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | An array of IP addresses that currently are blocked by the specified
    -- RateBasedRule.
    GetRateBasedRuleManagedKeysResponse -> Maybe [Text]
managedKeys :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    GetRateBasedRuleManagedKeysResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetRateBasedRuleManagedKeysResponse
-> GetRateBasedRuleManagedKeysResponse -> Bool
(GetRateBasedRuleManagedKeysResponse
 -> GetRateBasedRuleManagedKeysResponse -> Bool)
-> (GetRateBasedRuleManagedKeysResponse
    -> GetRateBasedRuleManagedKeysResponse -> Bool)
-> Eq GetRateBasedRuleManagedKeysResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRateBasedRuleManagedKeysResponse
-> GetRateBasedRuleManagedKeysResponse -> Bool
$c/= :: GetRateBasedRuleManagedKeysResponse
-> GetRateBasedRuleManagedKeysResponse -> Bool
== :: GetRateBasedRuleManagedKeysResponse
-> GetRateBasedRuleManagedKeysResponse -> Bool
$c== :: GetRateBasedRuleManagedKeysResponse
-> GetRateBasedRuleManagedKeysResponse -> Bool
Prelude.Eq, ReadPrec [GetRateBasedRuleManagedKeysResponse]
ReadPrec GetRateBasedRuleManagedKeysResponse
Int -> ReadS GetRateBasedRuleManagedKeysResponse
ReadS [GetRateBasedRuleManagedKeysResponse]
(Int -> ReadS GetRateBasedRuleManagedKeysResponse)
-> ReadS [GetRateBasedRuleManagedKeysResponse]
-> ReadPrec GetRateBasedRuleManagedKeysResponse
-> ReadPrec [GetRateBasedRuleManagedKeysResponse]
-> Read GetRateBasedRuleManagedKeysResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRateBasedRuleManagedKeysResponse]
$creadListPrec :: ReadPrec [GetRateBasedRuleManagedKeysResponse]
readPrec :: ReadPrec GetRateBasedRuleManagedKeysResponse
$creadPrec :: ReadPrec GetRateBasedRuleManagedKeysResponse
readList :: ReadS [GetRateBasedRuleManagedKeysResponse]
$creadList :: ReadS [GetRateBasedRuleManagedKeysResponse]
readsPrec :: Int -> ReadS GetRateBasedRuleManagedKeysResponse
$creadsPrec :: Int -> ReadS GetRateBasedRuleManagedKeysResponse
Prelude.Read, Int -> GetRateBasedRuleManagedKeysResponse -> ShowS
[GetRateBasedRuleManagedKeysResponse] -> ShowS
GetRateBasedRuleManagedKeysResponse -> String
(Int -> GetRateBasedRuleManagedKeysResponse -> ShowS)
-> (GetRateBasedRuleManagedKeysResponse -> String)
-> ([GetRateBasedRuleManagedKeysResponse] -> ShowS)
-> Show GetRateBasedRuleManagedKeysResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRateBasedRuleManagedKeysResponse] -> ShowS
$cshowList :: [GetRateBasedRuleManagedKeysResponse] -> ShowS
show :: GetRateBasedRuleManagedKeysResponse -> String
$cshow :: GetRateBasedRuleManagedKeysResponse -> String
showsPrec :: Int -> GetRateBasedRuleManagedKeysResponse -> ShowS
$cshowsPrec :: Int -> GetRateBasedRuleManagedKeysResponse -> ShowS
Prelude.Show, (forall x.
 GetRateBasedRuleManagedKeysResponse
 -> Rep GetRateBasedRuleManagedKeysResponse x)
-> (forall x.
    Rep GetRateBasedRuleManagedKeysResponse x
    -> GetRateBasedRuleManagedKeysResponse)
-> Generic GetRateBasedRuleManagedKeysResponse
forall x.
Rep GetRateBasedRuleManagedKeysResponse x
-> GetRateBasedRuleManagedKeysResponse
forall x.
GetRateBasedRuleManagedKeysResponse
-> Rep GetRateBasedRuleManagedKeysResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRateBasedRuleManagedKeysResponse x
-> GetRateBasedRuleManagedKeysResponse
$cfrom :: forall x.
GetRateBasedRuleManagedKeysResponse
-> Rep GetRateBasedRuleManagedKeysResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetRateBasedRuleManagedKeysResponse' 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:
--
-- 'nextMarker', 'getRateBasedRuleManagedKeysResponse_nextMarker' - A null value and not currently used.
--
-- 'managedKeys', 'getRateBasedRuleManagedKeysResponse_managedKeys' - An array of IP addresses that currently are blocked by the specified
-- RateBasedRule.
--
-- 'httpStatus', 'getRateBasedRuleManagedKeysResponse_httpStatus' - The response's http status code.
newGetRateBasedRuleManagedKeysResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRateBasedRuleManagedKeysResponse
newGetRateBasedRuleManagedKeysResponse :: Int -> GetRateBasedRuleManagedKeysResponse
newGetRateBasedRuleManagedKeysResponse Int
pHttpStatus_ =
  GetRateBasedRuleManagedKeysResponse' :: Maybe Text
-> Maybe [Text] -> Int -> GetRateBasedRuleManagedKeysResponse
GetRateBasedRuleManagedKeysResponse'
    { $sel:nextMarker:GetRateBasedRuleManagedKeysResponse' :: Maybe Text
nextMarker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:managedKeys:GetRateBasedRuleManagedKeysResponse' :: Maybe [Text]
managedKeys = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetRateBasedRuleManagedKeysResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A null value and not currently used.
getRateBasedRuleManagedKeysResponse_nextMarker :: Lens.Lens' GetRateBasedRuleManagedKeysResponse (Prelude.Maybe Prelude.Text)
getRateBasedRuleManagedKeysResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> GetRateBasedRuleManagedKeysResponse
-> f GetRateBasedRuleManagedKeysResponse
getRateBasedRuleManagedKeysResponse_nextMarker = (GetRateBasedRuleManagedKeysResponse -> Maybe Text)
-> (GetRateBasedRuleManagedKeysResponse
    -> Maybe Text -> GetRateBasedRuleManagedKeysResponse)
-> Lens' GetRateBasedRuleManagedKeysResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRateBasedRuleManagedKeysResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:GetRateBasedRuleManagedKeysResponse' :: GetRateBasedRuleManagedKeysResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: GetRateBasedRuleManagedKeysResponse
s@GetRateBasedRuleManagedKeysResponse' {} Maybe Text
a -> GetRateBasedRuleManagedKeysResponse
s {$sel:nextMarker:GetRateBasedRuleManagedKeysResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: GetRateBasedRuleManagedKeysResponse)

-- | An array of IP addresses that currently are blocked by the specified
-- RateBasedRule.
getRateBasedRuleManagedKeysResponse_managedKeys :: Lens.Lens' GetRateBasedRuleManagedKeysResponse (Prelude.Maybe [Prelude.Text])
getRateBasedRuleManagedKeysResponse_managedKeys :: (Maybe [Text] -> f (Maybe [Text]))
-> GetRateBasedRuleManagedKeysResponse
-> f GetRateBasedRuleManagedKeysResponse
getRateBasedRuleManagedKeysResponse_managedKeys = (GetRateBasedRuleManagedKeysResponse -> Maybe [Text])
-> (GetRateBasedRuleManagedKeysResponse
    -> Maybe [Text] -> GetRateBasedRuleManagedKeysResponse)
-> Lens' GetRateBasedRuleManagedKeysResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRateBasedRuleManagedKeysResponse' {Maybe [Text]
managedKeys :: Maybe [Text]
$sel:managedKeys:GetRateBasedRuleManagedKeysResponse' :: GetRateBasedRuleManagedKeysResponse -> Maybe [Text]
managedKeys} -> Maybe [Text]
managedKeys) (\s :: GetRateBasedRuleManagedKeysResponse
s@GetRateBasedRuleManagedKeysResponse' {} Maybe [Text]
a -> GetRateBasedRuleManagedKeysResponse
s {$sel:managedKeys:GetRateBasedRuleManagedKeysResponse' :: Maybe [Text]
managedKeys = Maybe [Text]
a} :: GetRateBasedRuleManagedKeysResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetRateBasedRuleManagedKeysResponse
 -> f GetRateBasedRuleManagedKeysResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetRateBasedRuleManagedKeysResponse
-> f GetRateBasedRuleManagedKeysResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetRateBasedRuleManagedKeysResponse