{-# 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.GetWebACL
(
GetWebACL (..),
newGetWebACL,
getWebACL_webACLId,
GetWebACLResponse (..),
newGetWebACLResponse,
getWebACLResponse_webACL,
getWebACLResponse_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 GetWebACL = GetWebACL'
{
GetWebACL -> Text
webACLId :: Prelude.Text
}
deriving (GetWebACL -> GetWebACL -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetWebACL -> GetWebACL -> Bool
$c/= :: GetWebACL -> GetWebACL -> Bool
== :: GetWebACL -> GetWebACL -> Bool
$c== :: GetWebACL -> GetWebACL -> Bool
Prelude.Eq, ReadPrec [GetWebACL]
ReadPrec GetWebACL
Int -> ReadS GetWebACL
ReadS [GetWebACL]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetWebACL]
$creadListPrec :: ReadPrec [GetWebACL]
readPrec :: ReadPrec GetWebACL
$creadPrec :: ReadPrec GetWebACL
readList :: ReadS [GetWebACL]
$creadList :: ReadS [GetWebACL]
readsPrec :: Int -> ReadS GetWebACL
$creadsPrec :: Int -> ReadS GetWebACL
Prelude.Read, Int -> GetWebACL -> ShowS
[GetWebACL] -> ShowS
GetWebACL -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetWebACL] -> ShowS
$cshowList :: [GetWebACL] -> ShowS
show :: GetWebACL -> String
$cshow :: GetWebACL -> String
showsPrec :: Int -> GetWebACL -> ShowS
$cshowsPrec :: Int -> GetWebACL -> ShowS
Prelude.Show, forall x. Rep GetWebACL x -> GetWebACL
forall x. GetWebACL -> Rep GetWebACL x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetWebACL x -> GetWebACL
$cfrom :: forall x. GetWebACL -> Rep GetWebACL x
Prelude.Generic)
newGetWebACL ::
Prelude.Text ->
GetWebACL
newGetWebACL :: Text -> GetWebACL
newGetWebACL Text
pWebACLId_ =
GetWebACL' {$sel:webACLId:GetWebACL' :: Text
webACLId = Text
pWebACLId_}
getWebACL_webACLId :: Lens.Lens' GetWebACL Prelude.Text
getWebACL_webACLId :: Lens' GetWebACL Text
getWebACL_webACLId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWebACL' {Text
webACLId :: Text
$sel:webACLId:GetWebACL' :: GetWebACL -> Text
webACLId} -> Text
webACLId) (\s :: GetWebACL
s@GetWebACL' {} Text
a -> GetWebACL
s {$sel:webACLId:GetWebACL' :: Text
webACLId = Text
a} :: GetWebACL)
instance Core.AWSRequest GetWebACL where
type AWSResponse GetWebACL = GetWebACLResponse
request :: (Service -> Service) -> GetWebACL -> Request GetWebACL
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 GetWebACL
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetWebACL)))
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 WebACL -> Int -> GetWebACLResponse
GetWebACLResponse'
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
"WebACL")
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 GetWebACL where
hashWithSalt :: Int -> GetWebACL -> Int
hashWithSalt Int
_salt GetWebACL' {Text
webACLId :: Text
$sel:webACLId:GetWebACL' :: GetWebACL -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
webACLId
instance Prelude.NFData GetWebACL where
rnf :: GetWebACL -> ()
rnf GetWebACL' {Text
webACLId :: Text
$sel:webACLId:GetWebACL' :: GetWebACL -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
webACLId
instance Data.ToHeaders GetWebACL where
toHeaders :: GetWebACL -> 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.GetWebACL" ::
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 GetWebACL where
toJSON :: GetWebACL -> Value
toJSON GetWebACL' {Text
webACLId :: Text
$sel:webACLId:GetWebACL' :: GetWebACL -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[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 GetWebACL where
toPath :: GetWebACL -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetWebACL where
toQuery :: GetWebACL -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetWebACLResponse = GetWebACLResponse'
{
GetWebACLResponse -> Maybe WebACL
webACL :: Prelude.Maybe WebACL,
GetWebACLResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetWebACLResponse -> GetWebACLResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetWebACLResponse -> GetWebACLResponse -> Bool
$c/= :: GetWebACLResponse -> GetWebACLResponse -> Bool
== :: GetWebACLResponse -> GetWebACLResponse -> Bool
$c== :: GetWebACLResponse -> GetWebACLResponse -> Bool
Prelude.Eq, ReadPrec [GetWebACLResponse]
ReadPrec GetWebACLResponse
Int -> ReadS GetWebACLResponse
ReadS [GetWebACLResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetWebACLResponse]
$creadListPrec :: ReadPrec [GetWebACLResponse]
readPrec :: ReadPrec GetWebACLResponse
$creadPrec :: ReadPrec GetWebACLResponse
readList :: ReadS [GetWebACLResponse]
$creadList :: ReadS [GetWebACLResponse]
readsPrec :: Int -> ReadS GetWebACLResponse
$creadsPrec :: Int -> ReadS GetWebACLResponse
Prelude.Read, Int -> GetWebACLResponse -> ShowS
[GetWebACLResponse] -> ShowS
GetWebACLResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetWebACLResponse] -> ShowS
$cshowList :: [GetWebACLResponse] -> ShowS
show :: GetWebACLResponse -> String
$cshow :: GetWebACLResponse -> String
showsPrec :: Int -> GetWebACLResponse -> ShowS
$cshowsPrec :: Int -> GetWebACLResponse -> ShowS
Prelude.Show, forall x. Rep GetWebACLResponse x -> GetWebACLResponse
forall x. GetWebACLResponse -> Rep GetWebACLResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetWebACLResponse x -> GetWebACLResponse
$cfrom :: forall x. GetWebACLResponse -> Rep GetWebACLResponse x
Prelude.Generic)
newGetWebACLResponse ::
Prelude.Int ->
GetWebACLResponse
newGetWebACLResponse :: Int -> GetWebACLResponse
newGetWebACLResponse Int
pHttpStatus_ =
GetWebACLResponse'
{ $sel:webACL:GetWebACLResponse' :: Maybe WebACL
webACL = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetWebACLResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getWebACLResponse_webACL :: Lens.Lens' GetWebACLResponse (Prelude.Maybe WebACL)
getWebACLResponse_webACL :: Lens' GetWebACLResponse (Maybe WebACL)
getWebACLResponse_webACL = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWebACLResponse' {Maybe WebACL
webACL :: Maybe WebACL
$sel:webACL:GetWebACLResponse' :: GetWebACLResponse -> Maybe WebACL
webACL} -> Maybe WebACL
webACL) (\s :: GetWebACLResponse
s@GetWebACLResponse' {} Maybe WebACL
a -> GetWebACLResponse
s {$sel:webACL:GetWebACLResponse' :: Maybe WebACL
webACL = Maybe WebACL
a} :: GetWebACLResponse)
getWebACLResponse_httpStatus :: Lens.Lens' GetWebACLResponse Prelude.Int
getWebACLResponse_httpStatus :: Lens' GetWebACLResponse Int
getWebACLResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWebACLResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetWebACLResponse' :: GetWebACLResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetWebACLResponse
s@GetWebACLResponse' {} Int
a -> GetWebACLResponse
s {$sel:httpStatus:GetWebACLResponse' :: Int
httpStatus = Int
a} :: GetWebACLResponse)
instance Prelude.NFData GetWebACLResponse where
rnf :: GetWebACLResponse -> ()
rnf GetWebACLResponse' {Int
Maybe WebACL
httpStatus :: Int
webACL :: Maybe WebACL
$sel:httpStatus:GetWebACLResponse' :: GetWebACLResponse -> Int
$sel:webACL:GetWebACLResponse' :: GetWebACLResponse -> Maybe WebACL
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe WebACL
webACL
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus