{-# 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.Shield.ListProtectionGroups
-- 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 ProtectionGroup objects for the account. You can retrieve all
-- protection groups or you can provide filtering criteria and retrieve
-- just the subset of protection groups that match the criteria.
module Amazonka.Shield.ListProtectionGroups
  ( -- * Creating a Request
    ListProtectionGroups (..),
    newListProtectionGroups,

    -- * Request Lenses
    listProtectionGroups_inclusionFilters,
    listProtectionGroups_maxResults,
    listProtectionGroups_nextToken,

    -- * Destructuring the Response
    ListProtectionGroupsResponse (..),
    newListProtectionGroupsResponse,

    -- * Response Lenses
    listProtectionGroupsResponse_nextToken,
    listProtectionGroupsResponse_httpStatus,
    listProtectionGroupsResponse_protectionGroups,
  )
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.Shield.Types

-- | /See:/ 'newListProtectionGroups' smart constructor.
data ListProtectionGroups = ListProtectionGroups'
  { -- | Narrows the set of protection groups that the call retrieves. You can
    -- retrieve a single protection group by its name and you can retrieve all
    -- protection groups that are configured with specific pattern or
    -- aggregation settings. You can provide up to one criteria per filter
    -- type. Shield Advanced returns the protection groups that exactly match
    -- all of the search criteria that you provide.
    ListProtectionGroups -> Maybe InclusionProtectionGroupFilters
inclusionFilters :: Prelude.Maybe InclusionProtectionGroupFilters,
    -- | The greatest number of objects that you want Shield Advanced to return
    -- to the list request. Shield Advanced might return fewer objects than you
    -- indicate in this setting, even if more objects are available. If there
    -- are more objects remaining, Shield Advanced will always also return a
    -- @NextToken@ value in the response.
    --
    -- The default setting is 20.
    ListProtectionGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | When you request a list of objects from Shield Advanced, if the response
    -- does not include all of the remaining available objects, Shield Advanced
    -- includes a @NextToken@ value in the response. You can retrieve the next
    -- batch of objects by requesting the list again and providing the token
    -- that was returned by the prior call in your request.
    --
    -- You can indicate the maximum number of objects that you want Shield
    -- Advanced to return for a single call with the @MaxResults@ setting.
    -- Shield Advanced will not return more than @MaxResults@ objects, but may
    -- return fewer, even if more objects are still available.
    --
    -- Whenever more objects remain that Shield Advanced has not yet returned
    -- to you, the response will include a @NextToken@ value.
    --
    -- On your first call to a list operation, leave this setting empty.
    ListProtectionGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListProtectionGroups -> ListProtectionGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProtectionGroups -> ListProtectionGroups -> Bool
$c/= :: ListProtectionGroups -> ListProtectionGroups -> Bool
== :: ListProtectionGroups -> ListProtectionGroups -> Bool
$c== :: ListProtectionGroups -> ListProtectionGroups -> Bool
Prelude.Eq, ReadPrec [ListProtectionGroups]
ReadPrec ListProtectionGroups
Int -> ReadS ListProtectionGroups
ReadS [ListProtectionGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProtectionGroups]
$creadListPrec :: ReadPrec [ListProtectionGroups]
readPrec :: ReadPrec ListProtectionGroups
$creadPrec :: ReadPrec ListProtectionGroups
readList :: ReadS [ListProtectionGroups]
$creadList :: ReadS [ListProtectionGroups]
readsPrec :: Int -> ReadS ListProtectionGroups
$creadsPrec :: Int -> ReadS ListProtectionGroups
Prelude.Read, Int -> ListProtectionGroups -> ShowS
[ListProtectionGroups] -> ShowS
ListProtectionGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProtectionGroups] -> ShowS
$cshowList :: [ListProtectionGroups] -> ShowS
show :: ListProtectionGroups -> String
$cshow :: ListProtectionGroups -> String
showsPrec :: Int -> ListProtectionGroups -> ShowS
$cshowsPrec :: Int -> ListProtectionGroups -> ShowS
Prelude.Show, forall x. Rep ListProtectionGroups x -> ListProtectionGroups
forall x. ListProtectionGroups -> Rep ListProtectionGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListProtectionGroups x -> ListProtectionGroups
$cfrom :: forall x. ListProtectionGroups -> Rep ListProtectionGroups x
Prelude.Generic)

