{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoT.Types.DetectMitigationActionsTaskSummary
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoT.Types.DetectMitigationActionsTaskSummary where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.DetectMitigationActionsTaskStatistics
import Amazonka.IoT.Types.DetectMitigationActionsTaskStatus
import Amazonka.IoT.Types.DetectMitigationActionsTaskTarget
import Amazonka.IoT.Types.MitigationAction
import Amazonka.IoT.Types.ViolationEventOccurrenceRange
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The summary of the mitigation action tasks.
--
-- /See:/ 'newDetectMitigationActionsTaskSummary' smart constructor.
data DetectMitigationActionsTaskSummary = DetectMitigationActionsTaskSummary'
  { -- | Includes only active violations.
    DetectMitigationActionsTaskSummary -> Maybe Bool
onlyActiveViolationsIncluded :: Prelude.Maybe Prelude.Bool,
    -- | Includes suppressed alerts.
    DetectMitigationActionsTaskSummary -> Maybe Bool
suppressedAlertsIncluded :: Prelude.Maybe Prelude.Bool,
    -- | Specifies the time period of which violation events occurred between.
    DetectMitigationActionsTaskSummary
-> Maybe ViolationEventOccurrenceRange
violationEventOccurrenceRange :: Prelude.Maybe ViolationEventOccurrenceRange,
    -- | The unique identifier of the task.
    DetectMitigationActionsTaskSummary -> Maybe Text
taskId :: Prelude.Maybe Prelude.Text,
    -- | The date the task started.
    DetectMitigationActionsTaskSummary -> Maybe POSIX
taskStartTime :: Prelude.Maybe Core.POSIX,
    -- | The statistics of a mitigation action task.
    DetectMitigationActionsTaskSummary
-> Maybe DetectMitigationActionsTaskStatistics
taskStatistics :: Prelude.Maybe DetectMitigationActionsTaskStatistics,
    -- | The definition of the actions.
    DetectMitigationActionsTaskSummary -> Maybe [MitigationAction]
actionsDefinition :: Prelude.Maybe [MitigationAction],
    -- | The date the task ended.
    DetectMitigationActionsTaskSummary -> Maybe POSIX
taskEndTime :: Prelude.Maybe Core.POSIX,
    -- | Specifies the ML Detect findings to which the mitigation actions are
    -- applied.
    DetectMitigationActionsTaskSummary
-> Maybe DetectMitigationActionsTaskTarget
target :: Prelude.Maybe DetectMitigationActionsTaskTarget,
    -- | The status of the task.
    DetectMitigationActionsTaskSummary
-> Maybe DetectMitigationActionsTaskStatus
taskStatus :: Prelude.Maybe DetectMitigationActionsTaskStatus
  }
  deriving (DetectMitigationActionsTaskSummary
-> DetectMitigationActionsTaskSummary -> Bool
(DetectMitigationActionsTaskSummary
 -> DetectMitigationActionsTaskSummary -> Bool)
-> (DetectMitigationActionsTaskSummary
    -> DetectMitigationActionsTaskSummary -> Bool)
-> Eq DetectMitigationActionsTaskSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectMitigationActionsTaskSummary
-> DetectMitigationActionsTaskSummary -> Bool
$c/= :: DetectMitigationActionsTaskSummary
-> DetectMitigationActionsTaskSummary -> Bool
== :: DetectMitigationActionsTaskSummary
-> DetectMitigationActionsTaskSummary -> Bool
$c== :: DetectMitigationActionsTaskSummary
-> DetectMitigationActionsTaskSummary -> Bool
Prelude.Eq, ReadPrec [DetectMitigationActionsTaskSummary]
ReadPrec DetectMitigationActionsTaskSummary
Int -> ReadS DetectMitigationActionsTaskSummary
ReadS [DetectMitigationActionsTaskSummary]
(Int -> ReadS DetectMitigationActionsTaskSummary)
-> ReadS [DetectMitigationActionsTaskSummary]
-> ReadPrec DetectMitigationActionsTaskSummary
-> ReadPrec [DetectMitigationActionsTaskSummary]
-> Read DetectMitigationActionsTaskSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectMitigationActionsTaskSummary]
$creadListPrec :: ReadPrec [DetectMitigationActionsTaskSummary]
readPrec :: ReadPrec DetectMitigationActionsTaskSummary
$creadPrec :: ReadPrec DetectMitigationActionsTaskSummary
readList :: ReadS [DetectMitigationActionsTaskSummary]
$creadList :: ReadS [DetectMitigationActionsTaskSummary]
readsPrec :: Int -> ReadS DetectMitigationActionsTaskSummary
$creadsPrec :: Int -> ReadS DetectMitigationActionsTaskSummary
Prelude.Read, Int -> DetectMitigationActionsTaskSummary -> ShowS
[DetectMitigationActionsTaskSummary] -> ShowS
DetectMitigationActionsTaskSummary -> String
(Int -> DetectMitigationActionsTaskSummary -> ShowS)
-> (DetectMitigationActionsTaskSummary -> String)
-> ([DetectMitigationActionsTaskSummary] -> ShowS)
-> Show DetectMitigationActionsTaskSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectMitigationActionsTaskSummary] -> ShowS
$cshowList :: [DetectMitigationActionsTaskSummary] -> ShowS
show :: DetectMitigationActionsTaskSummary -> String
$cshow :: DetectMitigationActionsTaskSummary -> String
showsPrec :: Int -> DetectMitigationActionsTaskSummary -> ShowS
$cshowsPrec :: Int -> DetectMitigationActionsTaskSummary -> ShowS
Prelude.Show, (forall x.
 DetectMitigationActionsTaskSummary
 -> Rep DetectMitigationActionsTaskSummary x)
-> (forall x.
    Rep DetectMitigationActionsTaskSummary x
    -> DetectMitigationActionsTaskSummary)
-> Generic DetectMitigationActionsTaskSummary
forall x.
Rep DetectMitigationActionsTaskSummary x
-> DetectMitigationActionsTaskSummary
forall x.
DetectMitigationActionsTaskSummary
-> Rep DetectMitigationActionsTaskSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DetectMitigationActionsTaskSummary x
-> DetectMitigationActionsTaskSummary
$cfrom :: forall x.
DetectMitigationActionsTaskSummary
-> Rep DetectMitigationActionsTaskSummary x
Prelude.Generic)

-- |
-- Create a value of 'DetectMitigationActionsTaskSummary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'onlyActiveViolationsIncluded', 'detectMitigationActionsTaskSummary_onlyActiveViolationsIncluded' - Includes only active violations.
--
-- 'suppressedAlertsIncluded', 'detectMitigationActionsTaskSummary_suppressedAlertsIncluded' - Includes suppressed alerts.
--
-- 'violationEventOccurrenceRange', 'detectMitigationActionsTaskSummary_violationEventOccurrenceRange' - Specifies the time period of which violation events occurred between.
--
-- 'taskId', 'detectMitigationActionsTaskSummary_taskId' - The unique identifier of the task.
--
-- 'taskStartTime', 'detectMitigationActionsTaskSummary_taskStartTime' - The date the task started.
--
-- 'taskStatistics', 'detectMitigationActionsTaskSummary_taskStatistics' - The statistics of a mitigation action task.
--
-- 'actionsDefinition', 'detectMitigationActionsTaskSummary_actionsDefinition' - The definition of the actions.
--
-- 'taskEndTime', 'detectMitigationActionsTaskSummary_taskEndTime' - The date the task ended.
--
-- 'target', 'detectMitigationActionsTaskSummary_target' - Specifies the ML Detect findings to which the mitigation actions are
-- applied.
--
-- 'taskStatus', 'detectMitigationActionsTaskSummary_taskStatus' - The status of the task.
newDetectMitigationActionsTaskSummary ::
  DetectMitigationActionsTaskSummary
newDetectMitigationActionsTaskSummary :: DetectMitigationActionsTaskSummary
newDetectMitigationActionsTaskSummary =
  DetectMitigationActionsTaskSummary' :: Maybe Bool
-> Maybe Bool
-> Maybe ViolationEventOccurrenceRange
-> Maybe Text
-> Maybe POSIX
-> Maybe DetectMitigationActionsTaskStatistics
-> Maybe [MitigationAction]
-> Maybe POSIX
-> Maybe DetectMitigationActionsTaskTarget
-> Maybe DetectMitigationActionsTaskStatus
-> DetectMitigationActionsTaskSummary
DetectMitigationActionsTaskSummary'
    { $sel:onlyActiveViolationsIncluded:DetectMitigationActionsTaskSummary' :: Maybe Bool
onlyActiveViolationsIncluded =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:suppressedAlertsIncluded:DetectMitigationActionsTaskSummary' :: Maybe Bool
suppressedAlertsIncluded =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:violationEventOccurrenceRange:DetectMitigationActionsTaskSummary' :: Maybe ViolationEventOccurrenceRange
violationEventOccurrenceRange =
        Maybe ViolationEventOccurrenceRange
forall a. Maybe a
Prelude.Nothing,
      $sel:taskId:DetectMitigationActionsTaskSummary' :: Maybe Text
taskId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taskStartTime:DetectMitigationActionsTaskSummary' :: Maybe POSIX
taskStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:taskStatistics:DetectMitigationActionsTaskSummary' :: Maybe DetectMitigationActionsTaskStatistics
taskStatistics = Maybe DetectMitigationActionsTaskStatistics
forall a. Maybe a
Prelude.Nothing,
      $sel:actionsDefinition:DetectMitigationActionsTaskSummary' :: Maybe [MitigationAction]
actionsDefinition = Maybe [MitigationAction]
forall a. Maybe a
Prelude.Nothing,
      $sel:taskEndTime:DetectMitigationActionsTaskSummary' :: Maybe POSIX
taskEndTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:target:DetectMitigationActionsTaskSummary' :: Maybe DetectMitigationActionsTaskTarget
target = Maybe DetectMitigationActionsTaskTarget
forall a. Maybe a
Prelude.Nothing,
      $sel:taskStatus:DetectMitigationActionsTaskSummary' :: Maybe DetectMitigationActionsTaskStatus
taskStatus = Maybe DetectMitigationActionsTaskStatus
forall a. Maybe a
Prelude.Nothing
    }

-- | Includes only active violations.
detectMitigationActionsTaskSummary_onlyActiveViolationsIncluded :: Lens.Lens' DetectMitigationActionsTaskSummary (Prelude.Maybe Prelude.Bool)
detectMitigationActionsTaskSummary_onlyActiveViolationsIncluded :: (Maybe Bool -> f (Maybe Bool))
-> DetectMitigationActionsTaskSummary
-> f DetectMitigationActionsTaskSummary
detectMitigationActionsTaskSummary_onlyActiveViolationsIncluded = (DetectMitigationActionsTaskSummary -> Maybe Bool)
-> (DetectMitigationActionsTaskSummary
    -> Maybe Bool -> DetectMitigationActionsTaskSummary)
-> Lens
     DetectMitigationActionsTaskSummary
     DetectMitigationActionsTaskSummary
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectMitigationActionsTaskSummary' {Maybe Bool
onlyActiveViolationsIncluded :: Maybe Bool
$sel:onlyActiveViolationsIncluded:DetectMitigationActionsTaskSummary' :: DetectMitigationActionsTaskSummary -> Maybe Bool
onlyActiveViolationsIncluded} -> Maybe Bool
onlyActiveViolationsIncluded) (\s :: DetectMitigationActionsTaskSummary
s@DetectMitigationActionsTaskSummary' {} Maybe Bool
a -> DetectMitigationActionsTaskSummary
s {$sel:onlyActiveViolationsIncluded:DetectMitigationActionsTaskSummary' :: Maybe Bool
onlyActiveViolationsIncluded = Maybe Bool
a} :: DetectMitigationActionsTaskSummary)

-- | Includes suppressed alerts.
detectMitigationActionsTaskSummary_suppressedAlertsIncluded :: Lens.Lens' DetectMitigationActionsTaskSummary (Prelude.Maybe Prelude.Bool)
detectMitigationActionsTaskSummary_suppressedAlertsIncluded :: (Maybe Bool -> f (Maybe Bool))
-> DetectMitigationActionsTaskSummary
-> f DetectMitigationActionsTaskSummary
detectMitigationActionsTaskSummary_suppressedAlertsIncluded = (DetectMitigationActionsTaskSummary -> Maybe Bool)
-> (DetectMitigationActionsTaskSummary
    -> Maybe Bool -> DetectMitigationActionsTaskSummary)
-> Lens
     DetectMitigationActionsTaskSummary
     DetectMitigationActionsTaskSummary
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectMitigationActionsTaskSummary' {Maybe Bool
suppressedAlertsIncluded :: Maybe Bool
$sel:suppressedAlertsIncluded:DetectMitigationActionsTaskSummary' :: DetectMitigationActionsTaskSummary -> Maybe Bool
suppressedAlertsIncluded} -> Maybe Bool
suppressedAlertsIncluded) (\s :: DetectMitigationActionsTaskSummary
s@DetectMitigationActionsTaskSummary' {} Maybe Bool
a -> DetectMitigationActionsTaskSummary
s {$sel:suppressedAlertsIncluded:DetectMitigationActionsTaskSummary' :: Maybe Bool
suppressedAlertsIncluded = Maybe Bool
a} :: DetectMitigationActionsTaskSummary)

-- | Specifies the time period of which violation events occurred between.
detectMitigationActionsTaskSummary_violationEventOccurrenceRange :: Lens.Lens' DetectMitigationActionsTaskSummary (Prelude.Maybe ViolationEventOccurrenceRange)
detectMitigationActionsTaskSummary_violationEventOccurrenceRange :: (Maybe ViolationEventOccurrenceRange
 -> f (Maybe ViolationEventOccurrenceRange))
-> DetectMitigationActionsTaskSummary
-> f DetectMitigationActionsTaskSummary
detectMitigationActionsTaskSummary_violationEventOccurrenceRange = (DetectMitigationActionsTaskSummary
 -> Maybe ViolationEventOccurrenceRange)
-> (DetectMitigationActionsTaskSummary
    -> Maybe ViolationEventOccurrenceRange
    -> DetectMitigationActionsTaskSummary)
-> Lens
     DetectMitigationActionsTaskSummary
     DetectMitigationActionsTaskSummary
     (Maybe ViolationEventOccurrenceRange)
     (Maybe ViolationEventOccurrenceRange)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectMitigationActionsTaskSummary' {Maybe ViolationEventOccurrenceRange
violationEventOccurrenceRange :: Maybe ViolationEventOccurrenceRange
$sel:violationEventOccurrenceRange:DetectMitigationActionsTaskSummary' :: DetectMitigationActionsTaskSummary
-> Maybe ViolationEventOccurrenceRange
violationEventOccurrenceRange} -> Maybe ViolationEventOccurrenceRange
violationEventOccurrenceRange) (\s :: DetectMitigationActionsTaskSummary
s@DetectMitigationActionsTaskSummary' {} Maybe ViolationEventOccurrenceRange
a -> DetectMitigationActionsTaskSummary
s {$sel:violationEventOccurrenceRange:DetectMitigationActionsTaskSummary' :: Maybe ViolationEventOccurrenceRange
violationEventOccurrenceRange = Maybe ViolationEventOccurrenceRange
a} :: DetectMitigationActionsTaskSummary)

-- | The unique identifier of the task.
detectMitigationActionsTaskSummary_taskId :: Lens.Lens' DetectMitigationActionsTaskSummary (Prelude.Maybe Prelude.Text)
detectMitigationActionsTaskSummary_taskId :: (Maybe Text -> f (Maybe Text))
-> DetectMitigationActionsTaskSummary
-> f DetectMitigationActionsTaskSummary
detectMitigationActionsTaskSummary_taskId = (DetectMitigationActionsTaskSummary -> Maybe Text)
-> (DetectMitigationActionsTaskSummary
    -> Maybe Text -> DetectMitigationActionsTaskSummary)
-> Lens
     DetectMitigationActionsTaskSummary
     DetectMitigationActionsTaskSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectMitigationActionsTaskSummary' {Maybe Text
taskId :: Maybe Text
$sel:taskId:DetectMitigationActionsTaskSummary' :: DetectMitigationActionsTaskSummary -> Maybe Text
taskId} -> Maybe Text
taskId) (\s :: DetectMitigationActionsTaskSummary
s@DetectMitigationActionsTaskSummary' {} Maybe Text
a -> DetectMitigationActionsTaskSummary
s {$sel:taskId:DetectMitigationActionsTaskSummary' :: Maybe Text
taskId = Maybe Text
a} :: DetectMitigationActionsTaskSummary)

-- | The date the task started.
detectMitigationActionsTaskSummary_taskStartTime :: Lens.Lens' DetectMitigationActionsTaskSummary (Prelude.Maybe Prelude.UTCTime)
detectMitigationActionsTaskSummary_taskStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DetectMitigationActionsTaskSummary
-> f DetectMitigationActionsTaskSummary
detectMitigationActionsTaskSummary_taskStartTime = (DetectMitigationActionsTaskSummary -> Maybe POSIX)
-> (DetectMitigationActionsTaskSummary
    -> Maybe POSIX -> DetectMitigationActionsTaskSummary)
-> Lens
     DetectMitigationActionsTaskSummary
     DetectMitigationActionsTaskSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectMitigationActionsTaskSummary' {Maybe POSIX
taskStartTime :: Maybe POSIX
$sel:taskStartTime:DetectMitigationActionsTaskSummary' :: DetectMitigationActionsTaskSummary -> Maybe POSIX
taskStartTime} -> Maybe POSIX
taskStartTime) (\s :: DetectMitigationActionsTaskSummary
s@DetectMitigationActionsTaskSummary' {} Maybe POSIX
a -> DetectMitigationActionsTaskSummary
s {$sel:taskStartTime:DetectMitigationActionsTaskSummary' :: Maybe POSIX
taskStartTime = Maybe POSIX
a} :: DetectMitigationActionsTaskSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> DetectMitigationActionsTaskSummary
 -> f DetectMitigationActionsTaskSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DetectMitigationActionsTaskSummary
-> f DetectMitigationActionsTaskSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The statistics of a mitigation action task.
detectMitigationActionsTaskSummary_taskStatistics :: Lens.Lens' DetectMitigationActionsTaskSummary (Prelude.Maybe DetectMitigationActionsTaskStatistics)
detectMitigationActionsTaskSummary_taskStatistics :: (Maybe DetectMitigationActionsTaskStatistics
 -> f (Maybe DetectMitigationActionsTaskStatistics))
-> DetectMitigationActionsTaskSummary
-> f DetectMitigationActionsTaskSummary
detectMitigationActionsTaskSummary_taskStatistics = (DetectMitigationActionsTaskSummary
 -> Maybe DetectMitigationActionsTaskStatistics)
-> (DetectMitigationActionsTaskSummary
    -> Maybe DetectMitigationActionsTaskStatistics
    -> DetectMitigationActionsTaskSummary)
-> Lens
     DetectMitigationActionsTaskSummary
     DetectMitigationActionsTaskSummary
     (Maybe DetectMitigationActionsTaskStatistics)
     (Maybe DetectMitigationActionsTaskStatistics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectMitigationActionsTaskSummary' {Maybe DetectMitigationActionsTaskStatistics
taskStatistics :: Maybe DetectMitigationActionsTaskStatistics
$sel:taskStatistics:DetectMitigationActionsTaskSummary' :: DetectMitigationActionsTaskSummary
-> Maybe DetectMitigationActionsTaskStatistics
taskStatistics} -> Maybe DetectMitigationActionsTaskStatistics
taskStatistics) (\s :: DetectMitigationActionsTaskSummary
s@DetectMitigationActionsTaskSummary' {} Maybe DetectMitigationActionsTaskStatistics
a -> DetectMitigationActionsTaskSummary
s {$sel:taskStatistics:DetectMitigationActionsTaskSummary' :: Maybe DetectMitigationActionsTaskStatistics
taskStatistics = Maybe DetectMitigationActionsTaskStatistics
a} :: DetectMitigationActionsTaskSummary)

-- | The definition of the actions.
detectMitigationActionsTaskSummary_actionsDefinition :: Lens.Lens' DetectMitigationActionsTaskSummary (Prelude.Maybe [MitigationAction])
detectMitigationActionsTaskSummary_actionsDefinition :: (Maybe [MitigationAction] -> f (Maybe [MitigationAction]))
-> DetectMitigationActionsTaskSummary
-> f DetectMitigationActionsTaskSummary
detectMitigationActionsTaskSummary_actionsDefinition = (DetectMitigationActionsTaskSummary -> Maybe [MitigationAction])
-> (DetectMitigationActionsTaskSummary
    -> Maybe [MitigationAction] -> DetectMitigationActionsTaskSummary)
-> Lens
     DetectMitigationActionsTaskSummary
     DetectMitigationActionsTaskSummary
     (Maybe [MitigationAction])
     (Maybe [MitigationAction])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectMitigationActionsTaskSummary' {Maybe [MitigationAction]
actionsDefinition :: Maybe [MitigationAction]
$sel:actionsDefinition:DetectMitigationActionsTaskSummary' :: DetectMitigationActionsTaskSummary -> Maybe [MitigationAction]
actionsDefinition} -> Maybe [MitigationAction]
actionsDefinition) (\s :: DetectMitigationActionsTaskSummary
s@DetectMitigationActionsTaskSummary' {} Maybe [MitigationAction]
a -> DetectMitigationActionsTaskSummary
s {$sel:actionsDefinition:DetectMitigationActionsTaskSummary' :: Maybe [MitigationAction]
actionsDefinition = Maybe [MitigationAction]
a} :: DetectMitigationActionsTaskSummary) ((Maybe [MitigationAction] -> f (Maybe [MitigationAction]))
 -> DetectMitigationActionsTaskSummary
 -> f DetectMitigationActionsTaskSummary)
-> ((Maybe [MitigationAction] -> f (Maybe [MitigationAction]))
    -> Maybe [MitigationAction] -> f (Maybe [MitigationAction]))
-> (Maybe [MitigationAction] -> f (Maybe [MitigationAction]))
-> DetectMitigationActionsTaskSummary
-> f DetectMitigationActionsTaskSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MitigationAction]
  [MitigationAction]
  [MitigationAction]
  [MitigationAction]
-> Iso
     (Maybe [MitigationAction])
     (Maybe [MitigationAction])
     (Maybe [MitigationAction])
     (Maybe [MitigationAction])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [MitigationAction]
  [MitigationAction]
  [MitigationAction]
  [MitigationAction]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The date the task ended.
detectMitigationActionsTaskSummary_taskEndTime :: Lens.Lens' DetectMitigationActionsTaskSummary (Prelude.Maybe Prelude.UTCTime)
detectMitigationActionsTaskSummary_taskEndTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DetectMitigationActionsTaskSummary
-> f DetectMitigationActionsTaskSummary
detectMitigationActionsTaskSummary_taskEndTime = (DetectMitigationActionsTaskSummary -> Maybe POSIX)
-> (DetectMitigationActionsTaskSummary
    -> Maybe POSIX -> DetectMitigationActionsTaskSummary)
-> Lens
     DetectMitigationActionsTaskSummary
     DetectMitigationActionsTaskSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectMitigationActionsTaskSummary' {Maybe POSIX
taskEndTime :: Maybe POSIX
$sel:taskEndTime:DetectMitigationActionsTaskSummary' :: DetectMitigationActionsTaskSummary -> Maybe POSIX
taskEndTime} -> Maybe POSIX
taskEndTime) (\s :: DetectMitigationActionsTaskSummary
s@DetectMitigationActionsTaskSummary' {} Maybe POSIX
a -> DetectMitigationActionsTaskSummary
s {$sel:taskEndTime:DetectMitigationActionsTaskSummary' :: Maybe POSIX
taskEndTime = Maybe POSIX
a} :: DetectMitigationActionsTaskSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> DetectMitigationActionsTaskSummary
 -> f DetectMitigationActionsTaskSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DetectMitigationActionsTaskSummary
-> f DetectMitigationActionsTaskSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Specifies the ML Detect findings to which the mitigation actions are
-- applied.
detectMitigationActionsTaskSummary_target :: Lens.Lens' DetectMitigationActionsTaskSummary (Prelude.Maybe DetectMitigationActionsTaskTarget)
detectMitigationActionsTaskSummary_target :: (Maybe DetectMitigationActionsTaskTarget
 -> f (Maybe DetectMitigationActionsTaskTarget))
-> DetectMitigationActionsTaskSummary
-> f DetectMitigationActionsTaskSummary
detectMitigationActionsTaskSummary_target = (DetectMitigationActionsTaskSummary
 -> Maybe DetectMitigationActionsTaskTarget)
-> (DetectMitigationActionsTaskSummary
    -> Maybe DetectMitigationActionsTaskTarget
    -> DetectMitigationActionsTaskSummary)
-> Lens
     DetectMitigationActionsTaskSummary
     DetectMitigationActionsTaskSummary
     (Maybe DetectMitigationActionsTaskTarget)
     (Maybe DetectMitigationActionsTaskTarget)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectMitigationActionsTaskSummary' {Maybe DetectMitigationActionsTaskTarget
target :: Maybe DetectMitigationActionsTaskTarget
$sel:target:DetectMitigationActionsTaskSummary' :: DetectMitigationActionsTaskSummary
-> Maybe DetectMitigationActionsTaskTarget
target} -> Maybe DetectMitigationActionsTaskTarget
target) (\s :: DetectMitigationActionsTaskSummary
s@DetectMitigationActionsTaskSummary' {} Maybe DetectMitigationActionsTaskTarget
a -> DetectMitigationActionsTaskSummary
s {$sel:target:DetectMitigationActionsTaskSummary' :: Maybe DetectMitigationActionsTaskTarget
target = Maybe DetectMitigationActionsTaskTarget
a} :: DetectMitigationActionsTaskSummary)

-- | The status of the task.
detectMitigationActionsTaskSummary_taskStatus :: Lens.Lens' DetectMitigationActionsTaskSummary (Prelude.Maybe DetectMitigationActionsTaskStatus)
detectMitigationActionsTaskSummary_taskStatus :: (Maybe DetectMitigationActionsTaskStatus
 -> f (Maybe DetectMitigationActionsTaskStatus))
-> DetectMitigationActionsTaskSummary
-> f DetectMitigationActionsTaskSummary
detectMitigationActionsTaskSummary_taskStatus = (DetectMitigationActionsTaskSummary
 -> Maybe DetectMitigationActionsTaskStatus)
-> (DetectMitigationActionsTaskSummary
    -> Maybe DetectMitigationActionsTaskStatus
    -> DetectMitigationActionsTaskSummary)
-> Lens
     DetectMitigationActionsTaskSummary
     DetectMitigationActionsTaskSummary
     (Maybe DetectMitigationActionsTaskStatus)
     (Maybe DetectMitigationActionsTaskStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectMitigationActionsTaskSummary' {Maybe DetectMitigationActionsTaskStatus
taskStatus :: Maybe DetectMitigationActionsTaskStatus
$sel:taskStatus:DetectMitigationActionsTaskSummary' :: DetectMitigationActionsTaskSummary
-> Maybe DetectMitigationActionsTaskStatus
taskStatus} -> Maybe DetectMitigationActionsTaskStatus
taskStatus) (\s :: DetectMitigationActionsTaskSummary
s@DetectMitigationActionsTaskSummary' {} Maybe DetectMitigationActionsTaskStatus
a -> DetectMitigationActionsTaskSummary
s {$sel:taskStatus:DetectMitigationActionsTaskSummary' :: Maybe DetectMitigationActionsTaskStatus
taskStatus = Maybe DetectMitigationActionsTaskStatus
a} :: DetectMitigationActionsTaskSummary)

instance
  Core.FromJSON
    DetectMitigationActionsTaskSummary
  where
  parseJSON :: Value -> Parser DetectMitigationActionsTaskSummary
parseJSON =
    String
-> (Object -> Parser DetectMitigationActionsTaskSummary)
-> Value
-> Parser DetectMitigationActionsTaskSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DetectMitigationActionsTaskSummary"
      ( \Object
x ->
          Maybe Bool
-> Maybe Bool
-> Maybe ViolationEventOccurrenceRange
-> Maybe Text
-> Maybe POSIX
-> Maybe DetectMitigationActionsTaskStatistics
-> Maybe [MitigationAction]
-> Maybe POSIX
-> Maybe DetectMitigationActionsTaskTarget
-> Maybe DetectMitigationActionsTaskStatus
-> DetectMitigationActionsTaskSummary
DetectMitigationActionsTaskSummary'
            (Maybe Bool
 -> Maybe Bool
 -> Maybe ViolationEventOccurrenceRange
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe DetectMitigationActionsTaskStatistics
 -> Maybe [MitigationAction]
 -> Maybe POSIX
 -> Maybe DetectMitigationActionsTaskTarget
 -> Maybe DetectMitigationActionsTaskStatus
 -> DetectMitigationActionsTaskSummary)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe ViolationEventOccurrenceRange
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe DetectMitigationActionsTaskStatistics
      -> Maybe [MitigationAction]
      -> Maybe POSIX
      -> Maybe DetectMitigationActionsTaskTarget
      -> Maybe DetectMitigationActionsTaskStatus
      -> DetectMitigationActionsTaskSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"onlyActiveViolationsIncluded")
            Parser
  (Maybe Bool
   -> Maybe ViolationEventOccurrenceRange
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe DetectMitigationActionsTaskStatistics
   -> Maybe [MitigationAction]
   -> Maybe POSIX
   -> Maybe DetectMitigationActionsTaskTarget
   -> Maybe DetectMitigationActionsTaskStatus
   -> DetectMitigationActionsTaskSummary)
-> Parser (Maybe Bool)
-> Parser
     (Maybe ViolationEventOccurrenceRange
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe DetectMitigationActionsTaskStatistics
      -> Maybe [MitigationAction]
      -> Maybe POSIX
      -> Maybe DetectMitigationActionsTaskTarget
      -> Maybe DetectMitigationActionsTaskStatus
      -> DetectMitigationActionsTaskSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"suppressedAlertsIncluded")
            Parser
  (Maybe ViolationEventOccurrenceRange
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe DetectMitigationActionsTaskStatistics
   -> Maybe [MitigationAction]
   -> Maybe POSIX
   -> Maybe DetectMitigationActionsTaskTarget
   -> Maybe DetectMitigationActionsTaskStatus
   -> DetectMitigationActionsTaskSummary)
-> Parser (Maybe ViolationEventOccurrenceRange)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe DetectMitigationActionsTaskStatistics
      -> Maybe [MitigationAction]
      -> Maybe POSIX
      -> Maybe DetectMitigationActionsTaskTarget
      -> Maybe DetectMitigationActionsTaskStatus
      -> DetectMitigationActionsTaskSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ViolationEventOccurrenceRange)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"violationEventOccurrenceRange")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe DetectMitigationActionsTaskStatistics
   -> Maybe [MitigationAction]
   -> Maybe POSIX
   -> Maybe DetectMitigationActionsTaskTarget
   -> Maybe DetectMitigationActionsTaskStatus
   -> DetectMitigationActionsTaskSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe DetectMitigationActionsTaskStatistics
      -> Maybe [MitigationAction]
      -> Maybe POSIX
      -> Maybe DetectMitigationActionsTaskTarget
      -> Maybe DetectMitigationActionsTaskStatus
      -> DetectMitigationActionsTaskSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"taskId")
            Parser
  (Maybe POSIX
   -> Maybe DetectMitigationActionsTaskStatistics
   -> Maybe [MitigationAction]
   -> Maybe POSIX
   -> Maybe DetectMitigationActionsTaskTarget
   -> Maybe DetectMitigationActionsTaskStatus
   -> DetectMitigationActionsTaskSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe DetectMitigationActionsTaskStatistics
      -> Maybe [MitigationAction]
      -> Maybe POSIX
      -> Maybe DetectMitigationActionsTaskTarget
      -> Maybe DetectMitigationActionsTaskStatus
      -> DetectMitigationActionsTaskSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"taskStartTime")
            Parser
  (Maybe DetectMitigationActionsTaskStatistics
   -> Maybe [MitigationAction]
   -> Maybe POSIX
   -> Maybe DetectMitigationActionsTaskTarget
   -> Maybe DetectMitigationActionsTaskStatus
   -> DetectMitigationActionsTaskSummary)
-> Parser (Maybe DetectMitigationActionsTaskStatistics)
-> Parser
     (Maybe [MitigationAction]
      -> Maybe POSIX
      -> Maybe DetectMitigationActionsTaskTarget
      -> Maybe DetectMitigationActionsTaskStatus
      -> DetectMitigationActionsTaskSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe DetectMitigationActionsTaskStatistics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"taskStatistics")
            Parser
  (Maybe [MitigationAction]
   -> Maybe POSIX
   -> Maybe DetectMitigationActionsTaskTarget
   -> Maybe DetectMitigationActionsTaskStatus
   -> DetectMitigationActionsTaskSummary)
-> Parser (Maybe [MitigationAction])
-> Parser
     (Maybe POSIX
      -> Maybe DetectMitigationActionsTaskTarget
      -> Maybe DetectMitigationActionsTaskStatus
      -> DetectMitigationActionsTaskSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [MitigationAction]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"actionsDefinition"
                            Parser (Maybe (Maybe [MitigationAction]))
-> Maybe [MitigationAction] -> Parser (Maybe [MitigationAction])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [MitigationAction]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe POSIX
   -> Maybe DetectMitigationActionsTaskTarget
   -> Maybe DetectMitigationActionsTaskStatus
   -> DetectMitigationActionsTaskSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe DetectMitigationActionsTaskTarget
      -> Maybe DetectMitigationActionsTaskStatus
      -> DetectMitigationActionsTaskSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"taskEndTime")
            Parser
  (Maybe DetectMitigationActionsTaskTarget
   -> Maybe DetectMitigationActionsTaskStatus
   -> DetectMitigationActionsTaskSummary)
-> Parser (Maybe DetectMitigationActionsTaskTarget)
-> Parser
     (Maybe DetectMitigationActionsTaskStatus
      -> DetectMitigationActionsTaskSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DetectMitigationActionsTaskTarget)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"target")
            Parser
  (Maybe DetectMitigationActionsTaskStatus
   -> DetectMitigationActionsTaskSummary)
-> Parser (Maybe DetectMitigationActionsTaskStatus)
-> Parser DetectMitigationActionsTaskSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DetectMitigationActionsTaskStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"taskStatus")
      )

instance
  Prelude.Hashable
    DetectMitigationActionsTaskSummary

instance
  Prelude.NFData
    DetectMitigationActionsTaskSummary