{-# 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.DeleteRuleGroup
(
DeleteRuleGroup (..),
newDeleteRuleGroup,
deleteRuleGroup_ruleGroupId,
deleteRuleGroup_changeToken,
DeleteRuleGroupResponse (..),
newDeleteRuleGroupResponse,
deleteRuleGroupResponse_changeToken,
deleteRuleGroupResponse_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 DeleteRuleGroup = DeleteRuleGroup'
{
DeleteRuleGroup -> Text
ruleGroupId :: Prelude.Text,
DeleteRuleGroup -> Text
changeToken :: Prelude.Text
}
deriving (DeleteRuleGroup -> DeleteRuleGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRuleGroup -> DeleteRuleGroup -> Bool
$c/= :: DeleteRuleGroup -> DeleteRuleGroup -> Bool
== :: DeleteRuleGroup -> DeleteRuleGroup -> Bool
$c== :: DeleteRuleGroup -> DeleteRuleGroup -> Bool
Prelude.Eq, ReadPrec [DeleteRuleGroup]
ReadPrec DeleteRuleGroup
Int -> ReadS DeleteRuleGroup
ReadS [DeleteRuleGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRuleGroup]
$creadListPrec :: ReadPrec [DeleteRuleGroup]
readPrec :: ReadPrec DeleteRuleGroup
$creadPrec :: ReadPrec DeleteRuleGroup
readList :: ReadS [DeleteRuleGroup]
$creadList :: ReadS [DeleteRuleGroup]
readsPrec :: Int -> ReadS DeleteRuleGroup
$creadsPrec :: Int -> ReadS DeleteRuleGroup
Prelude.Read, Int -> DeleteRuleGroup -> ShowS
[DeleteRuleGroup] -> ShowS
DeleteRuleGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRuleGroup] -> ShowS
$cshowList :: [DeleteRuleGroup] -> ShowS
show :: DeleteRuleGroup -> String
$cshow :: DeleteRuleGroup -> String
showsPrec :: Int -> DeleteRuleGroup -> ShowS
$cshowsPrec :: Int -> DeleteRuleGroup -> ShowS
Prelude.Show, forall x. Rep DeleteRuleGroup x -> DeleteRuleGroup
forall x. DeleteRuleGroup -> Rep DeleteRuleGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRuleGroup x -> DeleteRuleGroup
$cfrom :: forall x. DeleteRuleGroup -> Rep DeleteRuleGroup x
Prelude.Generic)
newDeleteRuleGroup ::
Prelude.Text ->
Prelude.Text ->
DeleteRuleGroup
newDeleteRuleGroup :: Text -> Text -> DeleteRuleGroup
newDeleteRuleGroup Text
pRuleGroupId_ Text
pChangeToken_ =
DeleteRuleGroup'
{ $sel:ruleGroupId:DeleteRuleGroup' :: Text
ruleGroupId = Text
pRuleGroupId_,
$sel:changeToken:DeleteRuleGroup' :: Text
changeToken = Text
pChangeToken_
}
deleteRuleGroup_ruleGroupId :: Lens.Lens' DeleteRuleGroup Prelude.Text
deleteRuleGroup_ruleGroupId :: Lens' DeleteRuleGroup Text
deleteRuleGroup_ruleGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRuleGroup' {Text
ruleGroupId :: Text
$sel:ruleGroupId:DeleteRuleGroup' :: DeleteRuleGroup -> Text
ruleGroupId} -> Text
ruleGroupId) (\s :: DeleteRuleGroup
s@DeleteRuleGroup' {} Text
a -> DeleteRuleGroup
s {$sel:ruleGroupId:DeleteRuleGroup' :: Text
ruleGroupId = Text
a} :: DeleteRuleGroup)
deleteRuleGroup_changeToken :: Lens.Lens' DeleteRuleGroup Prelude.Text
deleteRuleGroup_changeToken :: Lens' DeleteRuleGroup Text
deleteRuleGroup_changeToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRuleGroup' {Text
changeToken :: Text
$sel:changeToken:DeleteRuleGroup' :: DeleteRuleGroup -> Text
changeToken} -> Text
changeToken) (\s :: DeleteRuleGroup
s@DeleteRuleGroup' {} Text
a -> DeleteRuleGroup
s {$sel:changeToken:DeleteRuleGroup' :: Text
changeToken = Text
a} :: DeleteRuleGroup)
instance Core.AWSRequest DeleteRuleGroup where
type
AWSResponse DeleteRuleGroup =
DeleteRuleGroupResponse
request :: (Service -> Service) -> DeleteRuleGroup -> Request DeleteRuleGroup
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 DeleteRuleGroup
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteRuleGroup)))
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 -> DeleteRuleGroupResponse
DeleteRuleGroupResponse'
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
"ChangeToken")
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 DeleteRuleGroup where
hashWithSalt :: Int -> DeleteRuleGroup -> Int
hashWithSalt Int
_salt DeleteRuleGroup' {Text
changeToken :: Text
ruleGroupId :: Text
$sel:changeToken:DeleteRuleGroup' :: DeleteRuleGroup -> Text
$sel:ruleGroupId:DeleteRuleGroup' :: DeleteRuleGroup -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleGroupId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
changeToken
instance Prelude.NFData DeleteRuleGroup where
rnf :: DeleteRuleGroup -> ()
rnf DeleteRuleGroup' {Text
changeToken :: Text
ruleGroupId :: Text
$sel:changeToken:DeleteRuleGroup' :: DeleteRuleGroup -> Text
$sel:ruleGroupId:DeleteRuleGroup' :: DeleteRuleGroup -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
ruleGroupId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
changeToken
instance Data.ToHeaders DeleteRuleGroup where
toHeaders :: DeleteRuleGroup -> 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.DeleteRuleGroup" ::
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 DeleteRuleGroup where
toJSON :: DeleteRuleGroup -> Value
toJSON DeleteRuleGroup' {Text
changeToken :: Text
ruleGroupId :: Text
$sel:changeToken:DeleteRuleGroup' :: DeleteRuleGroup -> Text
$sel:ruleGroupId:DeleteRuleGroup' :: DeleteRuleGroup -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"RuleGroupId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
ruleGroupId),
forall a. a -> Maybe a
Prelude.Just (Key
"ChangeToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
changeToken)
]
)
instance Data.ToPath DeleteRuleGroup where
toPath :: DeleteRuleGroup -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteRuleGroup where
toQuery :: DeleteRuleGroup -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteRuleGroupResponse = DeleteRuleGroupResponse'
{
DeleteRuleGroupResponse -> Maybe Text
changeToken :: Prelude.Maybe Prelude.Text,
DeleteRuleGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteRuleGroupResponse -> DeleteRuleGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRuleGroupResponse -> DeleteRuleGroupResponse -> Bool
$c/= :: DeleteRuleGroupResponse -> DeleteRuleGroupResponse -> Bool
== :: DeleteRuleGroupResponse -> DeleteRuleGroupResponse -> Bool
$c== :: DeleteRuleGroupResponse -> DeleteRuleGroupResponse -> Bool
Prelude.Eq, ReadPrec [DeleteRuleGroupResponse]
ReadPrec DeleteRuleGroupResponse
Int -> ReadS DeleteRuleGroupResponse
ReadS [DeleteRuleGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRuleGroupResponse]
$creadListPrec :: ReadPrec [DeleteRuleGroupResponse]
readPrec :: ReadPrec DeleteRuleGroupResponse
$creadPrec :: ReadPrec DeleteRuleGroupResponse
readList :: ReadS [DeleteRuleGroupResponse]
$creadList :: ReadS [DeleteRuleGroupResponse]
readsPrec :: Int -> ReadS DeleteRuleGroupResponse
$creadsPrec :: Int -> ReadS DeleteRuleGroupResponse
Prelude.Read, Int -> DeleteRuleGroupResponse -> ShowS
[DeleteRuleGroupResponse] -> ShowS
DeleteRuleGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRuleGroupResponse] -> ShowS
$cshowList :: [DeleteRuleGroupResponse] -> ShowS
show :: DeleteRuleGroupResponse -> String
$cshow :: DeleteRuleGroupResponse -> String
showsPrec :: Int -> DeleteRuleGroupResponse -> ShowS
$cshowsPrec :: Int -> DeleteRuleGroupResponse -> ShowS
Prelude.Show, forall x. Rep DeleteRuleGroupResponse x -> DeleteRuleGroupResponse
forall x. DeleteRuleGroupResponse -> Rep DeleteRuleGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRuleGroupResponse x -> DeleteRuleGroupResponse
$cfrom :: forall x. DeleteRuleGroupResponse -> Rep DeleteRuleGroupResponse x
Prelude.Generic)
newDeleteRuleGroupResponse ::
Prelude.Int ->
DeleteRuleGroupResponse
newDeleteRuleGroupResponse :: Int -> DeleteRuleGroupResponse
newDeleteRuleGroupResponse Int
pHttpStatus_ =
DeleteRuleGroupResponse'
{ $sel:changeToken:DeleteRuleGroupResponse' :: Maybe Text
changeToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteRuleGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteRuleGroupResponse_changeToken :: Lens.Lens' DeleteRuleGroupResponse (Prelude.Maybe Prelude.Text)
deleteRuleGroupResponse_changeToken :: Lens' DeleteRuleGroupResponse (Maybe Text)
deleteRuleGroupResponse_changeToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRuleGroupResponse' {Maybe Text
changeToken :: Maybe Text
$sel:changeToken:DeleteRuleGroupResponse' :: DeleteRuleGroupResponse -> Maybe Text
changeToken} -> Maybe Text
changeToken) (\s :: DeleteRuleGroupResponse
s@DeleteRuleGroupResponse' {} Maybe Text
a -> DeleteRuleGroupResponse
s {$sel:changeToken:DeleteRuleGroupResponse' :: Maybe Text
changeToken = Maybe Text
a} :: DeleteRuleGroupResponse)
deleteRuleGroupResponse_httpStatus :: Lens.Lens' DeleteRuleGroupResponse Prelude.Int
deleteRuleGroupResponse_httpStatus :: Lens' DeleteRuleGroupResponse Int
deleteRuleGroupResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRuleGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteRuleGroupResponse' :: DeleteRuleGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteRuleGroupResponse
s@DeleteRuleGroupResponse' {} Int
a -> DeleteRuleGroupResponse
s {$sel:httpStatus:DeleteRuleGroupResponse' :: Int
httpStatus = Int
a} :: DeleteRuleGroupResponse)
instance Prelude.NFData DeleteRuleGroupResponse where
rnf :: DeleteRuleGroupResponse -> ()
rnf DeleteRuleGroupResponse' {Int
Maybe Text
httpStatus :: Int
changeToken :: Maybe Text
$sel:httpStatus:DeleteRuleGroupResponse' :: DeleteRuleGroupResponse -> Int
$sel:changeToken:DeleteRuleGroupResponse' :: DeleteRuleGroupResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
changeToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus