{-# 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.AuditManager.DeleteControl
(
DeleteControl (..),
newDeleteControl,
deleteControl_controlId,
DeleteControlResponse (..),
newDeleteControlResponse,
deleteControlResponse_httpStatus,
)
where
import Amazonka.AuditManager.Types
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
data DeleteControl = DeleteControl'
{
DeleteControl -> Text
controlId :: Prelude.Text
}
deriving (DeleteControl -> DeleteControl -> Bool
(DeleteControl -> DeleteControl -> Bool)
-> (DeleteControl -> DeleteControl -> Bool) -> Eq DeleteControl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteControl -> DeleteControl -> Bool
$c/= :: DeleteControl -> DeleteControl -> Bool
== :: DeleteControl -> DeleteControl -> Bool
$c== :: DeleteControl -> DeleteControl -> Bool
Prelude.Eq, ReadPrec [DeleteControl]
ReadPrec DeleteControl
Int -> ReadS DeleteControl
ReadS [DeleteControl]
(Int -> ReadS DeleteControl)
-> ReadS [DeleteControl]
-> ReadPrec DeleteControl
-> ReadPrec [DeleteControl]
-> Read DeleteControl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteControl]
$creadListPrec :: ReadPrec [DeleteControl]
readPrec :: ReadPrec DeleteControl
$creadPrec :: ReadPrec DeleteControl
readList :: ReadS [DeleteControl]
$creadList :: ReadS [DeleteControl]
readsPrec :: Int -> ReadS DeleteControl
$creadsPrec :: Int -> ReadS DeleteControl
Prelude.Read, Int -> DeleteControl -> ShowS
[DeleteControl] -> ShowS
DeleteControl -> String
(Int -> DeleteControl -> ShowS)
-> (DeleteControl -> String)
-> ([DeleteControl] -> ShowS)
-> Show DeleteControl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteControl] -> ShowS
$cshowList :: [DeleteControl] -> ShowS
show :: DeleteControl -> String
$cshow :: DeleteControl -> String
showsPrec :: Int -> DeleteControl -> ShowS
$cshowsPrec :: Int -> DeleteControl -> ShowS
Prelude.Show, (forall x. DeleteControl -> Rep DeleteControl x)
-> (forall x. Rep DeleteControl x -> DeleteControl)
-> Generic DeleteControl
forall x. Rep DeleteControl x -> DeleteControl
forall x. DeleteControl -> Rep DeleteControl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteControl x -> DeleteControl
$cfrom :: forall x. DeleteControl -> Rep DeleteControl x
Prelude.Generic)
newDeleteControl ::
Prelude.Text ->
DeleteControl
newDeleteControl :: Text -> DeleteControl
newDeleteControl Text
pControlId_ =
DeleteControl' :: Text -> DeleteControl
DeleteControl' {$sel:controlId:DeleteControl' :: Text
controlId = Text
pControlId_}
deleteControl_controlId :: Lens.Lens' DeleteControl Prelude.Text
deleteControl_controlId :: (Text -> f Text) -> DeleteControl -> f DeleteControl
deleteControl_controlId = (DeleteControl -> Text)
-> (DeleteControl -> Text -> DeleteControl)
-> Lens DeleteControl DeleteControl Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteControl' {Text
controlId :: Text
$sel:controlId:DeleteControl' :: DeleteControl -> Text
controlId} -> Text
controlId) (\s :: DeleteControl
s@DeleteControl' {} Text
a -> DeleteControl
s {$sel:controlId:DeleteControl' :: Text
controlId = Text
a} :: DeleteControl)
instance Core.AWSRequest DeleteControl where
type
AWSResponse DeleteControl =
DeleteControlResponse
request :: DeleteControl -> Request DeleteControl
request = Service -> DeleteControl -> Request DeleteControl
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteControl
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteControl)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteControl))
-> Logger
-> Service
-> Proxy DeleteControl
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteControl)))
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 -> DeleteControlResponse
DeleteControlResponse'
(Int -> DeleteControlResponse)
-> Either String Int -> Either String DeleteControlResponse
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 DeleteControl
instance Prelude.NFData DeleteControl
instance Core.ToHeaders DeleteControl where
toHeaders :: DeleteControl -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteControl -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DeleteControl where
toPath :: DeleteControl -> ByteString
toPath DeleteControl' {Text
controlId :: Text
$sel:controlId:DeleteControl' :: DeleteControl -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/controls/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
controlId]
instance Core.ToQuery DeleteControl where
toQuery :: DeleteControl -> QueryString
toQuery = QueryString -> DeleteControl -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteControlResponse = DeleteControlResponse'
{
DeleteControlResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteControlResponse -> DeleteControlResponse -> Bool
(DeleteControlResponse -> DeleteControlResponse -> Bool)
-> (DeleteControlResponse -> DeleteControlResponse -> Bool)
-> Eq DeleteControlResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteControlResponse -> DeleteControlResponse -> Bool
$c/= :: DeleteControlResponse -> DeleteControlResponse -> Bool
== :: DeleteControlResponse -> DeleteControlResponse -> Bool
$c== :: DeleteControlResponse -> DeleteControlResponse -> Bool
Prelude.Eq, ReadPrec [DeleteControlResponse]
ReadPrec DeleteControlResponse
Int -> ReadS DeleteControlResponse
ReadS [DeleteControlResponse]
(Int -> ReadS DeleteControlResponse)
-> ReadS [DeleteControlResponse]
-> ReadPrec DeleteControlResponse
-> ReadPrec [DeleteControlResponse]
-> Read DeleteControlResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteControlResponse]
$creadListPrec :: ReadPrec [DeleteControlResponse]
readPrec :: ReadPrec DeleteControlResponse
$creadPrec :: ReadPrec DeleteControlResponse
readList :: ReadS [DeleteControlResponse]
$creadList :: ReadS [DeleteControlResponse]
readsPrec :: Int -> ReadS DeleteControlResponse
$creadsPrec :: Int -> ReadS DeleteControlResponse
Prelude.Read, Int -> DeleteControlResponse -> ShowS
[DeleteControlResponse] -> ShowS
DeleteControlResponse -> String
(Int -> DeleteControlResponse -> ShowS)
-> (DeleteControlResponse -> String)
-> ([DeleteControlResponse] -> ShowS)
-> Show DeleteControlResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteControlResponse] -> ShowS
$cshowList :: [DeleteControlResponse] -> ShowS
show :: DeleteControlResponse -> String
$cshow :: DeleteControlResponse -> String
showsPrec :: Int -> DeleteControlResponse -> ShowS
$cshowsPrec :: Int -> DeleteControlResponse -> ShowS
Prelude.Show, (forall x. DeleteControlResponse -> Rep DeleteControlResponse x)
-> (forall x. Rep DeleteControlResponse x -> DeleteControlResponse)
-> Generic DeleteControlResponse
forall x. Rep DeleteControlResponse x -> DeleteControlResponse
forall x. DeleteControlResponse -> Rep DeleteControlResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteControlResponse x -> DeleteControlResponse
$cfrom :: forall x. DeleteControlResponse -> Rep DeleteControlResponse x
Prelude.Generic)
newDeleteControlResponse ::
Prelude.Int ->
DeleteControlResponse
newDeleteControlResponse :: Int -> DeleteControlResponse
newDeleteControlResponse Int
pHttpStatus_ =
DeleteControlResponse' :: Int -> DeleteControlResponse
DeleteControlResponse' {$sel:httpStatus:DeleteControlResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteControlResponse_httpStatus :: Lens.Lens' DeleteControlResponse Prelude.Int
deleteControlResponse_httpStatus :: (Int -> f Int) -> DeleteControlResponse -> f DeleteControlResponse
deleteControlResponse_httpStatus = (DeleteControlResponse -> Int)
-> (DeleteControlResponse -> Int -> DeleteControlResponse)
-> Lens DeleteControlResponse DeleteControlResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteControlResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteControlResponse' :: DeleteControlResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteControlResponse
s@DeleteControlResponse' {} Int
a -> DeleteControlResponse
s {$sel:httpStatus:DeleteControlResponse' :: Int
httpStatus = Int
a} :: DeleteControlResponse)
instance Prelude.NFData DeleteControlResponse