-- |
-- Create a value of 'ListProtectionGroups' 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:
--
-- 'inclusionFilters', 'listProtectionGroups_inclusionFilters' - Narrows the set of protection groups that the call retrieves. You can
-- retrieve a single protection group by its name and you can retrieve all
-- protection groups that are configured with specific pattern or
-- aggregation settings. You can provide up to one criteria per filter
-- type. Shield Advanced returns the protection groups that exactly match
-- all of the search criteria that you provide.
--
-- 'maxResults', 'listProtectionGroups_maxResults' - The greatest number of objects that you want Shield Advanced to return
-- to the list request. Shield Advanced might return fewer objects than you
-- indicate in this setting, even if more objects are available. If there
-- are more objects remaining, Shield Advanced will always also return a
-- @NextToken@ value in the response.
--
-- The default setting is 20.
--
-- 'nextToken', 'listProtectionGroups_nextToken' - When you request a list of objects from Shield Advanced, if the response
-- does not include all of the remaining available objects, Shield Advanced
-- includes a @NextToken@ value in the response. You can retrieve the next
-- batch of objects by requesting the list again and providing the token
-- that was returned by the prior call in your request.
--
-- You can indicate the maximum number of objects that you want Shield
-- Advanced to return for a single call with the @MaxResults@ setting.
-- Shield Advanced will not return more than @MaxResults@ objects, but may
-- return fewer, even if more objects are still available.
--
-- Whenever more objects remain that Shield Advanced has not yet returned
-- to you, the response will include a @NextToken@ value.
--
-- On your first call to a list operation, leave this setting empty.
newListProtectionGroups ::
  ListProtectionGroups
newListProtectionGroups :: ListProtectionGroups
newListProtectionGroups =
  ListProtectionGroups'
    { $sel:inclusionFilters:ListProtectionGroups' :: Maybe InclusionProtectionGroupFilters
inclusionFilters =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListProtectionGroups' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListProtectionGroups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | Narrows the set of protection groups that the call retrieves. You can
-- retrieve a single protection group by its name and you can retrieve all
-- protection groups that are configured with specific pattern or
-- aggregation settings. You can provide up to one criteria per filter
-- type. Shield Advanced returns the protection groups that exactly match
-- all of the search criteria that you provide.
listProtectionGroups_inclusionFilters :: Lens.Lens' ListProtectionGroups (Prelude.Maybe InclusionProtectionGroupFilters)
listProtectionGroups_inclusionFilters :: Lens' ListProtectionGroups (Maybe InclusionProtectionGroupFilters)
listProtectionGroups_inclusionFilters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProtectionGroups' {Maybe InclusionProtectionGroupFilters
inclusionFilters :: Maybe InclusionProtectionGroupFilters
$sel:inclusionFilters:ListProtectionGroups' :: ListProtectionGroups -> Maybe InclusionProtectionGroupFilters
inclusionFilters} -> Maybe InclusionProtectionGroupFilters
inclusionFilters) (\s :: ListProtectionGroups
s@ListProtectionGroups' {} Maybe InclusionProtectionGroupFilters
a -> ListProtectionGroups
s {$sel:inclusionFilters:ListProtectionGroups' :: Maybe InclusionProtectionGroupFilters
inclusionFilters = Maybe InclusionProtectionGroupFilters
a} :: ListProtectionGroups)

-- | The greatest number of objects that you want Shield Advanced to return
-- to the list request. Shield Advanced might return fewer objects than you
-- indicate in this setting, even if more objects are available. If there
-- are more objects remaining, Shield Advanced will always also return a
-- @NextToken@ value in the response.
--
-- The default setting is 20.
listProtectionGroups_maxResults :: Lens.Lens' ListProtectionGroups (Prelude.Maybe Prelude.Natural)
listProtectionGroups_maxResults :: Lens' ListProtectionGroups (Maybe Natural)
listProtectionGroups_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProtectionGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListProtectionGroups' :: ListProtectionGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListProtectionGroups
s@ListProtectionGroups' {} Maybe Natural
a -> ListProtectionGroups
s {$sel:maxResults:ListProtectionGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListProtectionGroups)

-- | When you request a list of objects from Shield Advanced, if the response
-- does not include all of the remaining available objects, Shield Advanced
-- includes a @NextToken@ value in the response. You can retrieve the next
-- batch of objects by requesting the list again and providing the token
-- that was returned by the prior call in your request.
--
-- You can indicate the maximum number of objects that you want Shield
-- Advanced to return for a single call with the @MaxResults@ setting.
-- Shield Advanced will not return more than @MaxResults@ objects, but may
-- return fewer, even if more objects are still available.
--
-- Whenever more objects remain that Shield Advanced has not yet returned
-- to you, the response will include a @NextToken@ value.
--
-- On your first call to a list operation, leave this setting empty.
listProtectionGroups_nextToken :: Lens.Lens' ListProtectionGroups (Prelude.Maybe Prelude.Text)
listProtectionGroups_nextToken :: Lens' ListProtectionGroups (Maybe Text)
listProtectionGroups_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProtectionGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListProtectionGroups' :: ListProtectionGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListProtectionGroups
s@ListProtectionGroups' {} Maybe Text
a -> ListProtectionGroups
s {$sel:nextToken:ListProtectionGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListProtectionGroups)

instance Core.AWSRequest ListProtectionGroups where
  type
    AWSResponse ListProtectionGroups =
      ListProtectionGroupsResponse
  request :: (Service -> Service)
-> ListProtectionGroups -> Request ListProtectionGroups
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 ListProtectionGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListProtectionGroups)))
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 Text
-> Int -> [ProtectionGroup] -> ListProtectionGroupsResponse
ListProtectionGroupsResponse'
            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
"NextToken")
            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))
            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
"ProtectionGroups"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListProtectionGroups where
  hashWithSalt :: Int -> ListProtectionGroups -> Int
hashWithSalt Int
_salt ListProtectionGroups' {Maybe Natural
Maybe Text
Maybe InclusionProtectionGroupFilters
nextToken :: Maybe Text
maxResults :: Maybe Natural
inclusionFilters :: Maybe InclusionProtectionGroupFilters
$sel:nextToken:ListProtectionGroups' :: ListProtectionGroups -> Maybe Text
$sel:maxResults:ListProtectionGroups' :: ListProtectionGroups -> Maybe Natural
$sel:inclusionFilters:ListProtectionGroups' :: ListProtectionGroups -> Maybe InclusionProtectionGroupFilters
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InclusionProtectionGroupFilters
inclusionFilters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData ListProtectionGroups where
  rnf :: ListProtectionGroups -> ()
rnf ListProtectionGroups' {Maybe Natural
Maybe Text
Maybe InclusionProtectionGroupFilters
nextToken :: Maybe Text
maxResults :: Maybe Natural
inclusionFilters :: Maybe InclusionProtectionGroupFilters
$sel:nextToken:ListProtectionGroups' :: ListProtectionGroups -> Maybe Text
$sel:maxResults:ListProtectionGroups' :: ListProtectionGroups -> Maybe Natural
$sel:inclusionFilters:ListProtectionGroups' :: ListProtectionGroups -> Maybe InclusionProtectionGroupFilters
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe InclusionProtectionGroupFilters
inclusionFilters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

instance Data.ToHeaders ListProtectionGroups where
  toHeaders :: ListProtectionGroups -> 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
"AWSShield_20160616.ListProtectionGroups" ::
                          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 ListProtectionGroups where
  toJSON :: ListProtectionGroups -> Value
toJSON ListProtectionGroups' {Maybe Natural
Maybe Text
Maybe InclusionProtectionGroupFilters
nextToken :: Maybe Text
maxResults :: Maybe Natural
inclusionFilters :: Maybe InclusionProtectionGroupFilters
$sel:nextToken:ListProtectionGroups' :: ListProtectionGroups -> Maybe Text
$sel:maxResults:ListProtectionGroups' :: ListProtectionGroups -> Maybe Natural
$sel:inclusionFilters:ListProtectionGroups' :: ListProtectionGroups -> Maybe InclusionProtectionGroupFilters
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"InclusionFilters" 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 InclusionProtectionGroupFilters
inclusionFilters,
            (Key
"MaxResults" 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 Natural
maxResults,
            (Key
"NextToken" 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
nextToken
          ]
      )

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

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

-- | /See:/ 'newListProtectionGroupsResponse' smart constructor.
data ListProtectionGroupsResponse = ListProtectionGroupsResponse'
  { -- | When you request a list of objects from Shield Advanced, if the response
    -- does not include all of the remaining available objects, Shield Advanced
    -- includes a @NextToken@ value in the response. You can retrieve the next
    -- batch of objects by requesting the list again and providing the token
    -- that was returned by the prior call in your request.
    --
    -- You can indicate the maximum number of objects that you want Shield
    -- Advanced to return for a single call with the @MaxResults@ setting.
    -- Shield Advanced will not return more than @MaxResults@ objects, but may
    -- return fewer, even if more objects are still available.
    --
    -- Whenever more objects remain that Shield Advanced has not yet returned
    -- to you, the response will include a @NextToken@ value.
    ListProtectionGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListProtectionGroupsResponse -> Int
httpStatus :: Prelude.Int,
    ListProtectionGroupsResponse -> [ProtectionGroup]
protectionGroups :: [ProtectionGroup]
  }
  deriving (ListProtectionGroupsResponse
-> ListProtectionGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProtectionGroupsResponse
-> ListProtectionGroupsResponse -> Bool
$c/= :: ListProtectionGroupsResponse
-> ListProtectionGroupsResponse -> Bool
== :: ListProtectionGroupsResponse
-> ListProtectionGroupsResponse -> Bool
$c== :: ListProtectionGroupsResponse
-> ListProtectionGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListProtectionGroupsResponse]
ReadPrec ListProtectionGroupsResponse
Int -> ReadS ListProtectionGroupsResponse
ReadS [ListProtectionGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProtectionGroupsResponse]
$creadListPrec :: ReadPrec [ListProtectionGroupsResponse]
readPrec :: ReadPrec ListProtectionGroupsResponse
$creadPrec :: ReadPrec ListProtectionGroupsResponse
readList :: ReadS [ListProtectionGroupsResponse]
$creadList :: ReadS [ListProtectionGroupsResponse]
readsPrec :: Int -> ReadS ListProtectionGroupsResponse
$creadsPrec :: Int -> ReadS ListProtectionGroupsResponse
Prelude.Read, Int -> ListProtectionGroupsResponse -> ShowS
[ListProtectionGroupsResponse] -> ShowS
ListProtectionGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProtectionGroupsResponse] -> ShowS
$cshowList :: [ListProtectionGroupsResponse] -> ShowS
show :: ListProtectionGroupsResponse -> String
$cshow :: ListProtectionGroupsResponse -> String
showsPrec :: Int -> ListProtectionGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListProtectionGroupsResponse -> ShowS
Prelude.Show, forall x.
Rep ListProtectionGroupsResponse x -> ListProtectionGroupsResponse
forall x.
ListProtectionGroupsResponse -> Rep ListProtectionGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListProtectionGroupsResponse x -> ListProtectionGroupsResponse
$cfrom :: forall x.
ListProtectionGroupsResponse -> Rep ListProtectionGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListProtectionGroupsResponse' 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:
--
-- 'nextToken', 'listProtectionGroupsResponse_nextToken' - When you request a list of objects from Shield Advanced, if the response
-- does not include all of the remaining available objects, Shield Advanced
-- includes a @NextToken@ value in the response. You can retrieve the next
-- batch of objects by requesting the list again and providing the token
-- that was returned by the prior call in your request.
--
-- You can indicate the maximum number of objects that you want Shield
-- Advanced to return for a single call with the @MaxResults@ setting.
-- Shield Advanced will not return more than @MaxResults@ objects, but may
-- return fewer, even if more objects are still available.
--
-- Whenever more objects remain that Shield Advanced has not yet returned
-- to you, the response will include a @NextToken@ value.
--
-- 'httpStatus', 'listProtectionGroupsResponse_httpStatus' - The response's http status code.
--
-- 'protectionGroups', 'listProtectionGroupsResponse_protectionGroups' -
newListProtectionGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListProtectionGroupsResponse
newListProtectionGroupsResponse :: Int -> ListProtectionGroupsResponse
newListProtectionGroupsResponse Int
pHttpStatus_ =
  ListProtectionGroupsResponse'
    { $sel:nextToken:ListProtectionGroupsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListProtectionGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:protectionGroups:ListProtectionGroupsResponse' :: [ProtectionGroup]
protectionGroups = forall a. Monoid a => a
Prelude.mempty
    }

-- | When you request a list of objects from Shield Advanced, if the response
-- does not include all of the remaining available objects, Shield Advanced
-- includes a @NextToken@ value in the response. You can retrieve the next
-- batch of objects by requesting the list again and providing the token
-- that was returned by the prior call in your request.
--
-- You can indicate the maximum number of objects that you want Shield
-- Advanced to return for a single call with the @MaxResults@ setting.
-- Shield Advanced will not return more than @MaxResults@ objects, but may
-- return fewer, even if more objects are still available.
--
-- Whenever more objects remain that Shield Advanced has not yet returned
-- to you, the response will include a @NextToken@ value.
listProtectionGroupsResponse_nextToken :: Lens.Lens' ListProtectionGroupsResponse (Prelude.Maybe Prelude.Text)
listProtectionGroupsResponse_nextToken :: Lens' ListProtectionGroupsResponse (Maybe Text)
listProtectionGroupsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProtectionGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListProtectionGroupsResponse' :: ListProtectionGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListProtectionGroupsResponse
s@ListProtectionGroupsResponse' {} Maybe Text
a -> ListProtectionGroupsResponse
s {$sel:nextToken:ListProtectionGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListProtectionGroupsResponse)

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

listProtectionGroupsResponse_protectionGroups :: Lens.Lens' ListProtectionGroupsResponse [ProtectionGroup]
listProtectionGroupsResponse_protectionGroups :: Lens' ListProtectionGroupsResponse [ProtectionGroup]
listProtectionGroupsResponse_protectionGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProtectionGroupsResponse' {[ProtectionGroup]
protectionGroups :: [ProtectionGroup]
$sel:protectionGroups:ListProtectionGroupsResponse' :: ListProtectionGroupsResponse -> [ProtectionGroup]
protectionGroups} -> [ProtectionGroup]
protectionGroups) (\s :: ListProtectionGroupsResponse
s@ListProtectionGroupsResponse' {} [ProtectionGroup]
a -> ListProtectionGroupsResponse
s {$sel:protectionGroups:ListProtectionGroupsResponse' :: [ProtectionGroup]
protectionGroups = [ProtectionGroup]
a} :: ListProtectionGroupsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListProtectionGroupsResponse where
  rnf :: ListProtectionGroupsResponse -> ()
rnf ListProtectionGroupsResponse' {Int
[ProtectionGroup]
Maybe Text
protectionGroups :: [ProtectionGroup]
httpStatus :: Int
nextToken :: Maybe Text
$sel:protectionGroups:ListProtectionGroupsResponse' :: ListProtectionGroupsResponse -> [ProtectionGroup]
$sel:httpStatus:ListProtectionGroupsResponse' :: ListProtectionGroupsResponse -> Int
$sel:nextToken:ListProtectionGroupsResponse' :: ListProtectionGroupsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [ProtectionGroup]
protectionGroups