{-# 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.WAFRegional.ListResourcesForWebACL
(
ListResourcesForWebACL (..),
newListResourcesForWebACL,
listResourcesForWebACL_resourceType,
listResourcesForWebACL_webACLId,
ListResourcesForWebACLResponse (..),
newListResourcesForWebACLResponse,
listResourcesForWebACLResponse_resourceArns,
listResourcesForWebACLResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WAFRegional.Types
data ListResourcesForWebACL = ListResourcesForWebACL'
{
ListResourcesForWebACL -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
ListResourcesForWebACL -> Text
webACLId :: Prelude.Text
}
deriving (ListResourcesForWebACL -> ListResourcesForWebACL -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListResourcesForWebACL -> ListResourcesForWebACL -> Bool
$c/= :: ListResourcesForWebACL -> ListResourcesForWebACL -> Bool
== :: ListResourcesForWebACL -> ListResourcesForWebACL -> Bool
$c== :: ListResourcesForWebACL -> ListResourcesForWebACL -> Bool
Prelude.Eq, ReadPrec [ListResourcesForWebACL]
ReadPrec ListResourcesForWebACL
Int -> ReadS ListResourcesForWebACL
ReadS [ListResourcesForWebACL]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListResourcesForWebACL]
$creadListPrec :: ReadPrec [ListResourcesForWebACL]
readPrec :: ReadPrec ListResourcesForWebACL
$creadPrec :: ReadPrec ListResourcesForWebACL
readList :: ReadS [ListResourcesForWebACL]
$creadList :: ReadS [ListResourcesForWebACL]
readsPrec :: Int -> ReadS ListResourcesForWebACL
$creadsPrec :: Int -> ReadS ListResourcesForWebACL
Prelude.Read, Int -> ListResourcesForWebACL -> ShowS
[ListResourcesForWebACL] -> ShowS
ListResourcesForWebACL -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListResourcesForWebACL] -> ShowS
$cshowList :: [ListResourcesForWebACL] -> ShowS
show :: ListResourcesForWebACL -> String
$cshow :: ListResourcesForWebACL -> String
showsPrec :: Int -> ListResourcesForWebACL -> ShowS
$cshowsPrec :: Int -> ListResourcesForWebACL -> ShowS
Prelude.Show, forall x. Rep ListResourcesForWebACL x -> ListResourcesForWebACL
forall x. ListResourcesForWebACL -> Rep ListResourcesForWebACL x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListResourcesForWebACL x -> ListResourcesForWebACL
$cfrom :: forall x. ListResourcesForWebACL -> Rep ListResourcesForWebACL x
Prelude.Generic)
newListResourcesForWebACL ::
Prelude.Text ->
ListResourcesForWebACL
newListResourcesForWebACL :: Text -> ListResourcesForWebACL
newListResourcesForWebACL Text
pWebACLId_ =
ListResourcesForWebACL'
{ $sel:resourceType:ListResourcesForWebACL' :: Maybe ResourceType
resourceType =
forall a. Maybe a
Prelude.Nothing,
$sel:webACLId:ListResourcesForWebACL' :: Text
webACLId = Text
pWebACLId_
}
listResourcesForWebACL_resourceType :: Lens.Lens' ListResourcesForWebACL (Prelude.Maybe ResourceType)
listResourcesForWebACL_resourceType :: Lens' ListResourcesForWebACL (Maybe ResourceType)
listResourcesForWebACL_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourcesForWebACL' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:ListResourcesForWebACL' :: ListResourcesForWebACL -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: ListResourcesForWebACL
s@ListResourcesForWebACL' {} Maybe ResourceType
a -> ListResourcesForWebACL
s {$sel:resourceType:ListResourcesForWebACL' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: ListResourcesForWebACL)
listResourcesForWebACL_webACLId :: Lens.Lens' ListResourcesForWebACL Prelude.Text
listResourcesForWebACL_webACLId :: Lens' ListResourcesForWebACL Text
listResourcesForWebACL_webACLId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourcesForWebACL' {Text
webACLId :: Text
$sel:webACLId:ListResourcesForWebACL' :: ListResourcesForWebACL -> Text
webACLId} -> Text
webACLId) (\s :: ListResourcesForWebACL
s@ListResourcesForWebACL' {} Text
a -> ListResourcesForWebACL
s {$sel:webACLId:ListResourcesForWebACL' :: Text
webACLId = Text
a} :: ListResourcesForWebACL)
instance Core.AWSRequest ListResourcesForWebACL where
type
AWSResponse ListResourcesForWebACL =
ListResourcesForWebACLResponse
request :: (Service -> Service)
-> ListResourcesForWebACL -> Request ListResourcesForWebACL
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 ListResourcesForWebACL
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListResourcesForWebACL)))
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 -> ListResourcesForWebACLResponse
ListResourcesForWebACLResponse'
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
"ResourceArns" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListResourcesForWebACL where
hashWithSalt :: Int -> ListResourcesForWebACL -> Int
hashWithSalt Int
_salt ListResourcesForWebACL' {Maybe ResourceType
Text
webACLId :: Text
resourceType :: Maybe ResourceType
$sel:webACLId:ListResourcesForWebACL' :: ListResourcesForWebACL -> Text
$sel:resourceType:ListResourcesForWebACL' :: ListResourcesForWebACL -> Maybe ResourceType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceType
resourceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
webACLId
instance Prelude.NFData ListResourcesForWebACL where
rnf :: ListResourcesForWebACL -> ()
rnf ListResourcesForWebACL' {Maybe ResourceType
Text
webACLId :: Text
resourceType :: Maybe ResourceType
$sel:webACLId:ListResourcesForWebACL' :: ListResourcesForWebACL -> Text
$sel:resourceType:ListResourcesForWebACL' :: ListResourcesForWebACL -> Maybe ResourceType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceType
resourceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
webACLId
instance Data.ToHeaders ListResourcesForWebACL where
toHeaders :: ListResourcesForWebACL -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSWAF_Regional_20161128.ListResourcesForWebACL" ::
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 ListResourcesForWebACL where
toJSON :: ListResourcesForWebACL -> Value
toJSON ListResourcesForWebACL' {Maybe ResourceType
Text
webACLId :: Text
resourceType :: Maybe ResourceType
$sel:webACLId:ListResourcesForWebACL' :: ListResourcesForWebACL -> Text
$sel:resourceType:ListResourcesForWebACL' :: ListResourcesForWebACL -> Maybe ResourceType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ResourceType" 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 ResourceType
resourceType,
forall a. a -> Maybe a
Prelude.Just (Key
"WebACLId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
webACLId)
]
)
instance Data.ToPath ListResourcesForWebACL where
toPath :: ListResourcesForWebACL -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListResourcesForWebACL where
toQuery :: ListResourcesForWebACL -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListResourcesForWebACLResponse = ListResourcesForWebACLResponse'
{
ListResourcesForWebACLResponse -> Maybe [Text]
resourceArns :: Prelude.Maybe [Prelude.Text],
ListResourcesForWebACLResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListResourcesForWebACLResponse
-> ListResourcesForWebACLResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListResourcesForWebACLResponse
-> ListResourcesForWebACLResponse -> Bool
$c/= :: ListResourcesForWebACLResponse
-> ListResourcesForWebACLResponse -> Bool
== :: ListResourcesForWebACLResponse
-> ListResourcesForWebACLResponse -> Bool
$c== :: ListResourcesForWebACLResponse
-> ListResourcesForWebACLResponse -> Bool
Prelude.Eq, ReadPrec [ListResourcesForWebACLResponse]
ReadPrec ListResourcesForWebACLResponse
Int -> ReadS ListResourcesForWebACLResponse
ReadS [ListResourcesForWebACLResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListResourcesForWebACLResponse]
$creadListPrec :: ReadPrec [ListResourcesForWebACLResponse]
readPrec :: ReadPrec ListResourcesForWebACLResponse
$creadPrec :: ReadPrec ListResourcesForWebACLResponse
readList :: ReadS [ListResourcesForWebACLResponse]
$creadList :: ReadS [ListResourcesForWebACLResponse]
readsPrec :: Int -> ReadS ListResourcesForWebACLResponse
$creadsPrec :: Int -> ReadS ListResourcesForWebACLResponse
Prelude.Read, Int -> ListResourcesForWebACLResponse -> ShowS
[ListResourcesForWebACLResponse] -> ShowS
ListResourcesForWebACLResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListResourcesForWebACLResponse] -> ShowS
$cshowList :: [ListResourcesForWebACLResponse] -> ShowS
show :: ListResourcesForWebACLResponse -> String
$cshow :: ListResourcesForWebACLResponse -> String
showsPrec :: Int -> ListResourcesForWebACLResponse -> ShowS
$cshowsPrec :: Int -> ListResourcesForWebACLResponse -> ShowS
Prelude.Show, forall x.
Rep ListResourcesForWebACLResponse x
-> ListResourcesForWebACLResponse
forall x.
ListResourcesForWebACLResponse
-> Rep ListResourcesForWebACLResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListResourcesForWebACLResponse x
-> ListResourcesForWebACLResponse
$cfrom :: forall x.
ListResourcesForWebACLResponse
-> Rep ListResourcesForWebACLResponse x
Prelude.Generic)
newListResourcesForWebACLResponse ::
Prelude.Int ->
ListResourcesForWebACLResponse
newListResourcesForWebACLResponse :: Int -> ListResourcesForWebACLResponse
newListResourcesForWebACLResponse Int
pHttpStatus_ =
ListResourcesForWebACLResponse'
{ $sel:resourceArns:ListResourcesForWebACLResponse' :: Maybe [Text]
resourceArns =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListResourcesForWebACLResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listResourcesForWebACLResponse_resourceArns :: Lens.Lens' ListResourcesForWebACLResponse (Prelude.Maybe [Prelude.Text])
listResourcesForWebACLResponse_resourceArns :: Lens' ListResourcesForWebACLResponse (Maybe [Text])
listResourcesForWebACLResponse_resourceArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourcesForWebACLResponse' {Maybe [Text]
resourceArns :: Maybe [Text]
$sel:resourceArns:ListResourcesForWebACLResponse' :: ListResourcesForWebACLResponse -> Maybe [Text]
resourceArns} -> Maybe [Text]
resourceArns) (\s :: ListResourcesForWebACLResponse
s@ListResourcesForWebACLResponse' {} Maybe [Text]
a -> ListResourcesForWebACLResponse
s {$sel:resourceArns:ListResourcesForWebACLResponse' :: Maybe [Text]
resourceArns = Maybe [Text]
a} :: ListResourcesForWebACLResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listResourcesForWebACLResponse_httpStatus :: Lens.Lens' ListResourcesForWebACLResponse Prelude.Int
listResourcesForWebACLResponse_httpStatus :: Lens' ListResourcesForWebACLResponse Int
listResourcesForWebACLResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourcesForWebACLResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListResourcesForWebACLResponse' :: ListResourcesForWebACLResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListResourcesForWebACLResponse
s@ListResourcesForWebACLResponse' {} Int
a -> ListResourcesForWebACLResponse
s {$sel:httpStatus:ListResourcesForWebACLResponse' :: Int
httpStatus = Int
a} :: ListResourcesForWebACLResponse)
instance
Prelude.NFData
ListResourcesForWebACLResponse
where
rnf :: ListResourcesForWebACLResponse -> ()
rnf ListResourcesForWebACLResponse' {Int
Maybe [Text]
httpStatus :: Int
resourceArns :: Maybe [Text]
$sel:httpStatus:ListResourcesForWebACLResponse' :: ListResourcesForWebACLResponse -> Int
$sel:resourceArns:ListResourcesForWebACLResponse' :: ListResourcesForWebACLResponse -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
resourceArns
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus