{-# 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.TaskStatisticsForAuditCheck
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoT.Types.TaskStatisticsForAuditCheck where

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

-- | Provides summary counts of how many tasks for findings are in a
-- particular state. This information is included in the response from
-- DescribeAuditMitigationActionsTask.
--
-- /See:/ 'newTaskStatisticsForAuditCheck' smart constructor.
data TaskStatisticsForAuditCheck = TaskStatisticsForAuditCheck'
  { -- | The number of findings to which the mitigation action task was canceled
    -- when applied.
    TaskStatisticsForAuditCheck -> Maybe Integer
canceledFindingsCount :: Prelude.Maybe Prelude.Integer,
    -- | The number of findings for which at least one of the actions failed when
    -- applied.
    TaskStatisticsForAuditCheck -> Maybe Integer
failedFindingsCount :: Prelude.Maybe Prelude.Integer,
    -- | The number of findings skipped because of filter conditions provided in
    -- the parameters to the command.
    TaskStatisticsForAuditCheck -> Maybe Integer
skippedFindingsCount :: Prelude.Maybe Prelude.Integer,
    -- | The number of findings for which all mitigation actions succeeded when
    -- applied.
    TaskStatisticsForAuditCheck -> Maybe Integer
succeededFindingsCount :: Prelude.Maybe Prelude.Integer,
    -- | The total number of findings to which a task is being applied.
    TaskStatisticsForAuditCheck -> Maybe Integer
totalFindingsCount :: Prelude.Maybe Prelude.Integer
  }
  deriving (TaskStatisticsForAuditCheck -> TaskStatisticsForAuditCheck -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TaskStatisticsForAuditCheck -> TaskStatisticsForAuditCheck -> Bool
$c/= :: TaskStatisticsForAuditCheck -> TaskStatisticsForAuditCheck -> Bool
== :: TaskStatisticsForAuditCheck -> TaskStatisticsForAuditCheck -> Bool
$c== :: TaskStatisticsForAuditCheck -> TaskStatisticsForAuditCheck -> Bool
Prelude.Eq, ReadPrec [TaskStatisticsForAuditCheck]
ReadPrec TaskStatisticsForAuditCheck
Int -> ReadS TaskStatisticsForAuditCheck
ReadS [TaskStatisticsForAuditCheck]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TaskStatisticsForAuditCheck]
$creadListPrec :: ReadPrec [TaskStatisticsForAuditCheck]
readPrec :: ReadPrec TaskStatisticsForAuditCheck
$creadPrec :: ReadPrec TaskStatisticsForAuditCheck
readList :: ReadS [TaskStatisticsForAuditCheck]
$creadList :: ReadS [TaskStatisticsForAuditCheck]
readsPrec :: Int -> ReadS TaskStatisticsForAuditCheck
$creadsPrec :: Int -> ReadS TaskStatisticsForAuditCheck
Prelude.Read, Int -> TaskStatisticsForAuditCheck -> ShowS
[TaskStatisticsForAuditCheck] -> ShowS
TaskStatisticsForAuditCheck -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TaskStatisticsForAuditCheck] -> ShowS
$cshowList :: [TaskStatisticsForAuditCheck] -> ShowS
show :: TaskStatisticsForAuditCheck -> String
$cshow :: TaskStatisticsForAuditCheck -> String
showsPrec :: Int -> TaskStatisticsForAuditCheck -> ShowS
$cshowsPrec :: Int -> TaskStatisticsForAuditCheck -> ShowS
Prelude.Show, forall x.
Rep TaskStatisticsForAuditCheck x -> TaskStatisticsForAuditCheck
forall x.
TaskStatisticsForAuditCheck -> Rep TaskStatisticsForAuditCheck x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TaskStatisticsForAuditCheck x -> TaskStatisticsForAuditCheck
$cfrom :: forall x.
TaskStatisticsForAuditCheck -> Rep TaskStatisticsForAuditCheck x
Prelude.Generic)

-- |
-- Create a value of 'TaskStatisticsForAuditCheck' 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:
--
-- 'canceledFindingsCount', 'taskStatisticsForAuditCheck_canceledFindingsCount' - The number of findings to which the mitigation action task was canceled
-- when applied.
--
-- 'failedFindingsCount', 'taskStatisticsForAuditCheck_failedFindingsCount' - The number of findings for which at least one of the actions failed when
-- applied.
--
-- 'skippedFindingsCount', 'taskStatisticsForAuditCheck_skippedFindingsCount' - The number of findings skipped because of filter conditions provided in
-- the parameters to the command.
--
-- 'succeededFindingsCount', 'taskStatisticsForAuditCheck_succeededFindingsCount' - The number of findings for which all mitigation actions succeeded when
-- applied.
--
-- 'totalFindingsCount', 'taskStatisticsForAuditCheck_totalFindingsCount' - The total number of findings to which a task is being applied.
newTaskStatisticsForAuditCheck ::
  TaskStatisticsForAuditCheck
newTaskStatisticsForAuditCheck :: TaskStatisticsForAuditCheck
newTaskStatisticsForAuditCheck =
  TaskStatisticsForAuditCheck'
    { $sel:canceledFindingsCount:TaskStatisticsForAuditCheck' :: Maybe Integer
canceledFindingsCount =
        forall a. Maybe a
Prelude.Nothing,
      $sel:failedFindingsCount:TaskStatisticsForAuditCheck' :: Maybe Integer
failedFindingsCount = forall a. Maybe a
Prelude.Nothing,
      $sel:skippedFindingsCount:TaskStatisticsForAuditCheck' :: Maybe Integer
skippedFindingsCount = forall a. Maybe a
Prelude.Nothing,
      $sel:succeededFindingsCount:TaskStatisticsForAuditCheck' :: Maybe Integer
succeededFindingsCount = forall a. Maybe a
Prelude.Nothing,
      $sel:totalFindingsCount:TaskStatisticsForAuditCheck' :: Maybe Integer
totalFindingsCount = forall a. Maybe a
Prelude.Nothing
    }

-- | The number of findings to which the mitigation action task was canceled
-- when applied.
taskStatisticsForAuditCheck_canceledFindingsCount :: Lens.Lens' TaskStatisticsForAuditCheck (Prelude.Maybe Prelude.Integer)
taskStatisticsForAuditCheck_canceledFindingsCount :: Lens' TaskStatisticsForAuditCheck (Maybe Integer)
taskStatisticsForAuditCheck_canceledFindingsCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskStatisticsForAuditCheck' {Maybe Integer
canceledFindingsCount :: Maybe Integer
$sel:canceledFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
canceledFindingsCount} -> Maybe Integer
canceledFindingsCount) (\s :: TaskStatisticsForAuditCheck
s@TaskStatisticsForAuditCheck' {} Maybe Integer
a -> TaskStatisticsForAuditCheck
s {$sel:canceledFindingsCount:TaskStatisticsForAuditCheck' :: Maybe Integer
canceledFindingsCount = Maybe Integer
a} :: TaskStatisticsForAuditCheck)

-- | The number of findings for which at least one of the actions failed when
-- applied.
taskStatisticsForAuditCheck_failedFindingsCount :: Lens.Lens' TaskStatisticsForAuditCheck (Prelude.Maybe Prelude.Integer)
taskStatisticsForAuditCheck_failedFindingsCount :: Lens' TaskStatisticsForAuditCheck (Maybe Integer)
taskStatisticsForAuditCheck_failedFindingsCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskStatisticsForAuditCheck' {Maybe Integer
failedFindingsCount :: Maybe Integer
$sel:failedFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
failedFindingsCount} -> Maybe Integer
failedFindingsCount) (\s :: TaskStatisticsForAuditCheck
s@TaskStatisticsForAuditCheck' {} Maybe Integer
a -> TaskStatisticsForAuditCheck
s {$sel:failedFindingsCount:TaskStatisticsForAuditCheck' :: Maybe Integer
failedFindingsCount = Maybe Integer
a} :: TaskStatisticsForAuditCheck)

-- | The number of findings skipped because of filter conditions provided in
-- the parameters to the command.
taskStatisticsForAuditCheck_skippedFindingsCount :: Lens.Lens' TaskStatisticsForAuditCheck (Prelude.Maybe Prelude.Integer)
taskStatisticsForAuditCheck_skippedFindingsCount :: Lens' TaskStatisticsForAuditCheck (Maybe Integer)
taskStatisticsForAuditCheck_skippedFindingsCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskStatisticsForAuditCheck' {Maybe Integer
skippedFindingsCount :: Maybe Integer
$sel:skippedFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
skippedFindingsCount} -> Maybe Integer
skippedFindingsCount) (\s :: TaskStatisticsForAuditCheck
s@TaskStatisticsForAuditCheck' {} Maybe Integer
a -> TaskStatisticsForAuditCheck
s {$sel:skippedFindingsCount:TaskStatisticsForAuditCheck' :: Maybe Integer
skippedFindingsCount = Maybe Integer
a} :: TaskStatisticsForAuditCheck)

-- | The number of findings for which all mitigation actions succeeded when
-- applied.
taskStatisticsForAuditCheck_succeededFindingsCount :: Lens.Lens' TaskStatisticsForAuditCheck (Prelude.Maybe Prelude.Integer)
taskStatisticsForAuditCheck_succeededFindingsCount :: Lens' TaskStatisticsForAuditCheck (Maybe Integer)
taskStatisticsForAuditCheck_succeededFindingsCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskStatisticsForAuditCheck' {Maybe Integer
succeededFindingsCount :: Maybe Integer
$sel:succeededFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
succeededFindingsCount} -> Maybe Integer
succeededFindingsCount) (\s :: TaskStatisticsForAuditCheck
s@TaskStatisticsForAuditCheck' {} Maybe Integer
a -> TaskStatisticsForAuditCheck
s {$sel:succeededFindingsCount:TaskStatisticsForAuditCheck' :: Maybe Integer
succeededFindingsCount = Maybe Integer
a} :: TaskStatisticsForAuditCheck)

-- | The total number of findings to which a task is being applied.
taskStatisticsForAuditCheck_totalFindingsCount :: Lens.Lens' TaskStatisticsForAuditCheck (Prelude.Maybe Prelude.Integer)
taskStatisticsForAuditCheck_totalFindingsCount :: Lens' TaskStatisticsForAuditCheck (Maybe Integer)
taskStatisticsForAuditCheck_totalFindingsCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskStatisticsForAuditCheck' {Maybe Integer
totalFindingsCount :: Maybe Integer
$sel:totalFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
totalFindingsCount} -> Maybe Integer
totalFindingsCount) (\s :: TaskStatisticsForAuditCheck
s@TaskStatisticsForAuditCheck' {} Maybe Integer
a -> TaskStatisticsForAuditCheck
s {$sel:totalFindingsCount:TaskStatisticsForAuditCheck' :: Maybe Integer
totalFindingsCount = Maybe Integer
a} :: TaskStatisticsForAuditCheck)

instance Data.FromJSON TaskStatisticsForAuditCheck where
  parseJSON :: Value -> Parser TaskStatisticsForAuditCheck
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TaskStatisticsForAuditCheck"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> TaskStatisticsForAuditCheck
TaskStatisticsForAuditCheck'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"canceledFindingsCount")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"failedFindingsCount")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"skippedFindingsCount")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"succeededFindingsCount")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"totalFindingsCount")
      )

instance Prelude.Hashable TaskStatisticsForAuditCheck where
  hashWithSalt :: Int -> TaskStatisticsForAuditCheck -> Int
hashWithSalt Int
_salt TaskStatisticsForAuditCheck' {Maybe Integer
totalFindingsCount :: Maybe Integer
succeededFindingsCount :: Maybe Integer
skippedFindingsCount :: Maybe Integer
failedFindingsCount :: Maybe Integer
canceledFindingsCount :: Maybe Integer
$sel:totalFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
$sel:succeededFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
$sel:skippedFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
$sel:failedFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
$sel:canceledFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
canceledFindingsCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
failedFindingsCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
skippedFindingsCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
succeededFindingsCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
totalFindingsCount

instance Prelude.NFData TaskStatisticsForAuditCheck where
  rnf :: TaskStatisticsForAuditCheck -> ()
rnf TaskStatisticsForAuditCheck' {Maybe Integer
totalFindingsCount :: Maybe Integer
succeededFindingsCount :: Maybe Integer
skippedFindingsCount :: Maybe Integer
failedFindingsCount :: Maybe Integer
canceledFindingsCount :: Maybe Integer
$sel:totalFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
$sel:succeededFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
$sel:skippedFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
$sel:failedFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
$sel:canceledFindingsCount:TaskStatisticsForAuditCheck' :: TaskStatisticsForAuditCheck -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
canceledFindingsCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
failedFindingsCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
skippedFindingsCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
succeededFindingsCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
totalFindingsCount