{-# 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.DeleteProtectionGroup
(
DeleteProtectionGroup (..),
newDeleteProtectionGroup,
deleteProtectionGroup_protectionGroupId,
DeleteProtectionGroupResponse (..),
newDeleteProtectionGroupResponse,
deleteProtectionGroupResponse_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.Shield.Types
data DeleteProtectionGroup = DeleteProtectionGroup'
{
DeleteProtectionGroup -> Text
protectionGroupId :: Prelude.Text
}
deriving (DeleteProtectionGroup -> DeleteProtectionGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProtectionGroup -> DeleteProtectionGroup -> Bool
$c/= :: DeleteProtectionGroup -> DeleteProtectionGroup -> Bool
== :: DeleteProtectionGroup -> DeleteProtectionGroup -> Bool
$c== :: DeleteProtectionGroup -> DeleteProtectionGroup -> Bool
Prelude.Eq, ReadPrec [DeleteProtectionGroup]
ReadPrec DeleteProtectionGroup
Int -> ReadS DeleteProtectionGroup
ReadS [DeleteProtectionGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProtectionGroup]
$creadListPrec :: ReadPrec [DeleteProtectionGroup]
readPrec :: ReadPrec DeleteProtectionGroup
$creadPrec :: ReadPrec DeleteProtectionGroup
readList :: ReadS [DeleteProtectionGroup]
$creadList :: ReadS [DeleteProtectionGroup]
readsPrec :: Int -> ReadS DeleteProtectionGroup
$creadsPrec :: Int -> ReadS DeleteProtectionGroup
Prelude.Read, Int -> DeleteProtectionGroup -> ShowS
[DeleteProtectionGroup] -> ShowS
DeleteProtectionGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProtectionGroup] -> ShowS
$cshowList :: [DeleteProtectionGroup] -> ShowS
show :: DeleteProtectionGroup -> String
$cshow :: DeleteProtectionGroup -> String
showsPrec :: Int -> DeleteProtectionGroup -> ShowS
$cshowsPrec :: Int -> DeleteProtectionGroup -> ShowS
Prelude.Show, forall x. Rep DeleteProtectionGroup x -> DeleteProtectionGroup
forall x. DeleteProtectionGroup -> Rep DeleteProtectionGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteProtectionGroup x -> DeleteProtectionGroup
$cfrom :: forall x. DeleteProtectionGroup -> Rep DeleteProtectionGroup x
Prelude.Generic)
newDeleteProtectionGroup ::
Prelude.Text ->
DeleteProtectionGroup
newDeleteProtectionGroup :: Text -> DeleteProtectionGroup
newDeleteProtectionGroup Text
pProtectionGroupId_ =
DeleteProtectionGroup'
{ $sel:protectionGroupId:DeleteProtectionGroup' :: Text
protectionGroupId =
Text
pProtectionGroupId_
}
deleteProtectionGroup_protectionGroupId :: Lens.Lens' DeleteProtectionGroup Prelude.Text
deleteProtectionGroup_protectionGroupId :: Lens' DeleteProtectionGroup Text
deleteProtectionGroup_protectionGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProtectionGroup' {Text
protectionGroupId :: Text
$sel:protectionGroupId:DeleteProtectionGroup' :: DeleteProtectionGroup -> Text
protectionGroupId} -> Text
protectionGroupId) (\s :: DeleteProtectionGroup
s@DeleteProtectionGroup' {} Text
a -> DeleteProtectionGroup
s {$sel:protectionGroupId:DeleteProtectionGroup' :: Text
protectionGroupId = Text
a} :: DeleteProtectionGroup)
instance Core.AWSRequest DeleteProtectionGroup where
type
AWSResponse DeleteProtectionGroup =
DeleteProtectionGroupResponse
request :: (Service -> Service)
-> DeleteProtectionGroup -> Request DeleteProtectionGroup
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 DeleteProtectionGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteProtectionGroup)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteProtectionGroupResponse
DeleteProtectionGroupResponse'
forall (f :: * -> *) a b. Functor 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 DeleteProtectionGroup where
hashWithSalt :: Int -> DeleteProtectionGroup -> Int
hashWithSalt Int
_salt DeleteProtectionGroup' {Text
protectionGroupId :: Text
$sel:protectionGroupId:DeleteProtectionGroup' :: DeleteProtectionGroup -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
protectionGroupId
instance Prelude.NFData DeleteProtectionGroup where
rnf :: DeleteProtectionGroup -> ()
rnf DeleteProtectionGroup' {Text
protectionGroupId :: Text
$sel:protectionGroupId:DeleteProtectionGroup' :: DeleteProtectionGroup -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
protectionGroupId
instance Data.ToHeaders DeleteProtectionGroup where
toHeaders :: DeleteProtectionGroup -> 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.DeleteProtectionGroup" ::
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 DeleteProtectionGroup where
toJSON :: DeleteProtectionGroup -> Value
toJSON DeleteProtectionGroup' {Text
protectionGroupId :: Text
$sel:protectionGroupId:DeleteProtectionGroup' :: DeleteProtectionGroup -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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 DeleteProtectionGroup where
toPath :: DeleteProtectionGroup -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteProtectionGroup where
toQuery :: DeleteProtectionGroup -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteProtectionGroupResponse = DeleteProtectionGroupResponse'
{
DeleteProtectionGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteProtectionGroupResponse
-> DeleteProtectionGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProtectionGroupResponse
-> DeleteProtectionGroupResponse -> Bool
$c/= :: DeleteProtectionGroupResponse
-> DeleteProtectionGroupResponse -> Bool
== :: DeleteProtectionGroupResponse
-> DeleteProtectionGroupResponse -> Bool
$c== :: DeleteProtectionGroupResponse
-> DeleteProtectionGroupResponse -> Bool
Prelude.Eq, ReadPrec [DeleteProtectionGroupResponse]
ReadPrec DeleteProtectionGroupResponse
Int -> ReadS DeleteProtectionGroupResponse
ReadS [DeleteProtectionGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProtectionGroupResponse]
$creadListPrec :: ReadPrec [DeleteProtectionGroupResponse]
readPrec :: ReadPrec DeleteProtectionGroupResponse
$creadPrec :: ReadPrec DeleteProtectionGroupResponse
readList :: ReadS [DeleteProtectionGroupResponse]
$creadList :: ReadS [DeleteProtectionGroupResponse]
readsPrec :: Int -> ReadS DeleteProtectionGroupResponse
$creadsPrec :: Int -> ReadS DeleteProtectionGroupResponse
Prelude.Read, Int -> DeleteProtectionGroupResponse -> ShowS
[DeleteProtectionGroupResponse] -> ShowS
DeleteProtectionGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProtectionGroupResponse] -> ShowS
$cshowList :: [DeleteProtectionGroupResponse] -> ShowS
show :: DeleteProtectionGroupResponse -> String
$cshow :: DeleteProtectionGroupResponse -> String
showsPrec :: Int -> DeleteProtectionGroupResponse -> ShowS
$cshowsPrec :: Int -> DeleteProtectionGroupResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteProtectionGroupResponse x
-> DeleteProtectionGroupResponse
forall x.
DeleteProtectionGroupResponse
-> Rep DeleteProtectionGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteProtectionGroupResponse x
-> DeleteProtectionGroupResponse
$cfrom :: forall x.
DeleteProtectionGroupResponse
-> Rep DeleteProtectionGroupResponse x
Prelude.Generic)
newDeleteProtectionGroupResponse ::
Prelude.Int ->
DeleteProtectionGroupResponse
newDeleteProtectionGroupResponse :: Int -> DeleteProtectionGroupResponse
newDeleteProtectionGroupResponse Int
pHttpStatus_ =
DeleteProtectionGroupResponse'
{ $sel:httpStatus:DeleteProtectionGroupResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteProtectionGroupResponse_httpStatus :: Lens.Lens' DeleteProtectionGroupResponse Prelude.Int
deleteProtectionGroupResponse_httpStatus :: Lens' DeleteProtectionGroupResponse Int
deleteProtectionGroupResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProtectionGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteProtectionGroupResponse' :: DeleteProtectionGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteProtectionGroupResponse
s@DeleteProtectionGroupResponse' {} Int
a -> DeleteProtectionGroupResponse
s {$sel:httpStatus:DeleteProtectionGroupResponse' :: Int
httpStatus = Int
a} :: DeleteProtectionGroupResponse)
instance Prelude.NFData DeleteProtectionGroupResponse where
rnf :: DeleteProtectionGroupResponse -> ()
rnf DeleteProtectionGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteProtectionGroupResponse' :: DeleteProtectionGroupResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus