{-# 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.ListResourcesInProtectionGroup
-- 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)
--
-- Retrieves the resources that are included in the protection group.
module Amazonka.Shield.ListResourcesInProtectionGroup
  ( -- * Creating a Request
    ListResourcesInProtectionGroup (..),
    newListResourcesInProtectionGroup,

    -- * Request Lenses
    listResourcesInProtectionGroup_nextToken,
    listResourcesInProtectionGroup_maxResults,
    listResourcesInProtectionGroup_protectionGroupId,

    -- * Destructuring the Response
    ListResourcesInProtectionGroupResponse (..),
    newListResourcesInProtectionGroupResponse,

    -- * Response Lenses
    listResourcesInProtectionGroupResponse_nextToken,
    listResourcesInProtectionGroupResponse_httpStatus,
    listResourcesInProtectionGroupResponse_resourceArns,
  )
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.Shield.Types

-- | /See:/ 'newListResourcesInProtectionGroup' smart constructor.
data ListResourcesInProtectionGroup = ListResourcesInProtectionGroup'
  { -- | The next token value from a previous call to
    -- @ListResourcesInProtectionGroup@. Pass null if this is the first call.
    ListResourcesInProtectionGroup -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of resource ARN objects to return. If you leave this
    -- blank, Shield Advanced returns the first 20 results.
    --
    -- This is a maximum value. Shield Advanced might return the results in
    -- smaller batches. That is, the number of objects returned could be less
    -- than @MaxResults@, even if there are still more objects yet to return.
    -- If there are more objects to return, Shield Advanced returns a value in
    -- @NextToken@ that you can use in your next request, to get the next batch
    -- of objects.
    ListResourcesInProtectionGroup -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the protection group. You use this to identify the
    -- protection group in lists and to manage the protection group, for
    -- example to update, delete, or describe it.
    ListResourcesInProtectionGroup -> Text
protectionGroupId :: Prelude.Text
  }
  deriving (ListResourcesInProtectionGroup
-> ListResourcesInProtectionGroup -> Bool
(ListResourcesInProtectionGroup
 -> ListResourcesInProtectionGroup -> Bool)
-> (ListResourcesInProtectionGroup
    -> ListResourcesInProtectionGroup -> Bool)
-> Eq ListResourcesInProtectionGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListResourcesInProtectionGroup
-> ListResourcesInProtectionGroup -> Bool
$c/= :: ListResourcesInProtectionGroup
-> ListResourcesInProtectionGroup -> Bool
== :: ListResourcesInProtectionGroup
-> ListResourcesInProtectionGroup -> Bool
$c== :: ListResourcesInProtectionGroup
-> ListResourcesInProtectionGroup -> Bool
Prelude.Eq, ReadPrec [ListResourcesInProtectionGroup]
ReadPrec ListResourcesInProtectionGroup
Int -> ReadS ListResourcesInProtectionGroup
ReadS [ListResourcesInProtectionGroup]
(Int -> ReadS ListResourcesInProtectionGroup)
-> ReadS [ListResourcesInProtectionGroup]
-> ReadPrec ListResourcesInProtectionGroup
-> ReadPrec [ListResourcesInProtectionGroup]
-> Read ListResourcesInProtectionGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListResourcesInProtectionGroup]
$creadListPrec :: ReadPrec [ListResourcesInProtectionGroup]
readPrec :: ReadPrec ListResourcesInProtectionGroup
$creadPrec :: ReadPrec ListResourcesInProtectionGroup
readList :: ReadS [ListResourcesInProtectionGroup]
$creadList :: ReadS [ListResourcesInProtectionGroup]
readsPrec :: Int -> ReadS ListResourcesInProtectionGroup
$creadsPrec :: Int -> ReadS ListResourcesInProtectionGroup
Prelude.Read, Int -> ListResourcesInProtectionGroup -> ShowS
[ListResourcesInProtectionGroup] -> ShowS
ListResourcesInProtectionGroup -> String
(Int -> ListResourcesInProtectionGroup -> ShowS)
-> (ListResourcesInProtectionGroup -> String)
-> ([ListResourcesInProtectionGroup] -> ShowS)
-> Show ListResourcesInProtectionGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListResourcesInProtectionGroup] -> ShowS
$cshowList :: [ListResourcesInProtectionGroup] -> ShowS
show :: ListResourcesInProtectionGroup -> String
$cshow :: ListResourcesInProtectionGroup -> String
showsPrec :: Int -> ListResourcesInProtectionGroup -> ShowS
$cshowsPrec :: Int -> ListResourcesInProtectionGroup -> ShowS
Prelude.Show, (forall x.
 ListResourcesInProtectionGroup
 -> Rep ListResourcesInProtectionGroup x)
-> (forall x.
    Rep ListResourcesInProtectionGroup x
    -> ListResourcesInProtectionGroup)
-> Generic ListResourcesInProtectionGroup
forall x.
Rep ListResourcesInProtectionGroup x
-> ListResourcesInProtectionGroup
forall x.
ListResourcesInProtectionGroup
-> Rep ListResourcesInProtectionGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListResourcesInProtectionGroup x
-> ListResourcesInProtectionGroup
$cfrom :: forall x.
ListResourcesInProtectionGroup
-> Rep ListResourcesInProtectionGroup x
Prelude.Generic)

-- |
-- Create a value of 'ListResourcesInProtectionGroup' 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', 'listResourcesInProtectionGroup_nextToken' - The next token value from a previous call to
-- @ListResourcesInProtectionGroup@. Pass null if this is the first call.
--
-- 'maxResults', 'listResourcesInProtectionGroup_maxResults' - The maximum number of resource ARN objects to return. If you leave this
-- blank, Shield Advanced returns the first 20 results.
--
-- This is a maximum value. Shield Advanced might return the results in
-- smaller batches. That is, the number of objects returned could be less
-- than @MaxResults@, even if there are still more objects yet to return.
-- If there are more objects to return, Shield Advanced returns a value in
-- @NextToken@ that you can use in your next request, to get the next batch
-- of objects.
--
-- 'protectionGroupId', 'listResourcesInProtectionGroup_protectionGroupId' - The name of the protection group. You use this to identify the
-- protection group in lists and to manage the protection group, for
-- example to update, delete, or describe it.
newListResourcesInProtectionGroup ::
  -- | 'protectionGroupId'
  Prelude.Text ->
  ListResourcesInProtectionGroup
newListResourcesInProtectionGroup :: Text -> ListResourcesInProtectionGroup
newListResourcesInProtectionGroup Text
pProtectionGroupId_ =
  ListResourcesInProtectionGroup' :: Maybe Text
-> Maybe Natural -> Text -> ListResourcesInProtectionGroup
ListResourcesInProtectionGroup'
    { $sel:nextToken:ListResourcesInProtectionGroup' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListResourcesInProtectionGroup' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:protectionGroupId:ListResourcesInProtectionGroup' :: Text
protectionGroupId = Text
pProtectionGroupId_
    }

-- | The next token value from a previous call to
-- @ListResourcesInProtectionGroup@. Pass null if this is the first call.
listResourcesInProtectionGroup_nextToken :: Lens.Lens' ListResourcesInProtectionGroup (Prelude.Maybe Prelude.Text)
listResourcesInProtectionGroup_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListResourcesInProtectionGroup
-> f ListResourcesInProtectionGroup
listResourcesInProtectionGroup_nextToken = (ListResourcesInProtectionGroup -> Maybe Text)
-> (ListResourcesInProtectionGroup
    -> Maybe Text -> ListResourcesInProtectionGroup)
-> Lens
     ListResourcesInProtectionGroup
     ListResourcesInProtectionGroup
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourcesInProtectionGroup' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListResourcesInProtectionGroup
s@ListResourcesInProtectionGroup' {} Maybe Text
a -> ListResourcesInProtectionGroup
s {$sel:nextToken:ListResourcesInProtectionGroup' :: Maybe Text
nextToken = Maybe Text
a} :: ListResourcesInProtectionGroup)

-- | The maximum number of resource ARN objects to return. If you leave this
-- blank, Shield Advanced returns the first 20 results.
--
-- This is a maximum value. Shield Advanced might return the results in
-- smaller batches. That is, the number of objects returned could be less
-- than @MaxResults@, even if there are still more objects yet to return.
-- If there are more objects to return, Shield Advanced returns a value in
-- @NextToken@ that you can use in your next request, to get the next batch
-- of objects.
listResourcesInProtectionGroup_maxResults :: Lens.Lens' ListResourcesInProtectionGroup (Prelude.Maybe Prelude.Natural)
listResourcesInProtectionGroup_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListResourcesInProtectionGroup
-> f ListResourcesInProtectionGroup
listResourcesInProtectionGroup_maxResults = (ListResourcesInProtectionGroup -> Maybe Natural)
-> (ListResourcesInProtectionGroup
    -> Maybe Natural -> ListResourcesInProtectionGroup)
-> Lens
     ListResourcesInProtectionGroup
     ListResourcesInProtectionGroup
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourcesInProtectionGroup' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListResourcesInProtectionGroup
s@ListResourcesInProtectionGroup' {} Maybe Natural
a -> ListResourcesInProtectionGroup
s {$sel:maxResults:ListResourcesInProtectionGroup' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListResourcesInProtectionGroup)

-- | The name of the protection group. You use this to identify the
-- protection group in lists and to manage the protection group, for
-- example to update, delete, or describe it.
listResourcesInProtectionGroup_protectionGroupId :: Lens.Lens' ListResourcesInProtectionGroup Prelude.Text
listResourcesInProtectionGroup_protectionGroupId :: (Text -> f Text)
-> ListResourcesInProtectionGroup
-> f ListResourcesInProtectionGroup
listResourcesInProtectionGroup_protectionGroupId = (ListResourcesInProtectionGroup -> Text)
-> (ListResourcesInProtectionGroup
    -> Text -> ListResourcesInProtectionGroup)
-> Lens
     ListResourcesInProtectionGroup
     ListResourcesInProtectionGroup
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourcesInProtectionGroup' {Text
protectionGroupId :: Text
$sel:protectionGroupId:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Text
protectionGroupId} -> Text
protectionGroupId) (\s :: ListResourcesInProtectionGroup
s@ListResourcesInProtectionGroup' {} Text
a -> ListResourcesInProtectionGroup
s {$sel:protectionGroupId:ListResourcesInProtectionGroup' :: Text
protectionGroupId = Text
a} :: ListResourcesInProtectionGroup)

instance
  Core.AWSRequest
    ListResourcesInProtectionGroup
  where
  type
    AWSResponse ListResourcesInProtectionGroup =
      ListResourcesInProtectionGroupResponse
  request :: ListResourcesInProtectionGroup
-> Request ListResourcesInProtectionGroup
request = Service
-> ListResourcesInProtectionGroup
-> Request ListResourcesInProtectionGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListResourcesInProtectionGroup
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListResourcesInProtectionGroup)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListResourcesInProtectionGroup))
-> Logger
-> Service
-> Proxy ListResourcesInProtectionGroup
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListResourcesInProtectionGroup)))
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
-> Int -> [Text] -> ListResourcesInProtectionGroupResponse
ListResourcesInProtectionGroupResponse'
            (Maybe Text
 -> Int -> [Text] -> ListResourcesInProtectionGroupResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> [Text] -> ListResourcesInProtectionGroupResponse)
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
"NextToken")
            Either
  String (Int -> [Text] -> ListResourcesInProtectionGroupResponse)
-> Either String Int
-> Either String ([Text] -> ListResourcesInProtectionGroupResponse)
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))
            Either String ([Text] -> ListResourcesInProtectionGroupResponse)
-> Either String [Text]
-> Either String ListResourcesInProtectionGroupResponse
forall (f :: * -> *) a b. Applicative f => 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
"ResourceArns" Either String (Maybe [Text]) -> [Text] -> Either String [Text]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Text]
forall a. Monoid a => a
Prelude.mempty)
      )

instance
  Prelude.Hashable
    ListResourcesInProtectionGroup

instance
  Prelude.NFData
    ListResourcesInProtectionGroup

instance
  Core.ToHeaders
    ListResourcesInProtectionGroup
  where
  toHeaders :: ListResourcesInProtectionGroup -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> ListResourcesInProtectionGroup -> 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
"AWSShield_20160616.ListResourcesInProtectionGroup" ::
                          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 ListResourcesInProtectionGroup where
  toJSON :: ListResourcesInProtectionGroup -> Value
toJSON ListResourcesInProtectionGroup' {Maybe Natural
Maybe Text
Text
protectionGroupId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:protectionGroupId:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Text
$sel:maxResults:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Maybe Natural
$sel:nextToken:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" 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
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ProtectionGroupId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
protectionGroupId)
          ]
      )

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

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

-- | /See:/ 'newListResourcesInProtectionGroupResponse' smart constructor.
data ListResourcesInProtectionGroupResponse = ListResourcesInProtectionGroupResponse'
  { -- | If you specify a value for @MaxResults@ and you have more resources in
    -- the protection group than the value of MaxResults, Shield Advanced
    -- returns this token that you can use in your next request, to get the
    -- next batch of objects.
    ListResourcesInProtectionGroupResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListResourcesInProtectionGroupResponse -> Int
httpStatus :: Prelude.Int,
    -- | The Amazon Resource Names (ARNs) of the resources that are included in
    -- the protection group.
    ListResourcesInProtectionGroupResponse -> [Text]
resourceArns :: [Prelude.Text]
  }
  deriving (ListResourcesInProtectionGroupResponse
-> ListResourcesInProtectionGroupResponse -> Bool
(ListResourcesInProtectionGroupResponse
 -> ListResourcesInProtectionGroupResponse -> Bool)
-> (ListResourcesInProtectionGroupResponse
    -> ListResourcesInProtectionGroupResponse -> Bool)
-> Eq ListResourcesInProtectionGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListResourcesInProtectionGroupResponse
-> ListResourcesInProtectionGroupResponse -> Bool
$c/= :: ListResourcesInProtectionGroupResponse
-> ListResourcesInProtectionGroupResponse -> Bool
== :: ListResourcesInProtectionGroupResponse
-> ListResourcesInProtectionGroupResponse -> Bool
$c== :: ListResourcesInProtectionGroupResponse
-> ListResourcesInProtectionGroupResponse -> Bool
Prelude.Eq, ReadPrec [ListResourcesInProtectionGroupResponse]
ReadPrec ListResourcesInProtectionGroupResponse
Int -> ReadS ListResourcesInProtectionGroupResponse
ReadS [ListResourcesInProtectionGroupResponse]
(Int -> ReadS ListResourcesInProtectionGroupResponse)
-> ReadS [ListResourcesInProtectionGroupResponse]
-> ReadPrec ListResourcesInProtectionGroupResponse
-> ReadPrec [ListResourcesInProtectionGroupResponse]
-> Read ListResourcesInProtectionGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListResourcesInProtectionGroupResponse]
$creadListPrec :: ReadPrec [ListResourcesInProtectionGroupResponse]
readPrec :: ReadPrec ListResourcesInProtectionGroupResponse
$creadPrec :: ReadPrec ListResourcesInProtectionGroupResponse
readList :: ReadS [ListResourcesInProtectionGroupResponse]
$creadList :: ReadS [ListResourcesInProtectionGroupResponse]
readsPrec :: Int -> ReadS ListResourcesInProtectionGroupResponse
$creadsPrec :: Int -> ReadS ListResourcesInProtectionGroupResponse
Prelude.Read, Int -> ListResourcesInProtectionGroupResponse -> ShowS
[ListResourcesInProtectionGroupResponse] -> ShowS
ListResourcesInProtectionGroupResponse -> String
(Int -> ListResourcesInProtectionGroupResponse -> ShowS)
-> (ListResourcesInProtectionGroupResponse -> String)
-> ([ListResourcesInProtectionGroupResponse] -> ShowS)
-> Show ListResourcesInProtectionGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListResourcesInProtectionGroupResponse] -> ShowS
$cshowList :: [ListResourcesInProtectionGroupResponse] -> ShowS
show :: ListResourcesInProtectionGroupResponse -> String
$cshow :: ListResourcesInProtectionGroupResponse -> String
showsPrec :: Int -> ListResourcesInProtectionGroupResponse -> ShowS
$cshowsPrec :: Int -> ListResourcesInProtectionGroupResponse -> ShowS
Prelude.Show, (forall x.
 ListResourcesInProtectionGroupResponse
 -> Rep ListResourcesInProtectionGroupResponse x)
-> (forall x.
    Rep ListResourcesInProtectionGroupResponse x
    -> ListResourcesInProtectionGroupResponse)
-> Generic ListResourcesInProtectionGroupResponse
forall x.
Rep ListResourcesInProtectionGroupResponse x
-> ListResourcesInProtectionGroupResponse
forall x.
ListResourcesInProtectionGroupResponse
-> Rep ListResourcesInProtectionGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListResourcesInProtectionGroupResponse x
-> ListResourcesInProtectionGroupResponse
$cfrom :: forall x.
ListResourcesInProtectionGroupResponse
-> Rep ListResourcesInProtectionGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListResourcesInProtectionGroupResponse' 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', 'listResourcesInProtectionGroupResponse_nextToken' - If you specify a value for @MaxResults@ and you have more resources in
-- the protection group than the value of MaxResults, Shield Advanced
-- returns this token that you can use in your next request, to get the
-- next batch of objects.
--
-- 'httpStatus', 'listResourcesInProtectionGroupResponse_httpStatus' - The response's http status code.
--
-- 'resourceArns', 'listResourcesInProtectionGroupResponse_resourceArns' - The Amazon Resource Names (ARNs) of the resources that are included in
-- the protection group.
newListResourcesInProtectionGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListResourcesInProtectionGroupResponse
newListResourcesInProtectionGroupResponse :: Int -> ListResourcesInProtectionGroupResponse
newListResourcesInProtectionGroupResponse
  Int
pHttpStatus_ =
    ListResourcesInProtectionGroupResponse' :: Maybe Text
-> Int -> [Text] -> ListResourcesInProtectionGroupResponse
ListResourcesInProtectionGroupResponse'
      { $sel:nextToken:ListResourcesInProtectionGroupResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListResourcesInProtectionGroupResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:resourceArns:ListResourcesInProtectionGroupResponse' :: [Text]
resourceArns = [Text]
forall a. Monoid a => a
Prelude.mempty
      }

-- | If you specify a value for @MaxResults@ and you have more resources in
-- the protection group than the value of MaxResults, Shield Advanced
-- returns this token that you can use in your next request, to get the
-- next batch of objects.
listResourcesInProtectionGroupResponse_nextToken :: Lens.Lens' ListResourcesInProtectionGroupResponse (Prelude.Maybe Prelude.Text)
listResourcesInProtectionGroupResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListResourcesInProtectionGroupResponse
-> f ListResourcesInProtectionGroupResponse
listResourcesInProtectionGroupResponse_nextToken = (ListResourcesInProtectionGroupResponse -> Maybe Text)
-> (ListResourcesInProtectionGroupResponse
    -> Maybe Text -> ListResourcesInProtectionGroupResponse)
-> Lens
     ListResourcesInProtectionGroupResponse
     ListResourcesInProtectionGroupResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourcesInProtectionGroupResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListResourcesInProtectionGroupResponse' :: ListResourcesInProtectionGroupResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListResourcesInProtectionGroupResponse
s@ListResourcesInProtectionGroupResponse' {} Maybe Text
a -> ListResourcesInProtectionGroupResponse
s {$sel:nextToken:ListResourcesInProtectionGroupResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListResourcesInProtectionGroupResponse)

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

-- | The Amazon Resource Names (ARNs) of the resources that are included in
-- the protection group.
listResourcesInProtectionGroupResponse_resourceArns :: Lens.Lens' ListResourcesInProtectionGroupResponse [Prelude.Text]
listResourcesInProtectionGroupResponse_resourceArns :: ([Text] -> f [Text])
-> ListResourcesInProtectionGroupResponse
-> f ListResourcesInProtectionGroupResponse
listResourcesInProtectionGroupResponse_resourceArns = (ListResourcesInProtectionGroupResponse -> [Text])
-> (ListResourcesInProtectionGroupResponse
    -> [Text] -> ListResourcesInProtectionGroupResponse)
-> Lens
     ListResourcesInProtectionGroupResponse
     ListResourcesInProtectionGroupResponse
     [Text]
     [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourcesInProtectionGroupResponse' {[Text]
resourceArns :: [Text]
$sel:resourceArns:ListResourcesInProtectionGroupResponse' :: ListResourcesInProtectionGroupResponse -> [Text]
resourceArns} -> [Text]
resourceArns) (\s :: ListResourcesInProtectionGroupResponse
s@ListResourcesInProtectionGroupResponse' {} [Text]
a -> ListResourcesInProtectionGroupResponse
s {$sel:resourceArns:ListResourcesInProtectionGroupResponse' :: [Text]
resourceArns = [Text]
a} :: ListResourcesInProtectionGroupResponse) (([Text] -> f [Text])
 -> ListResourcesInProtectionGroupResponse
 -> f ListResourcesInProtectionGroupResponse)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ListResourcesInProtectionGroupResponse
-> f ListResourcesInProtectionGroupResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListResourcesInProtectionGroupResponse