{-# 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.StartDetectMitigationActionsTask
(
StartDetectMitigationActionsTask (..),
newStartDetectMitigationActionsTask,
startDetectMitigationActionsTask_violationEventOccurrenceRange,
startDetectMitigationActionsTask_includeOnlyActiveViolations,
startDetectMitigationActionsTask_includeSuppressedAlerts,
startDetectMitigationActionsTask_taskId,
startDetectMitigationActionsTask_target,
startDetectMitigationActionsTask_actions,
startDetectMitigationActionsTask_clientRequestToken,
StartDetectMitigationActionsTaskResponse (..),
newStartDetectMitigationActionsTaskResponse,
startDetectMitigationActionsTaskResponse_taskId,
startDetectMitigationActionsTaskResponse_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 StartDetectMitigationActionsTask = StartDetectMitigationActionsTask'
{
StartDetectMitigationActionsTask
-> Maybe ViolationEventOccurrenceRange
violationEventOccurrenceRange :: Prelude.Maybe ViolationEventOccurrenceRange,
StartDetectMitigationActionsTask -> Maybe Bool
includeOnlyActiveViolations :: Prelude.Maybe Prelude.Bool,
StartDetectMitigationActionsTask -> Maybe Bool
includeSuppressedAlerts :: Prelude.Maybe Prelude.Bool,
StartDetectMitigationActionsTask -> Text
taskId :: Prelude.Text,
StartDetectMitigationActionsTask
-> DetectMitigationActionsTaskTarget
target :: DetectMitigationActionsTaskTarget,
StartDetectMitigationActionsTask -> NonEmpty Text
actions :: Prelude.NonEmpty Prelude.Text,
StartDetectMitigationActionsTask -> Text
clientRequestToken :: Prelude.Text
}
deriving (StartDetectMitigationActionsTask
-> StartDetectMitigationActionsTask -> Bool
(StartDetectMitigationActionsTask
-> StartDetectMitigationActionsTask -> Bool)
-> (StartDetectMitigationActionsTask
-> StartDetectMitigationActionsTask -> Bool)
-> Eq StartDetectMitigationActionsTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartDetectMitigationActionsTask
-> StartDetectMitigationActionsTask -> Bool
$c/= :: StartDetectMitigationActionsTask
-> StartDetectMitigationActionsTask -> Bool
== :: StartDetectMitigationActionsTask
-> StartDetectMitigationActionsTask -> Bool
$c== :: StartDetectMitigationActionsTask
-> StartDetectMitigationActionsTask -> Bool
Prelude.Eq, ReadPrec [StartDetectMitigationActionsTask]
ReadPrec StartDetectMitigationActionsTask
Int -> ReadS StartDetectMitigationActionsTask
ReadS [StartDetectMitigationActionsTask]
(Int -> ReadS StartDetectMitigationActionsTask)
-> ReadS [StartDetectMitigationActionsTask]
-> ReadPrec StartDetectMitigationActionsTask
-> ReadPrec [StartDetectMitigationActionsTask]
-> Read StartDetectMitigationActionsTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartDetectMitigationActionsTask]
$creadListPrec :: ReadPrec [StartDetectMitigationActionsTask]
readPrec :: ReadPrec StartDetectMitigationActionsTask
$creadPrec :: ReadPrec StartDetectMitigationActionsTask
readList :: ReadS [StartDetectMitigationActionsTask]
$creadList :: ReadS [StartDetectMitigationActionsTask]
readsPrec :: Int -> ReadS StartDetectMitigationActionsTask
$creadsPrec :: Int -> ReadS StartDetectMitigationActionsTask
Prelude.Read, Int -> StartDetectMitigationActionsTask -> ShowS
[StartDetectMitigationActionsTask] -> ShowS
StartDetectMitigationActionsTask -> String
(Int -> StartDetectMitigationActionsTask -> ShowS)
-> (StartDetectMitigationActionsTask -> String)
-> ([StartDetectMitigationActionsTask] -> ShowS)
-> Show StartDetectMitigationActionsTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartDetectMitigationActionsTask] -> ShowS
$cshowList :: [StartDetectMitigationActionsTask] -> ShowS
show :: StartDetectMitigationActionsTask -> String
$cshow :: StartDetectMitigationActionsTask -> String
showsPrec :: Int -> StartDetectMitigationActionsTask -> ShowS
$cshowsPrec :: Int -> StartDetectMitigationActionsTask -> ShowS
Prelude.Show, (forall x.
StartDetectMitigationActionsTask
-> Rep StartDetectMitigationActionsTask x)
-> (forall x.
Rep StartDetectMitigationActionsTask x
-> StartDetectMitigationActionsTask)
-> Generic StartDetectMitigationActionsTask
forall x.
Rep StartDetectMitigationActionsTask x
-> StartDetectMitigationActionsTask
forall x.
StartDetectMitigationActionsTask
-> Rep StartDetectMitigationActionsTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartDetectMitigationActionsTask x
-> StartDetectMitigationActionsTask
$cfrom :: forall x.
StartDetectMitigationActionsTask
-> Rep StartDetectMitigationActionsTask x
Prelude.Generic)
newStartDetectMitigationActionsTask ::
Prelude.Text ->
DetectMitigationActionsTaskTarget ->
Prelude.NonEmpty Prelude.Text ->
Prelude.Text ->
StartDetectMitigationActionsTask
newStartDetectMitigationActionsTask :: Text
-> DetectMitigationActionsTaskTarget
-> NonEmpty Text
-> Text
-> StartDetectMitigationActionsTask
newStartDetectMitigationActionsTask
Text
pTaskId_
DetectMitigationActionsTaskTarget
pTarget_
NonEmpty Text
pActions_
Text
pClientRequestToken_ =
StartDetectMitigationActionsTask' :: Maybe ViolationEventOccurrenceRange
-> Maybe Bool
-> Maybe Bool
-> Text
-> DetectMitigationActionsTaskTarget
-> NonEmpty Text
-> Text
-> StartDetectMitigationActionsTask
StartDetectMitigationActionsTask'
{ $sel:violationEventOccurrenceRange:StartDetectMitigationActionsTask' :: Maybe ViolationEventOccurrenceRange
violationEventOccurrenceRange =
Maybe ViolationEventOccurrenceRange
forall a. Maybe a
Prelude.Nothing,
$sel:includeOnlyActiveViolations:StartDetectMitigationActionsTask' :: Maybe Bool
includeOnlyActiveViolations =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:includeSuppressedAlerts:StartDetectMitigationActionsTask' :: Maybe Bool
includeSuppressedAlerts = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:taskId:StartDetectMitigationActionsTask' :: Text
taskId = Text
pTaskId_,
$sel:target:StartDetectMitigationActionsTask' :: DetectMitigationActionsTaskTarget
target = DetectMitigationActionsTaskTarget
pTarget_,
$sel:actions:StartDetectMitigationActionsTask' :: NonEmpty Text
actions = Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pActions_,
$sel:clientRequestToken:StartDetectMitigationActionsTask' :: Text
clientRequestToken = Text
pClientRequestToken_
}
startDetectMitigationActionsTask_violationEventOccurrenceRange :: Lens.Lens' StartDetectMitigationActionsTask (Prelude.Maybe ViolationEventOccurrenceRange)
startDetectMitigationActionsTask_violationEventOccurrenceRange :: (Maybe ViolationEventOccurrenceRange
-> f (Maybe ViolationEventOccurrenceRange))
-> StartDetectMitigationActionsTask
-> f StartDetectMitigationActionsTask
startDetectMitigationActionsTask_violationEventOccurrenceRange = (StartDetectMitigationActionsTask
-> Maybe ViolationEventOccurrenceRange)
-> (StartDetectMitigationActionsTask
-> Maybe ViolationEventOccurrenceRange
-> StartDetectMitigationActionsTask)
-> Lens
StartDetectMitigationActionsTask
StartDetectMitigationActionsTask
(Maybe ViolationEventOccurrenceRange)
(Maybe ViolationEventOccurrenceRange)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDetectMitigationActionsTask' {Maybe ViolationEventOccurrenceRange
violationEventOccurrenceRange :: Maybe ViolationEventOccurrenceRange
$sel:violationEventOccurrenceRange:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask
-> Maybe ViolationEventOccurrenceRange
violationEventOccurrenceRange} -> Maybe ViolationEventOccurrenceRange
violationEventOccurrenceRange) (\s :: StartDetectMitigationActionsTask
s@StartDetectMitigationActionsTask' {} Maybe ViolationEventOccurrenceRange
a -> StartDetectMitigationActionsTask
s {$sel:violationEventOccurrenceRange:StartDetectMitigationActionsTask' :: Maybe ViolationEventOccurrenceRange
violationEventOccurrenceRange = Maybe ViolationEventOccurrenceRange
a} :: StartDetectMitigationActionsTask)
startDetectMitigationActionsTask_includeOnlyActiveViolations :: Lens.Lens' StartDetectMitigationActionsTask (Prelude.Maybe Prelude.Bool)
startDetectMitigationActionsTask_includeOnlyActiveViolations :: (Maybe Bool -> f (Maybe Bool))
-> StartDetectMitigationActionsTask
-> f StartDetectMitigationActionsTask
startDetectMitigationActionsTask_includeOnlyActiveViolations = (StartDetectMitigationActionsTask -> Maybe Bool)
-> (StartDetectMitigationActionsTask
-> Maybe Bool -> StartDetectMitigationActionsTask)
-> Lens
StartDetectMitigationActionsTask
StartDetectMitigationActionsTask
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDetectMitigationActionsTask' {Maybe Bool
includeOnlyActiveViolations :: Maybe Bool
$sel:includeOnlyActiveViolations:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> Maybe Bool
includeOnlyActiveViolations} -> Maybe Bool
includeOnlyActiveViolations) (\s :: StartDetectMitigationActionsTask
s@StartDetectMitigationActionsTask' {} Maybe Bool
a -> StartDetectMitigationActionsTask
s {$sel:includeOnlyActiveViolations:StartDetectMitigationActionsTask' :: Maybe Bool
includeOnlyActiveViolations = Maybe Bool
a} :: StartDetectMitigationActionsTask)
startDetectMitigationActionsTask_includeSuppressedAlerts :: Lens.Lens' StartDetectMitigationActionsTask (Prelude.Maybe Prelude.Bool)
startDetectMitigationActionsTask_includeSuppressedAlerts :: (Maybe Bool -> f (Maybe Bool))
-> StartDetectMitigationActionsTask
-> f StartDetectMitigationActionsTask
startDetectMitigationActionsTask_includeSuppressedAlerts = (StartDetectMitigationActionsTask -> Maybe Bool)
-> (StartDetectMitigationActionsTask
-> Maybe Bool -> StartDetectMitigationActionsTask)
-> Lens
StartDetectMitigationActionsTask
StartDetectMitigationActionsTask
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDetectMitigationActionsTask' {Maybe Bool
includeSuppressedAlerts :: Maybe Bool
$sel:includeSuppressedAlerts:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> Maybe Bool
includeSuppressedAlerts} -> Maybe Bool
includeSuppressedAlerts) (\s :: StartDetectMitigationActionsTask
s@StartDetectMitigationActionsTask' {} Maybe Bool
a -> StartDetectMitigationActionsTask
s {$sel:includeSuppressedAlerts:StartDetectMitigationActionsTask' :: Maybe Bool
includeSuppressedAlerts = Maybe Bool
a} :: StartDetectMitigationActionsTask)
startDetectMitigationActionsTask_taskId :: Lens.Lens' StartDetectMitigationActionsTask Prelude.Text
startDetectMitigationActionsTask_taskId :: (Text -> f Text)
-> StartDetectMitigationActionsTask
-> f StartDetectMitigationActionsTask
startDetectMitigationActionsTask_taskId = (StartDetectMitigationActionsTask -> Text)
-> (StartDetectMitigationActionsTask
-> Text -> StartDetectMitigationActionsTask)
-> Lens
StartDetectMitigationActionsTask
StartDetectMitigationActionsTask
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDetectMitigationActionsTask' {Text
taskId :: Text
$sel:taskId:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> Text
taskId} -> Text
taskId) (\s :: StartDetectMitigationActionsTask
s@StartDetectMitigationActionsTask' {} Text
a -> StartDetectMitigationActionsTask
s {$sel:taskId:StartDetectMitigationActionsTask' :: Text
taskId = Text
a} :: StartDetectMitigationActionsTask)
startDetectMitigationActionsTask_target :: Lens.Lens' StartDetectMitigationActionsTask DetectMitigationActionsTaskTarget
startDetectMitigationActionsTask_target :: (DetectMitigationActionsTaskTarget
-> f DetectMitigationActionsTaskTarget)
-> StartDetectMitigationActionsTask
-> f StartDetectMitigationActionsTask
startDetectMitigationActionsTask_target = (StartDetectMitigationActionsTask
-> DetectMitigationActionsTaskTarget)
-> (StartDetectMitigationActionsTask
-> DetectMitigationActionsTaskTarget
-> StartDetectMitigationActionsTask)
-> Lens
StartDetectMitigationActionsTask
StartDetectMitigationActionsTask
DetectMitigationActionsTaskTarget
DetectMitigationActionsTaskTarget
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDetectMitigationActionsTask' {DetectMitigationActionsTaskTarget
target :: DetectMitigationActionsTaskTarget
$sel:target:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask
-> DetectMitigationActionsTaskTarget
target} -> DetectMitigationActionsTaskTarget
target) (\s :: StartDetectMitigationActionsTask
s@StartDetectMitigationActionsTask' {} DetectMitigationActionsTaskTarget
a -> StartDetectMitigationActionsTask
s {$sel:target:StartDetectMitigationActionsTask' :: DetectMitigationActionsTaskTarget
target = DetectMitigationActionsTaskTarget
a} :: StartDetectMitigationActionsTask)
startDetectMitigationActionsTask_actions :: Lens.Lens' StartDetectMitigationActionsTask (Prelude.NonEmpty Prelude.Text)
startDetectMitigationActionsTask_actions :: (NonEmpty Text -> f (NonEmpty Text))
-> StartDetectMitigationActionsTask
-> f StartDetectMitigationActionsTask
startDetectMitigationActionsTask_actions = (StartDetectMitigationActionsTask -> NonEmpty Text)
-> (StartDetectMitigationActionsTask
-> NonEmpty Text -> StartDetectMitigationActionsTask)
-> Lens
StartDetectMitigationActionsTask
StartDetectMitigationActionsTask
(NonEmpty Text)
(NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDetectMitigationActionsTask' {NonEmpty Text
actions :: NonEmpty Text
$sel:actions:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> NonEmpty Text
actions} -> NonEmpty Text
actions) (\s :: StartDetectMitigationActionsTask
s@StartDetectMitigationActionsTask' {} NonEmpty Text
a -> StartDetectMitigationActionsTask
s {$sel:actions:StartDetectMitigationActionsTask' :: NonEmpty Text
actions = NonEmpty Text
a} :: StartDetectMitigationActionsTask) ((NonEmpty Text -> f (NonEmpty Text))
-> StartDetectMitigationActionsTask
-> f StartDetectMitigationActionsTask)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> StartDetectMitigationActionsTask
-> f StartDetectMitigationActionsTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
startDetectMitigationActionsTask_clientRequestToken :: Lens.Lens' StartDetectMitigationActionsTask Prelude.Text
startDetectMitigationActionsTask_clientRequestToken :: (Text -> f Text)
-> StartDetectMitigationActionsTask
-> f StartDetectMitigationActionsTask
startDetectMitigationActionsTask_clientRequestToken = (StartDetectMitigationActionsTask -> Text)
-> (StartDetectMitigationActionsTask
-> Text -> StartDetectMitigationActionsTask)
-> Lens
StartDetectMitigationActionsTask
StartDetectMitigationActionsTask
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDetectMitigationActionsTask' {Text
clientRequestToken :: Text
$sel:clientRequestToken:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> Text
clientRequestToken} -> Text
clientRequestToken) (\s :: StartDetectMitigationActionsTask
s@StartDetectMitigationActionsTask' {} Text
a -> StartDetectMitigationActionsTask
s {$sel:clientRequestToken:StartDetectMitigationActionsTask' :: Text
clientRequestToken = Text
a} :: StartDetectMitigationActionsTask)
instance
Core.AWSRequest
StartDetectMitigationActionsTask
where
type
AWSResponse StartDetectMitigationActionsTask =
StartDetectMitigationActionsTaskResponse
request :: StartDetectMitigationActionsTask
-> Request StartDetectMitigationActionsTask
request = Service
-> StartDetectMitigationActionsTask
-> Request StartDetectMitigationActionsTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartDetectMitigationActionsTask
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse StartDetectMitigationActionsTask)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StartDetectMitigationActionsTask))
-> Logger
-> Service
-> Proxy StartDetectMitigationActionsTask
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse StartDetectMitigationActionsTask)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> StartDetectMitigationActionsTaskResponse
StartDetectMitigationActionsTaskResponse'
(Maybe Text -> Int -> StartDetectMitigationActionsTaskResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartDetectMitigationActionsTaskResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"taskId")
Either String (Int -> StartDetectMitigationActionsTaskResponse)
-> Either String Int
-> Either String StartDetectMitigationActionsTaskResponse
forall (f :: * -> *) a b. Applicative f => 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
StartDetectMitigationActionsTask
instance
Prelude.NFData
StartDetectMitigationActionsTask
instance
Core.ToHeaders
StartDetectMitigationActionsTask
where
toHeaders :: StartDetectMitigationActionsTask -> ResponseHeaders
toHeaders = ResponseHeaders
-> StartDetectMitigationActionsTask -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON StartDetectMitigationActionsTask where
toJSON :: StartDetectMitigationActionsTask -> Value
toJSON StartDetectMitigationActionsTask' {Maybe Bool
Maybe ViolationEventOccurrenceRange
NonEmpty Text
Text
DetectMitigationActionsTaskTarget
clientRequestToken :: Text
actions :: NonEmpty Text
target :: DetectMitigationActionsTaskTarget
taskId :: Text
includeSuppressedAlerts :: Maybe Bool
includeOnlyActiveViolations :: Maybe Bool
violationEventOccurrenceRange :: Maybe ViolationEventOccurrenceRange
$sel:clientRequestToken:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> Text
$sel:actions:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> NonEmpty Text
$sel:target:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask
-> DetectMitigationActionsTaskTarget
$sel:taskId:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> Text
$sel:includeSuppressedAlerts:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> Maybe Bool
$sel:includeOnlyActiveViolations:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> Maybe Bool
$sel:violationEventOccurrenceRange:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask
-> Maybe ViolationEventOccurrenceRange
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"violationEventOccurrenceRange" Text -> ViolationEventOccurrenceRange -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ViolationEventOccurrenceRange -> Pair)
-> Maybe ViolationEventOccurrenceRange -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ViolationEventOccurrenceRange
violationEventOccurrenceRange,
(Text
"includeOnlyActiveViolations" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeOnlyActiveViolations,
(Text
"includeSuppressedAlerts" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeSuppressedAlerts,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"target" Text -> DetectMitigationActionsTaskTarget -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DetectMitigationActionsTaskTarget
target),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"actions" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
actions),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"clientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientRequestToken)
]
)
instance Core.ToPath StartDetectMitigationActionsTask where
toPath :: StartDetectMitigationActionsTask -> ByteString
toPath StartDetectMitigationActionsTask' {Maybe Bool
Maybe ViolationEventOccurrenceRange
NonEmpty Text
Text
DetectMitigationActionsTaskTarget
clientRequestToken :: Text
actions :: NonEmpty Text
target :: DetectMitigationActionsTaskTarget
taskId :: Text
includeSuppressedAlerts :: Maybe Bool
includeOnlyActiveViolations :: Maybe Bool
violationEventOccurrenceRange :: Maybe ViolationEventOccurrenceRange
$sel:clientRequestToken:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> Text
$sel:actions:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> NonEmpty Text
$sel:target:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask
-> DetectMitigationActionsTaskTarget
$sel:taskId:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> Text
$sel:includeSuppressedAlerts:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> Maybe Bool
$sel:includeOnlyActiveViolations:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask -> Maybe Bool
$sel:violationEventOccurrenceRange:StartDetectMitigationActionsTask' :: StartDetectMitigationActionsTask
-> Maybe ViolationEventOccurrenceRange
..} =
[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
]
instance
Core.ToQuery
StartDetectMitigationActionsTask
where
toQuery :: StartDetectMitigationActionsTask -> QueryString
toQuery = QueryString -> StartDetectMitigationActionsTask -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartDetectMitigationActionsTaskResponse = StartDetectMitigationActionsTaskResponse'
{
StartDetectMitigationActionsTaskResponse -> Maybe Text
taskId :: Prelude.Maybe Prelude.Text,
StartDetectMitigationActionsTaskResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartDetectMitigationActionsTaskResponse
-> StartDetectMitigationActionsTaskResponse -> Bool
(StartDetectMitigationActionsTaskResponse
-> StartDetectMitigationActionsTaskResponse -> Bool)
-> (StartDetectMitigationActionsTaskResponse
-> StartDetectMitigationActionsTaskResponse -> Bool)
-> Eq StartDetectMitigationActionsTaskResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartDetectMitigationActionsTaskResponse
-> StartDetectMitigationActionsTaskResponse -> Bool
$c/= :: StartDetectMitigationActionsTaskResponse
-> StartDetectMitigationActionsTaskResponse -> Bool
== :: StartDetectMitigationActionsTaskResponse
-> StartDetectMitigationActionsTaskResponse -> Bool
$c== :: StartDetectMitigationActionsTaskResponse
-> StartDetectMitigationActionsTaskResponse -> Bool
Prelude.Eq, ReadPrec [StartDetectMitigationActionsTaskResponse]
ReadPrec StartDetectMitigationActionsTaskResponse
Int -> ReadS StartDetectMitigationActionsTaskResponse
ReadS [StartDetectMitigationActionsTaskResponse]
(Int -> ReadS StartDetectMitigationActionsTaskResponse)
-> ReadS [StartDetectMitigationActionsTaskResponse]
-> ReadPrec StartDetectMitigationActionsTaskResponse
-> ReadPrec [StartDetectMitigationActionsTaskResponse]
-> Read StartDetectMitigationActionsTaskResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartDetectMitigationActionsTaskResponse]
$creadListPrec :: ReadPrec [StartDetectMitigationActionsTaskResponse]
readPrec :: ReadPrec StartDetectMitigationActionsTaskResponse
$creadPrec :: ReadPrec StartDetectMitigationActionsTaskResponse
readList :: ReadS [StartDetectMitigationActionsTaskResponse]
$creadList :: ReadS [StartDetectMitigationActionsTaskResponse]
readsPrec :: Int -> ReadS StartDetectMitigationActionsTaskResponse
$creadsPrec :: Int -> ReadS StartDetectMitigationActionsTaskResponse
Prelude.Read, Int -> StartDetectMitigationActionsTaskResponse -> ShowS
[StartDetectMitigationActionsTaskResponse] -> ShowS
StartDetectMitigationActionsTaskResponse -> String
(Int -> StartDetectMitigationActionsTaskResponse -> ShowS)
-> (StartDetectMitigationActionsTaskResponse -> String)
-> ([StartDetectMitigationActionsTaskResponse] -> ShowS)
-> Show StartDetectMitigationActionsTaskResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartDetectMitigationActionsTaskResponse] -> ShowS
$cshowList :: [StartDetectMitigationActionsTaskResponse] -> ShowS
show :: StartDetectMitigationActionsTaskResponse -> String
$cshow :: StartDetectMitigationActionsTaskResponse -> String
showsPrec :: Int -> StartDetectMitigationActionsTaskResponse -> ShowS
$cshowsPrec :: Int -> StartDetectMitigationActionsTaskResponse -> ShowS
Prelude.Show, (forall x.
StartDetectMitigationActionsTaskResponse
-> Rep StartDetectMitigationActionsTaskResponse x)
-> (forall x.
Rep StartDetectMitigationActionsTaskResponse x
-> StartDetectMitigationActionsTaskResponse)
-> Generic StartDetectMitigationActionsTaskResponse
forall x.
Rep StartDetectMitigationActionsTaskResponse x
-> StartDetectMitigationActionsTaskResponse
forall x.
StartDetectMitigationActionsTaskResponse
-> Rep StartDetectMitigationActionsTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartDetectMitigationActionsTaskResponse x
-> StartDetectMitigationActionsTaskResponse
$cfrom :: forall x.
StartDetectMitigationActionsTaskResponse
-> Rep StartDetectMitigationActionsTaskResponse x
Prelude.Generic)
newStartDetectMitigationActionsTaskResponse ::
Prelude.Int ->
StartDetectMitigationActionsTaskResponse
newStartDetectMitigationActionsTaskResponse :: Int -> StartDetectMitigationActionsTaskResponse
newStartDetectMitigationActionsTaskResponse
Int
pHttpStatus_ =
StartDetectMitigationActionsTaskResponse' :: Maybe Text -> Int -> StartDetectMitigationActionsTaskResponse
StartDetectMitigationActionsTaskResponse'
{ $sel:taskId:StartDetectMitigationActionsTaskResponse' :: Maybe Text
taskId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartDetectMitigationActionsTaskResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startDetectMitigationActionsTaskResponse_taskId :: Lens.Lens' StartDetectMitigationActionsTaskResponse (Prelude.Maybe Prelude.Text)
startDetectMitigationActionsTaskResponse_taskId :: (Maybe Text -> f (Maybe Text))
-> StartDetectMitigationActionsTaskResponse
-> f StartDetectMitigationActionsTaskResponse
startDetectMitigationActionsTaskResponse_taskId = (StartDetectMitigationActionsTaskResponse -> Maybe Text)
-> (StartDetectMitigationActionsTaskResponse
-> Maybe Text -> StartDetectMitigationActionsTaskResponse)
-> Lens
StartDetectMitigationActionsTaskResponse
StartDetectMitigationActionsTaskResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDetectMitigationActionsTaskResponse' {Maybe Text
taskId :: Maybe Text
$sel:taskId:StartDetectMitigationActionsTaskResponse' :: StartDetectMitigationActionsTaskResponse -> Maybe Text
taskId} -> Maybe Text
taskId) (\s :: StartDetectMitigationActionsTaskResponse
s@StartDetectMitigationActionsTaskResponse' {} Maybe Text
a -> StartDetectMitigationActionsTaskResponse
s {$sel:taskId:StartDetectMitigationActionsTaskResponse' :: Maybe Text
taskId = Maybe Text
a} :: StartDetectMitigationActionsTaskResponse)
startDetectMitigationActionsTaskResponse_httpStatus :: Lens.Lens' StartDetectMitigationActionsTaskResponse Prelude.Int
startDetectMitigationActionsTaskResponse_httpStatus :: (Int -> f Int)
-> StartDetectMitigationActionsTaskResponse
-> f StartDetectMitigationActionsTaskResponse
startDetectMitigationActionsTaskResponse_httpStatus = (StartDetectMitigationActionsTaskResponse -> Int)
-> (StartDetectMitigationActionsTaskResponse
-> Int -> StartDetectMitigationActionsTaskResponse)
-> Lens
StartDetectMitigationActionsTaskResponse
StartDetectMitigationActionsTaskResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDetectMitigationActionsTaskResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartDetectMitigationActionsTaskResponse' :: StartDetectMitigationActionsTaskResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartDetectMitigationActionsTaskResponse
s@StartDetectMitigationActionsTaskResponse' {} Int
a -> StartDetectMitigationActionsTaskResponse
s {$sel:httpStatus:StartDetectMitigationActionsTaskResponse' :: Int
httpStatus = Int
a} :: StartDetectMitigationActionsTaskResponse)
instance
Prelude.NFData
StartDetectMitigationActionsTaskResponse