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