{-# 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.CancelDetectMitigationActionsTask
(
CancelDetectMitigationActionsTask (..),
newCancelDetectMitigationActionsTask,
cancelDetectMitigationActionsTask_taskId,
CancelDetectMitigationActionsTaskResponse (..),
newCancelDetectMitigationActionsTaskResponse,
cancelDetectMitigationActionsTaskResponse_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 CancelDetectMitigationActionsTask = CancelDetectMitigationActionsTask'
{
CancelDetectMitigationActionsTask -> Text
taskId :: Prelude.Text
}
deriving (CancelDetectMitigationActionsTask
-> CancelDetectMitigationActionsTask -> Bool
(CancelDetectMitigationActionsTask
-> CancelDetectMitigationActionsTask -> Bool)
-> (CancelDetectMitigationActionsTask
-> CancelDetectMitigationActionsTask -> Bool)
-> Eq CancelDetectMitigationActionsTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelDetectMitigationActionsTask
-> CancelDetectMitigationActionsTask -> Bool
$c/= :: CancelDetectMitigationActionsTask
-> CancelDetectMitigationActionsTask -> Bool
== :: CancelDetectMitigationActionsTask
-> CancelDetectMitigationActionsTask -> Bool
$c== :: CancelDetectMitigationActionsTask
-> CancelDetectMitigationActionsTask -> Bool
Prelude.Eq, ReadPrec [CancelDetectMitigationActionsTask]
ReadPrec CancelDetectMitigationActionsTask
Int -> ReadS CancelDetectMitigationActionsTask
ReadS [CancelDetectMitigationActionsTask]
(Int -> ReadS CancelDetectMitigationActionsTask)
-> ReadS [CancelDetectMitigationActionsTask]
-> ReadPrec CancelDetectMitigationActionsTask
-> ReadPrec [CancelDetectMitigationActionsTask]
-> Read CancelDetectMitigationActionsTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelDetectMitigationActionsTask]
$creadListPrec :: ReadPrec [CancelDetectMitigationActionsTask]
readPrec :: ReadPrec CancelDetectMitigationActionsTask
$creadPrec :: ReadPrec CancelDetectMitigationActionsTask
readList :: ReadS [CancelDetectMitigationActionsTask]
$creadList :: ReadS [CancelDetectMitigationActionsTask]
readsPrec :: Int -> ReadS CancelDetectMitigationActionsTask
$creadsPrec :: Int -> ReadS CancelDetectMitigationActionsTask
Prelude.Read, Int -> CancelDetectMitigationActionsTask -> ShowS
[CancelDetectMitigationActionsTask] -> ShowS
CancelDetectMitigationActionsTask -> String
(Int -> CancelDetectMitigationActionsTask -> ShowS)
-> (CancelDetectMitigationActionsTask -> String)
-> ([CancelDetectMitigationActionsTask] -> ShowS)
-> Show CancelDetectMitigationActionsTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelDetectMitigationActionsTask] -> ShowS
$cshowList :: [CancelDetectMitigationActionsTask] -> ShowS
show :: CancelDetectMitigationActionsTask -> String
$cshow :: CancelDetectMitigationActionsTask -> String
showsPrec :: Int -> CancelDetectMitigationActionsTask -> ShowS
$cshowsPrec :: Int -> CancelDetectMitigationActionsTask -> ShowS
Prelude.Show, (forall x.
CancelDetectMitigationActionsTask
-> Rep CancelDetectMitigationActionsTask x)
-> (forall x.
Rep CancelDetectMitigationActionsTask x
-> CancelDetectMitigationActionsTask)
-> Generic CancelDetectMitigationActionsTask
forall x.
Rep CancelDetectMitigationActionsTask x
-> CancelDetectMitigationActionsTask
forall x.
CancelDetectMitigationActionsTask
-> Rep CancelDetectMitigationActionsTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelDetectMitigationActionsTask x
-> CancelDetectMitigationActionsTask
$cfrom :: forall x.
CancelDetectMitigationActionsTask
-> Rep CancelDetectMitigationActionsTask x
Prelude.Generic)
newCancelDetectMitigationActionsTask ::
Prelude.Text ->
CancelDetectMitigationActionsTask
newCancelDetectMitigationActionsTask :: Text -> CancelDetectMitigationActionsTask
newCancelDetectMitigationActionsTask Text
pTaskId_ =
CancelDetectMitigationActionsTask' :: Text -> CancelDetectMitigationActionsTask
CancelDetectMitigationActionsTask'
{ $sel:taskId:CancelDetectMitigationActionsTask' :: Text
taskId =
Text
pTaskId_
}
cancelDetectMitigationActionsTask_taskId :: Lens.Lens' CancelDetectMitigationActionsTask Prelude.Text
cancelDetectMitigationActionsTask_taskId :: (Text -> f Text)
-> CancelDetectMitigationActionsTask
-> f CancelDetectMitigationActionsTask
cancelDetectMitigationActionsTask_taskId = (CancelDetectMitigationActionsTask -> Text)
-> (CancelDetectMitigationActionsTask
-> Text -> CancelDetectMitigationActionsTask)
-> Lens
CancelDetectMitigationActionsTask
CancelDetectMitigationActionsTask
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelDetectMitigationActionsTask' {Text
taskId :: Text
$sel:taskId:CancelDetectMitigationActionsTask' :: CancelDetectMitigationActionsTask -> Text
taskId} -> Text
taskId) (\s :: CancelDetectMitigationActionsTask
s@CancelDetectMitigationActionsTask' {} Text
a -> CancelDetectMitigationActionsTask
s {$sel:taskId:CancelDetectMitigationActionsTask' :: Text
taskId = Text
a} :: CancelDetectMitigationActionsTask)
instance
Core.AWSRequest
CancelDetectMitigationActionsTask
where
type
AWSResponse CancelDetectMitigationActionsTask =
CancelDetectMitigationActionsTaskResponse
request :: CancelDetectMitigationActionsTask
-> Request CancelDetectMitigationActionsTask
request = Service
-> CancelDetectMitigationActionsTask
-> Request CancelDetectMitigationActionsTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CancelDetectMitigationActionsTask
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CancelDetectMitigationActionsTask)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse CancelDetectMitigationActionsTask))
-> Logger
-> Service
-> Proxy CancelDetectMitigationActionsTask
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CancelDetectMitigationActionsTask)))
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 -> CancelDetectMitigationActionsTaskResponse
CancelDetectMitigationActionsTaskResponse'
(Int -> CancelDetectMitigationActionsTaskResponse)
-> Either String Int
-> Either String CancelDetectMitigationActionsTaskResponse
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
CancelDetectMitigationActionsTask
instance
Prelude.NFData
CancelDetectMitigationActionsTask
instance
Core.ToHeaders
CancelDetectMitigationActionsTask
where
toHeaders :: CancelDetectMitigationActionsTask -> ResponseHeaders
toHeaders = ResponseHeaders
-> CancelDetectMitigationActionsTask -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance
Core.ToJSON
CancelDetectMitigationActionsTask
where
toJSON :: CancelDetectMitigationActionsTask -> Value
toJSON = Value -> CancelDetectMitigationActionsTask -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance
Core.ToPath
CancelDetectMitigationActionsTask
where
toPath :: CancelDetectMitigationActionsTask -> ByteString
toPath CancelDetectMitigationActionsTask' {Text
taskId :: Text
$sel:taskId:CancelDetectMitigationActionsTask' :: CancelDetectMitigationActionsTask -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/detect/mitigationactions/tasks/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
taskId,
ByteString
"/cancel"
]
instance
Core.ToQuery
CancelDetectMitigationActionsTask
where
toQuery :: CancelDetectMitigationActionsTask -> QueryString
toQuery = QueryString -> CancelDetectMitigationActionsTask -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CancelDetectMitigationActionsTaskResponse = CancelDetectMitigationActionsTaskResponse'
{
CancelDetectMitigationActionsTaskResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CancelDetectMitigationActionsTaskResponse
-> CancelDetectMitigationActionsTaskResponse -> Bool
(CancelDetectMitigationActionsTaskResponse
-> CancelDetectMitigationActionsTaskResponse -> Bool)
-> (CancelDetectMitigationActionsTaskResponse
-> CancelDetectMitigationActionsTaskResponse -> Bool)
-> Eq CancelDetectMitigationActionsTaskResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelDetectMitigationActionsTaskResponse
-> CancelDetectMitigationActionsTaskResponse -> Bool
$c/= :: CancelDetectMitigationActionsTaskResponse
-> CancelDetectMitigationActionsTaskResponse -> Bool
== :: CancelDetectMitigationActionsTaskResponse
-> CancelDetectMitigationActionsTaskResponse -> Bool
$c== :: CancelDetectMitigationActionsTaskResponse
-> CancelDetectMitigationActionsTaskResponse -> Bool
Prelude.Eq, ReadPrec [CancelDetectMitigationActionsTaskResponse]
ReadPrec CancelDetectMitigationActionsTaskResponse
Int -> ReadS CancelDetectMitigationActionsTaskResponse
ReadS [CancelDetectMitigationActionsTaskResponse]
(Int -> ReadS CancelDetectMitigationActionsTaskResponse)
-> ReadS [CancelDetectMitigationActionsTaskResponse]
-> ReadPrec CancelDetectMitigationActionsTaskResponse
-> ReadPrec [CancelDetectMitigationActionsTaskResponse]
-> Read CancelDetectMitigationActionsTaskResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelDetectMitigationActionsTaskResponse]
$creadListPrec :: ReadPrec [CancelDetectMitigationActionsTaskResponse]
readPrec :: ReadPrec CancelDetectMitigationActionsTaskResponse
$creadPrec :: ReadPrec CancelDetectMitigationActionsTaskResponse
readList :: ReadS [CancelDetectMitigationActionsTaskResponse]
$creadList :: ReadS [CancelDetectMitigationActionsTaskResponse]
readsPrec :: Int -> ReadS CancelDetectMitigationActionsTaskResponse
$creadsPrec :: Int -> ReadS CancelDetectMitigationActionsTaskResponse
Prelude.Read, Int -> CancelDetectMitigationActionsTaskResponse -> ShowS
[CancelDetectMitigationActionsTaskResponse] -> ShowS
CancelDetectMitigationActionsTaskResponse -> String
(Int -> CancelDetectMitigationActionsTaskResponse -> ShowS)
-> (CancelDetectMitigationActionsTaskResponse -> String)
-> ([CancelDetectMitigationActionsTaskResponse] -> ShowS)
-> Show CancelDetectMitigationActionsTaskResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelDetectMitigationActionsTaskResponse] -> ShowS
$cshowList :: [CancelDetectMitigationActionsTaskResponse] -> ShowS
show :: CancelDetectMitigationActionsTaskResponse -> String
$cshow :: CancelDetectMitigationActionsTaskResponse -> String
showsPrec :: Int -> CancelDetectMitigationActionsTaskResponse -> ShowS
$cshowsPrec :: Int -> CancelDetectMitigationActionsTaskResponse -> ShowS
Prelude.Show, (forall x.
CancelDetectMitigationActionsTaskResponse
-> Rep CancelDetectMitigationActionsTaskResponse x)
-> (forall x.
Rep CancelDetectMitigationActionsTaskResponse x
-> CancelDetectMitigationActionsTaskResponse)
-> Generic CancelDetectMitigationActionsTaskResponse
forall x.
Rep CancelDetectMitigationActionsTaskResponse x
-> CancelDetectMitigationActionsTaskResponse
forall x.
CancelDetectMitigationActionsTaskResponse
-> Rep CancelDetectMitigationActionsTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelDetectMitigationActionsTaskResponse x
-> CancelDetectMitigationActionsTaskResponse
$cfrom :: forall x.
CancelDetectMitigationActionsTaskResponse
-> Rep CancelDetectMitigationActionsTaskResponse x
Prelude.Generic)
newCancelDetectMitigationActionsTaskResponse ::
Prelude.Int ->
CancelDetectMitigationActionsTaskResponse
newCancelDetectMitigationActionsTaskResponse :: Int -> CancelDetectMitigationActionsTaskResponse
newCancelDetectMitigationActionsTaskResponse
Int
pHttpStatus_ =
CancelDetectMitigationActionsTaskResponse' :: Int -> CancelDetectMitigationActionsTaskResponse
CancelDetectMitigationActionsTaskResponse'
{ $sel:httpStatus:CancelDetectMitigationActionsTaskResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
cancelDetectMitigationActionsTaskResponse_httpStatus :: Lens.Lens' CancelDetectMitigationActionsTaskResponse Prelude.Int
cancelDetectMitigationActionsTaskResponse_httpStatus :: (Int -> f Int)
-> CancelDetectMitigationActionsTaskResponse
-> f CancelDetectMitigationActionsTaskResponse
cancelDetectMitigationActionsTaskResponse_httpStatus = (CancelDetectMitigationActionsTaskResponse -> Int)
-> (CancelDetectMitigationActionsTaskResponse
-> Int -> CancelDetectMitigationActionsTaskResponse)
-> Lens
CancelDetectMitigationActionsTaskResponse
CancelDetectMitigationActionsTaskResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelDetectMitigationActionsTaskResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelDetectMitigationActionsTaskResponse' :: CancelDetectMitigationActionsTaskResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CancelDetectMitigationActionsTaskResponse
s@CancelDetectMitigationActionsTaskResponse' {} Int
a -> CancelDetectMitigationActionsTaskResponse
s {$sel:httpStatus:CancelDetectMitigationActionsTaskResponse' :: Int
httpStatus = Int
a} :: CancelDetectMitigationActionsTaskResponse)
instance
Prelude.NFData
CancelDetectMitigationActionsTaskResponse