{-# 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.DisassociateWebACL
(
DisassociateWebACL (..),
newDisassociateWebACL,
disassociateWebACL_resourceArn,
DisassociateWebACLResponse (..),
newDisassociateWebACLResponse,
disassociateWebACLResponse_httpStatus,
)
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.WAFRegional.Types
data DisassociateWebACL = DisassociateWebACL'
{
DisassociateWebACL -> Text
resourceArn :: Prelude.Text
}
deriving (DisassociateWebACL -> DisassociateWebACL -> Bool
(DisassociateWebACL -> DisassociateWebACL -> Bool)
-> (DisassociateWebACL -> DisassociateWebACL -> Bool)
-> Eq DisassociateWebACL
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateWebACL -> DisassociateWebACL -> Bool
$c/= :: DisassociateWebACL -> DisassociateWebACL -> Bool
== :: DisassociateWebACL -> DisassociateWebACL -> Bool
$c== :: DisassociateWebACL -> DisassociateWebACL -> Bool
Prelude.Eq, ReadPrec [DisassociateWebACL]
ReadPrec DisassociateWebACL
Int -> ReadS DisassociateWebACL
ReadS [DisassociateWebACL]
(Int -> ReadS DisassociateWebACL)
-> ReadS [DisassociateWebACL]
-> ReadPrec DisassociateWebACL
-> ReadPrec [DisassociateWebACL]
-> Read DisassociateWebACL
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateWebACL]
$creadListPrec :: ReadPrec [DisassociateWebACL]
readPrec :: ReadPrec DisassociateWebACL
$creadPrec :: ReadPrec DisassociateWebACL
readList :: ReadS [DisassociateWebACL]
$creadList :: ReadS [DisassociateWebACL]
readsPrec :: Int -> ReadS DisassociateWebACL
$creadsPrec :: Int -> ReadS DisassociateWebACL
Prelude.Read, Int -> DisassociateWebACL -> ShowS
[DisassociateWebACL] -> ShowS
DisassociateWebACL -> String
(Int -> DisassociateWebACL -> ShowS)
-> (DisassociateWebACL -> String)
-> ([DisassociateWebACL] -> ShowS)
-> Show DisassociateWebACL
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateWebACL] -> ShowS
$cshowList :: [DisassociateWebACL] -> ShowS
show :: DisassociateWebACL -> String
$cshow :: DisassociateWebACL -> String
showsPrec :: Int -> DisassociateWebACL -> ShowS
$cshowsPrec :: Int -> DisassociateWebACL -> ShowS
Prelude.Show, (forall x. DisassociateWebACL -> Rep DisassociateWebACL x)
-> (forall x. Rep DisassociateWebACL x -> DisassociateWebACL)
-> Generic DisassociateWebACL
forall x. Rep DisassociateWebACL x -> DisassociateWebACL
forall x. DisassociateWebACL -> Rep DisassociateWebACL x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisassociateWebACL x -> DisassociateWebACL
$cfrom :: forall x. DisassociateWebACL -> Rep DisassociateWebACL x
Prelude.Generic)
newDisassociateWebACL ::
Prelude.Text ->
DisassociateWebACL
newDisassociateWebACL :: Text -> DisassociateWebACL
newDisassociateWebACL Text
pResourceArn_ =
DisassociateWebACL' :: Text -> DisassociateWebACL
DisassociateWebACL' {$sel:resourceArn:DisassociateWebACL' :: Text
resourceArn = Text
pResourceArn_}
disassociateWebACL_resourceArn :: Lens.Lens' DisassociateWebACL Prelude.Text
disassociateWebACL_resourceArn :: (Text -> f Text) -> DisassociateWebACL -> f DisassociateWebACL
disassociateWebACL_resourceArn = (DisassociateWebACL -> Text)
-> (DisassociateWebACL -> Text -> DisassociateWebACL)
-> Lens DisassociateWebACL DisassociateWebACL Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateWebACL' {Text
resourceArn :: Text
$sel:resourceArn:DisassociateWebACL' :: DisassociateWebACL -> Text
resourceArn} -> Text
resourceArn) (\s :: DisassociateWebACL
s@DisassociateWebACL' {} Text
a -> DisassociateWebACL
s {$sel:resourceArn:DisassociateWebACL' :: Text
resourceArn = Text
a} :: DisassociateWebACL)
instance Core.AWSRequest DisassociateWebACL where
type
AWSResponse DisassociateWebACL =
DisassociateWebACLResponse
request :: DisassociateWebACL -> Request DisassociateWebACL
request = Service -> DisassociateWebACL -> Request DisassociateWebACL
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DisassociateWebACL
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateWebACL)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DisassociateWebACL))
-> Logger
-> Service
-> Proxy DisassociateWebACL
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateWebACL)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DisassociateWebACLResponse
DisassociateWebACLResponse'
(Int -> DisassociateWebACLResponse)
-> Either String Int -> Either String DisassociateWebACLResponse
forall (f :: * -> *) a b. Functor 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))
)
instance Prelude.Hashable DisassociateWebACL
instance Prelude.NFData DisassociateWebACL
instance Core.ToHeaders DisassociateWebACL where
toHeaders :: DisassociateWebACL -> ResponseHeaders
toHeaders =
ResponseHeaders -> DisassociateWebACL -> 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
"AWSWAF_Regional_20161128.DisassociateWebACL" ::
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 DisassociateWebACL where
toJSON :: DisassociateWebACL -> Value
toJSON DisassociateWebACL' {Text
resourceArn :: Text
$sel:resourceArn:DisassociateWebACL' :: DisassociateWebACL -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceArn)]
)
instance Core.ToPath DisassociateWebACL where
toPath :: DisassociateWebACL -> ByteString
toPath = ByteString -> DisassociateWebACL -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DisassociateWebACL where
toQuery :: DisassociateWebACL -> QueryString
toQuery = QueryString -> DisassociateWebACL -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DisassociateWebACLResponse = DisassociateWebACLResponse'
{
DisassociateWebACLResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateWebACLResponse -> DisassociateWebACLResponse -> Bool
(DisassociateWebACLResponse -> DisassociateWebACLResponse -> Bool)
-> (DisassociateWebACLResponse
-> DisassociateWebACLResponse -> Bool)
-> Eq DisassociateWebACLResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateWebACLResponse -> DisassociateWebACLResponse -> Bool
$c/= :: DisassociateWebACLResponse -> DisassociateWebACLResponse -> Bool
== :: DisassociateWebACLResponse -> DisassociateWebACLResponse -> Bool
$c== :: DisassociateWebACLResponse -> DisassociateWebACLResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateWebACLResponse]
ReadPrec DisassociateWebACLResponse
Int -> ReadS DisassociateWebACLResponse
ReadS [DisassociateWebACLResponse]
(Int -> ReadS DisassociateWebACLResponse)
-> ReadS [DisassociateWebACLResponse]
-> ReadPrec DisassociateWebACLResponse
-> ReadPrec [DisassociateWebACLResponse]
-> Read DisassociateWebACLResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateWebACLResponse]
$creadListPrec :: ReadPrec [DisassociateWebACLResponse]
readPrec :: ReadPrec DisassociateWebACLResponse
$creadPrec :: ReadPrec DisassociateWebACLResponse
readList :: ReadS [DisassociateWebACLResponse]
$creadList :: ReadS [DisassociateWebACLResponse]
readsPrec :: Int -> ReadS DisassociateWebACLResponse
$creadsPrec :: Int -> ReadS DisassociateWebACLResponse
Prelude.Read, Int -> DisassociateWebACLResponse -> ShowS
[DisassociateWebACLResponse] -> ShowS
DisassociateWebACLResponse -> String
(Int -> DisassociateWebACLResponse -> ShowS)
-> (DisassociateWebACLResponse -> String)
-> ([DisassociateWebACLResponse] -> ShowS)
-> Show DisassociateWebACLResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateWebACLResponse] -> ShowS
$cshowList :: [DisassociateWebACLResponse] -> ShowS
show :: DisassociateWebACLResponse -> String
$cshow :: DisassociateWebACLResponse -> String
showsPrec :: Int -> DisassociateWebACLResponse -> ShowS
$cshowsPrec :: Int -> DisassociateWebACLResponse -> ShowS
Prelude.Show, (forall x.
DisassociateWebACLResponse -> Rep DisassociateWebACLResponse x)
-> (forall x.
Rep DisassociateWebACLResponse x -> DisassociateWebACLResponse)
-> Generic DisassociateWebACLResponse
forall x.
Rep DisassociateWebACLResponse x -> DisassociateWebACLResponse
forall x.
DisassociateWebACLResponse -> Rep DisassociateWebACLResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateWebACLResponse x -> DisassociateWebACLResponse
$cfrom :: forall x.
DisassociateWebACLResponse -> Rep DisassociateWebACLResponse x
Prelude.Generic)
newDisassociateWebACLResponse ::
Prelude.Int ->
DisassociateWebACLResponse
newDisassociateWebACLResponse :: Int -> DisassociateWebACLResponse
newDisassociateWebACLResponse Int
pHttpStatus_ =
DisassociateWebACLResponse' :: Int -> DisassociateWebACLResponse
DisassociateWebACLResponse'
{ $sel:httpStatus:DisassociateWebACLResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
disassociateWebACLResponse_httpStatus :: Lens.Lens' DisassociateWebACLResponse Prelude.Int
disassociateWebACLResponse_httpStatus :: (Int -> f Int)
-> DisassociateWebACLResponse -> f DisassociateWebACLResponse
disassociateWebACLResponse_httpStatus = (DisassociateWebACLResponse -> Int)
-> (DisassociateWebACLResponse
-> Int -> DisassociateWebACLResponse)
-> Lens
DisassociateWebACLResponse DisassociateWebACLResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateWebACLResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateWebACLResponse' :: DisassociateWebACLResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateWebACLResponse
s@DisassociateWebACLResponse' {} Int
a -> DisassociateWebACLResponse
s {$sel:httpStatus:DisassociateWebACLResponse' :: Int
httpStatus = Int
a} :: DisassociateWebACLResponse)
instance Prelude.NFData DisassociateWebACLResponse