{-# 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 #-}
module Amazonka.Shield.ListResourcesInProtectionGroup
(
ListResourcesInProtectionGroup (..),
newListResourcesInProtectionGroup,
listResourcesInProtectionGroup_maxResults,
listResourcesInProtectionGroup_nextToken,
listResourcesInProtectionGroup_protectionGroupId,
ListResourcesInProtectionGroupResponse (..),
newListResourcesInProtectionGroupResponse,
listResourcesInProtectionGroupResponse_nextToken,
listResourcesInProtectionGroupResponse_httpStatus,
listResourcesInProtectionGroupResponse_resourceArns,
)
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
data ListResourcesInProtectionGroup = ListResourcesInProtectionGroup'
{
ListResourcesInProtectionGroup -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListResourcesInProtectionGroup -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListResourcesInProtectionGroup -> Text
protectionGroupId :: Prelude.Text
}
deriving (ListResourcesInProtectionGroup
-> ListResourcesInProtectionGroup -> Bool
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]
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
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.
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)
newListResourcesInProtectionGroup ::
Prelude.Text ->
ListResourcesInProtectionGroup
newListResourcesInProtectionGroup :: Text -> ListResourcesInProtectionGroup
newListResourcesInProtectionGroup Text
pProtectionGroupId_ =
ListResourcesInProtectionGroup'
{ $sel:maxResults:ListResourcesInProtectionGroup' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListResourcesInProtectionGroup' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:protectionGroupId:ListResourcesInProtectionGroup' :: Text
protectionGroupId = Text
pProtectionGroupId_
}
listResourcesInProtectionGroup_maxResults :: Lens.Lens' ListResourcesInProtectionGroup (Prelude.Maybe Prelude.Natural)
listResourcesInProtectionGroup_maxResults :: Lens' ListResourcesInProtectionGroup (Maybe Natural)
listResourcesInProtectionGroup_maxResults = 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)
listResourcesInProtectionGroup_nextToken :: Lens.Lens' ListResourcesInProtectionGroup (Prelude.Maybe Prelude.Text)
listResourcesInProtectionGroup_nextToken :: Lens' ListResourcesInProtectionGroup (Maybe Text)
listResourcesInProtectionGroup_nextToken = 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)
listResourcesInProtectionGroup_protectionGroupId :: Lens.Lens' ListResourcesInProtectionGroup Prelude.Text
listResourcesInProtectionGroup_protectionGroupId :: Lens' ListResourcesInProtectionGroup Text
listResourcesInProtectionGroup_protectionGroupId = 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 :: (Service -> Service)
-> ListResourcesInProtectionGroup
-> Request ListResourcesInProtectionGroup
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 ListResourcesInProtectionGroup
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse ListResourcesInProtectionGroup)))
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 -> [Text] -> ListResourcesInProtectionGroupResponse
ListResourcesInProtectionGroupResponse'
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
"ResourceArns" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance
Prelude.Hashable
ListResourcesInProtectionGroup
where
hashWithSalt :: Int -> ListResourcesInProtectionGroup -> Int
hashWithSalt
Int
_salt
ListResourcesInProtectionGroup' {Maybe Natural
Maybe Text
Text
protectionGroupId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:protectionGroupId:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Text
$sel:nextToken:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Maybe Text
$sel:maxResults:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
protectionGroupId
instance
Prelude.NFData
ListResourcesInProtectionGroup
where
rnf :: ListResourcesInProtectionGroup -> ()
rnf ListResourcesInProtectionGroup' {Maybe Natural
Maybe Text
Text
protectionGroupId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:protectionGroupId:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Text
$sel:nextToken:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Maybe Text
$sel:maxResults:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Maybe Natural
..} =
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
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
protectionGroupId
instance
Data.ToHeaders
ListResourcesInProtectionGroup
where
toHeaders :: ListResourcesInProtectionGroup -> 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.ListResourcesInProtectionGroup" ::
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 ListResourcesInProtectionGroup where
toJSON :: ListResourcesInProtectionGroup -> Value
toJSON ListResourcesInProtectionGroup' {Maybe Natural
Maybe Text
Text
protectionGroupId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:protectionGroupId:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Text
$sel:nextToken:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Maybe Text
$sel:maxResults:ListResourcesInProtectionGroup' :: ListResourcesInProtectionGroup -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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,
forall a. a -> Maybe a
Prelude.Just
(Key
"ProtectionGroupId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
protectionGroupId)
]
)
instance Data.ToPath ListResourcesInProtectionGroup where
toPath :: ListResourcesInProtectionGroup -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListResourcesInProtectionGroup where
toQuery :: ListResourcesInProtectionGroup -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListResourcesInProtectionGroupResponse = ListResourcesInProtectionGroupResponse'
{
ListResourcesInProtectionGroupResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListResourcesInProtectionGroupResponse -> Int
httpStatus :: Prelude.Int,
ListResourcesInProtectionGroupResponse -> [Text]
resourceArns :: [Prelude.Text]
}
deriving (ListResourcesInProtectionGroupResponse
-> ListResourcesInProtectionGroupResponse -> Bool
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]
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
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.
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)
newListResourcesInProtectionGroupResponse ::
Prelude.Int ->
ListResourcesInProtectionGroupResponse
newListResourcesInProtectionGroupResponse :: Int -> ListResourcesInProtectionGroupResponse
newListResourcesInProtectionGroupResponse
Int
pHttpStatus_ =
ListResourcesInProtectionGroupResponse'
{ $sel:nextToken:ListResourcesInProtectionGroupResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListResourcesInProtectionGroupResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:resourceArns:ListResourcesInProtectionGroupResponse' :: [Text]
resourceArns = forall a. Monoid a => a
Prelude.mempty
}
listResourcesInProtectionGroupResponse_nextToken :: Lens.Lens' ListResourcesInProtectionGroupResponse (Prelude.Maybe Prelude.Text)
listResourcesInProtectionGroupResponse_nextToken :: Lens' ListResourcesInProtectionGroupResponse (Maybe Text)
listResourcesInProtectionGroupResponse_nextToken = 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)
listResourcesInProtectionGroupResponse_httpStatus :: Lens.Lens' ListResourcesInProtectionGroupResponse Prelude.Int
listResourcesInProtectionGroupResponse_httpStatus :: Lens' ListResourcesInProtectionGroupResponse Int
listResourcesInProtectionGroupResponse_httpStatus = 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)
listResourcesInProtectionGroupResponse_resourceArns :: Lens.Lens' ListResourcesInProtectionGroupResponse [Prelude.Text]
listResourcesInProtectionGroupResponse_resourceArns :: Lens' ListResourcesInProtectionGroupResponse [Text]
listResourcesInProtectionGroupResponse_resourceArns = 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) 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
ListResourcesInProtectionGroupResponse
where
rnf :: ListResourcesInProtectionGroupResponse -> ()
rnf ListResourcesInProtectionGroupResponse' {Int
[Text]
Maybe Text
resourceArns :: [Text]
httpStatus :: Int
nextToken :: Maybe Text
$sel:resourceArns:ListResourcesInProtectionGroupResponse' :: ListResourcesInProtectionGroupResponse -> [Text]
$sel:httpStatus:ListResourcesInProtectionGroupResponse' :: ListResourcesInProtectionGroupResponse -> Int
$sel:nextToken:ListResourcesInProtectionGroupResponse' :: ListResourcesInProtectionGroupResponse -> 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 [Text]
resourceArns