{-# 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.DetectMitigationActionsTaskStatistics
-- 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.DetectMitigationActionsTaskStatistics where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The statistics of a mitigation action task.
--
-- /See:/ 'newDetectMitigationActionsTaskStatistics' smart constructor.
data DetectMitigationActionsTaskStatistics = DetectMitigationActionsTaskStatistics'
  { -- | The actions that failed.
    DetectMitigationActionsTaskStatistics -> Maybe Integer
actionsFailed :: Prelude.Maybe Prelude.Integer,
    -- | The actions that were skipped.
    DetectMitigationActionsTaskStatistics -> Maybe Integer
actionsSkipped :: Prelude.Maybe Prelude.Integer,
    -- | The actions that were performed.
    DetectMitigationActionsTaskStatistics -> Maybe Integer
actionsExecuted :: Prelude.Maybe Prelude.Integer
  }
  deriving (DetectMitigationActionsTaskStatistics
-> DetectMitigationActionsTaskStatistics -> Bool
(DetectMitigationActionsTaskStatistics
 -> DetectMitigationActionsTaskStatistics -> Bool)
-> (DetectMitigationActionsTaskStatistics
    -> DetectMitigationActionsTaskStatistics -> Bool)
-> Eq DetectMitigationActionsTaskStatistics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectMitigationActionsTaskStatistics
-> DetectMitigationActionsTaskStatistics -> Bool
$c/= :: DetectMitigationActionsTaskStatistics
-> DetectMitigationActionsTaskStatistics -> Bool
== :: DetectMitigationActionsTaskStatistics
-> DetectMitigationActionsTaskStatistics -> Bool
$c== :: DetectMitigationActionsTaskStatistics
-> DetectMitigationActionsTaskStatistics -> Bool
Prelude.Eq, ReadPrec [DetectMitigationActionsTaskStatistics]
ReadPrec DetectMitigationActionsTaskStatistics
Int -> ReadS DetectMitigationActionsTaskStatistics
ReadS [DetectMitigationActionsTaskStatistics]
(Int -> ReadS DetectMitigationActionsTaskStatistics)
-> ReadS [DetectMitigationActionsTaskStatistics]
-> ReadPrec DetectMitigationActionsTaskStatistics
-> ReadPrec [DetectMitigationActionsTaskStatistics]
-> Read DetectMitigationActionsTaskStatistics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectMitigationActionsTaskStatistics]
$creadListPrec :: ReadPrec [DetectMitigationActionsTaskStatistics]
readPrec :: ReadPrec DetectMitigationActionsTaskStatistics
$creadPrec :: ReadPrec DetectMitigationActionsTaskStatistics
readList :: ReadS [DetectMitigationActionsTaskStatistics]
$creadList :: ReadS [DetectMitigationActionsTaskStatistics]
readsPrec :: Int -> ReadS DetectMitigationActionsTaskStatistics
$creadsPrec :: Int -> ReadS DetectMitigationActionsTaskStatistics
Prelude.Read, Int -> DetectMitigationActionsTaskStatistics -> ShowS
[DetectMitigationActionsTaskStatistics] -> ShowS
DetectMitigationActionsTaskStatistics -> String
(Int -> DetectMitigationActionsTaskStatistics -> ShowS)
-> (DetectMitigationActionsTaskStatistics -> String)
-> ([DetectMitigationActionsTaskStatistics] -> ShowS)
-> Show DetectMitigationActionsTaskStatistics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectMitigationActionsTaskStatistics] -> ShowS
$cshowList :: [DetectMitigationActionsTaskStatistics] -> ShowS
show :: DetectMitigationActionsTaskStatistics -> String
$cshow :: DetectMitigationActionsTaskStatistics -> String
showsPrec :: Int -> DetectMitigationActionsTaskStatistics -> ShowS
$cshowsPrec :: Int -> DetectMitigationActionsTaskStatistics -> ShowS
Prelude.Show, (forall x.
 DetectMitigationActionsTaskStatistics
 -> Rep DetectMitigationActionsTaskStatistics x)
-> (forall x.
    Rep DetectMitigationActionsTaskStatistics x
    -> DetectMitigationActionsTaskStatistics)
-> Generic DetectMitigationActionsTaskStatistics
forall x.
Rep DetectMitigationActionsTaskStatistics x
-> DetectMitigationActionsTaskStatistics
forall x.
DetectMitigationActionsTaskStatistics
-> Rep DetectMitigationActionsTaskStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DetectMitigationActionsTaskStatistics x
-> DetectMitigationActionsTaskStatistics
$cfrom :: forall x.
DetectMitigationActionsTaskStatistics
-> Rep DetectMitigationActionsTaskStatistics x
Prelude.Generic)

-- |
-- Create a value of 'DetectMitigationActionsTaskStatistics' 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:
--
-- 'actionsFailed', 'detectMitigationActionsTaskStatistics_actionsFailed' - The actions that failed.
--
-- 'actionsSkipped', 'detectMitigationActionsTaskStatistics_actionsSkipped' - The actions that were skipped.
--
-- 'actionsExecuted', 'detectMitigationActionsTaskStatistics_actionsExecuted' - The actions that were performed.
newDetectMitigationActionsTaskStatistics ::
  DetectMitigationActionsTaskStatistics
newDetectMitigationActionsTaskStatistics :: DetectMitigationActionsTaskStatistics
newDetectMitigationActionsTaskStatistics =
  DetectMitigationActionsTaskStatistics' :: Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> DetectMitigationActionsTaskStatistics
DetectMitigationActionsTaskStatistics'
    { $sel:actionsFailed:DetectMitigationActionsTaskStatistics' :: Maybe Integer
actionsFailed =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:actionsSkipped:DetectMitigationActionsTaskStatistics' :: Maybe Integer
actionsSkipped = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:actionsExecuted:DetectMitigationActionsTaskStatistics' :: Maybe Integer
actionsExecuted = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | The actions that failed.
detectMitigationActionsTaskStatistics_actionsFailed :: Lens.Lens' DetectMitigationActionsTaskStatistics (Prelude.Maybe Prelude.Integer)
detectMitigationActionsTaskStatistics_actionsFailed :: (Maybe Integer -> f (Maybe Integer))
-> DetectMitigationActionsTaskStatistics
-> f DetectMitigationActionsTaskStatistics
detectMitigationActionsTaskStatistics_actionsFailed = (DetectMitigationActionsTaskStatistics -> Maybe Integer)
-> (DetectMitigationActionsTaskStatistics
    -> Maybe Integer -> DetectMitigationActionsTaskStatistics)
-> Lens
     DetectMitigationActionsTaskStatistics
     DetectMitigationActionsTaskStatistics
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectMitigationActionsTaskStatistics' {Maybe Integer
actionsFailed :: Maybe Integer
$sel:actionsFailed:DetectMitigationActionsTaskStatistics' :: DetectMitigationActionsTaskStatistics -> Maybe Integer
actionsFailed} -> Maybe Integer
actionsFailed) (\s :: DetectMitigationActionsTaskStatistics
s@DetectMitigationActionsTaskStatistics' {} Maybe Integer
a -> DetectMitigationActionsTaskStatistics
s {$sel:actionsFailed:DetectMitigationActionsTaskStatistics' :: Maybe Integer
actionsFailed = Maybe Integer
a} :: DetectMitigationActionsTaskStatistics)

-- | The actions that were skipped.
detectMitigationActionsTaskStatistics_actionsSkipped :: Lens.Lens' DetectMitigationActionsTaskStatistics (Prelude.Maybe Prelude.Integer)
detectMitigationActionsTaskStatistics_actionsSkipped :: (Maybe Integer -> f (Maybe Integer))
-> DetectMitigationActionsTaskStatistics
-> f DetectMitigationActionsTaskStatistics
detectMitigationActionsTaskStatistics_actionsSkipped = (DetectMitigationActionsTaskStatistics -> Maybe Integer)
-> (DetectMitigationActionsTaskStatistics
    -> Maybe Integer -> DetectMitigationActionsTaskStatistics)
-> Lens
     DetectMitigationActionsTaskStatistics
     DetectMitigationActionsTaskStatistics
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectMitigationActionsTaskStatistics' {Maybe Integer
actionsSkipped :: Maybe Integer
$sel:actionsSkipped:DetectMitigationActionsTaskStatistics' :: DetectMitigationActionsTaskStatistics -> Maybe Integer
actionsSkipped} -> Maybe Integer
actionsSkipped) (\s :: DetectMitigationActionsTaskStatistics
s@DetectMitigationActionsTaskStatistics' {} Maybe Integer
a -> DetectMitigationActionsTaskStatistics
s {$sel:actionsSkipped:DetectMitigationActionsTaskStatistics' :: Maybe Integer
actionsSkipped = Maybe Integer
a} :: DetectMitigationActionsTaskStatistics)

-- | The actions that were performed.
detectMitigationActionsTaskStatistics_actionsExecuted :: Lens.Lens' DetectMitigationActionsTaskStatistics (Prelude.Maybe Prelude.Integer)
detectMitigationActionsTaskStatistics_actionsExecuted :: (Maybe Integer -> f (Maybe Integer))
-> DetectMitigationActionsTaskStatistics
-> f DetectMitigationActionsTaskStatistics
detectMitigationActionsTaskStatistics_actionsExecuted = (DetectMitigationActionsTaskStatistics -> Maybe Integer)
-> (DetectMitigationActionsTaskStatistics
    -> Maybe Integer -> DetectMitigationActionsTaskStatistics)
-> Lens
     DetectMitigationActionsTaskStatistics
     DetectMitigationActionsTaskStatistics
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectMitigationActionsTaskStatistics' {Maybe Integer
actionsExecuted :: Maybe Integer
$sel:actionsExecuted:DetectMitigationActionsTaskStatistics' :: DetectMitigationActionsTaskStatistics -> Maybe Integer
actionsExecuted} -> Maybe Integer
actionsExecuted) (\s :: DetectMitigationActionsTaskStatistics
s@DetectMitigationActionsTaskStatistics' {} Maybe Integer
a -> DetectMitigationActionsTaskStatistics
s {$sel:actionsExecuted:DetectMitigationActionsTaskStatistics' :: Maybe Integer
actionsExecuted = Maybe Integer
a} :: DetectMitigationActionsTaskStatistics)

instance
  Core.FromJSON
    DetectMitigationActionsTaskStatistics
  where
  parseJSON :: Value -> Parser DetectMitigationActionsTaskStatistics
parseJSON =
    String
-> (Object -> Parser DetectMitigationActionsTaskStatistics)
-> Value
-> Parser DetectMitigationActionsTaskStatistics
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DetectMitigationActionsTaskStatistics"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> DetectMitigationActionsTaskStatistics
DetectMitigationActionsTaskStatistics'
            (Maybe Integer
 -> Maybe Integer
 -> Maybe Integer
 -> DetectMitigationActionsTaskStatistics)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Integer
      -> Maybe Integer -> DetectMitigationActionsTaskStatistics)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"actionsFailed")
            Parser
  (Maybe Integer
   -> Maybe Integer -> DetectMitigationActionsTaskStatistics)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> DetectMitigationActionsTaskStatistics)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"actionsSkipped")
            Parser (Maybe Integer -> DetectMitigationActionsTaskStatistics)
-> Parser (Maybe Integer)
-> Parser DetectMitigationActionsTaskStatistics
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"actionsExecuted")
      )

instance
  Prelude.Hashable
    DetectMitigationActionsTaskStatistics

instance
  Prelude.NFData
    DetectMitigationActionsTaskStatistics