{-# 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.AuditManager.Types.EvidenceInsights
-- 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.AuditManager.Types.EvidenceInsights 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

-- | A breakdown of the latest compliance check status for the evidence in
-- your Audit Manager assessments.
--
-- /See:/ 'newEvidenceInsights' smart constructor.
data EvidenceInsights = EvidenceInsights'
  { -- | The number of compliance check evidence that Audit Manager classified as
    -- compliant. This includes evidence that was collected from Security Hub
    -- with a /Pass/ ruling, or collected from Config with a /Compliant/
    -- ruling.
    EvidenceInsights -> Maybe Int
compliantEvidenceCount :: Prelude.Maybe Prelude.Int,
    -- | The number of evidence that a compliance check ruling isn\'t available
    -- for. Evidence is inconclusive when the associated control uses Security
    -- Hub or Config as a data source but you didn\'t enable those services.
    -- This is also the case when a control uses a data source that doesn’t
    -- support compliance checks (for example, manual evidence, API calls, or
    -- CloudTrail).
    --
    -- If evidence has a compliance check status of /not applicable/ in the
    -- console, it\'s classified as /inconclusive/ in @EvidenceInsights@ data.
    EvidenceInsights -> Maybe Int
inconclusiveEvidenceCount :: Prelude.Maybe Prelude.Int,
    -- | The number of compliance check evidence that Audit Manager classified as
    -- non-compliant. This includes evidence that was collected from Security
    -- Hub with a /Fail/ ruling, or collected from Config with a
    -- /Non-compliant/ ruling.
    EvidenceInsights -> Maybe Int
noncompliantEvidenceCount :: Prelude.Maybe Prelude.Int
  }
  deriving (EvidenceInsights -> EvidenceInsights -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EvidenceInsights -> EvidenceInsights -> Bool
$c/= :: EvidenceInsights -> EvidenceInsights -> Bool
== :: EvidenceInsights -> EvidenceInsights -> Bool
$c== :: EvidenceInsights -> EvidenceInsights -> Bool
Prelude.Eq, ReadPrec [EvidenceInsights]
ReadPrec EvidenceInsights
Int -> ReadS EvidenceInsights
ReadS [EvidenceInsights]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EvidenceInsights]
$creadListPrec :: ReadPrec [EvidenceInsights]
readPrec :: ReadPrec EvidenceInsights
$creadPrec :: ReadPrec EvidenceInsights
readList :: ReadS [EvidenceInsights]
$creadList :: ReadS [EvidenceInsights]
readsPrec :: Int -> ReadS EvidenceInsights
$creadsPrec :: Int -> ReadS EvidenceInsights
Prelude.Read, Int -> EvidenceInsights -> ShowS
[EvidenceInsights] -> ShowS
EvidenceInsights -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EvidenceInsights] -> ShowS
$cshowList :: [EvidenceInsights] -> ShowS
show :: EvidenceInsights -> String
$cshow :: EvidenceInsights -> String
showsPrec :: Int -> EvidenceInsights -> ShowS
$cshowsPrec :: Int -> EvidenceInsights -> ShowS
Prelude.Show, forall x. Rep EvidenceInsights x -> EvidenceInsights
forall x. EvidenceInsights -> Rep EvidenceInsights x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EvidenceInsights x -> EvidenceInsights
$cfrom :: forall x. EvidenceInsights -> Rep EvidenceInsights x
Prelude.Generic)

-- |
-- Create a value of 'EvidenceInsights' 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:
--
-- 'compliantEvidenceCount', 'evidenceInsights_compliantEvidenceCount' - The number of compliance check evidence that Audit Manager classified as
-- compliant. This includes evidence that was collected from Security Hub
-- with a /Pass/ ruling, or collected from Config with a /Compliant/
-- ruling.
--
-- 'inconclusiveEvidenceCount', 'evidenceInsights_inconclusiveEvidenceCount' - The number of evidence that a compliance check ruling isn\'t available
-- for. Evidence is inconclusive when the associated control uses Security
-- Hub or Config as a data source but you didn\'t enable those services.
-- This is also the case when a control uses a data source that doesn’t
-- support compliance checks (for example, manual evidence, API calls, or
-- CloudTrail).
--
-- If evidence has a compliance check status of /not applicable/ in the
-- console, it\'s classified as /inconclusive/ in @EvidenceInsights@ data.
--
-- 'noncompliantEvidenceCount', 'evidenceInsights_noncompliantEvidenceCount' - The number of compliance check evidence that Audit Manager classified as
-- non-compliant. This includes evidence that was collected from Security
-- Hub with a /Fail/ ruling, or collected from Config with a
-- /Non-compliant/ ruling.
newEvidenceInsights ::
  EvidenceInsights
newEvidenceInsights :: EvidenceInsights
newEvidenceInsights =
  EvidenceInsights'
    { $sel:compliantEvidenceCount:EvidenceInsights' :: Maybe Int
compliantEvidenceCount =
        forall a. Maybe a
Prelude.Nothing,
      $sel:inconclusiveEvidenceCount:EvidenceInsights' :: Maybe Int
inconclusiveEvidenceCount = forall a. Maybe a
Prelude.Nothing,
      $sel:noncompliantEvidenceCount:EvidenceInsights' :: Maybe Int
noncompliantEvidenceCount = forall a. Maybe a
Prelude.Nothing
    }

-- | The number of compliance check evidence that Audit Manager classified as
-- compliant. This includes evidence that was collected from Security Hub
-- with a /Pass/ ruling, or collected from Config with a /Compliant/
-- ruling.
evidenceInsights_compliantEvidenceCount :: Lens.Lens' EvidenceInsights (Prelude.Maybe Prelude.Int)
evidenceInsights_compliantEvidenceCount :: Lens' EvidenceInsights (Maybe Int)
evidenceInsights_compliantEvidenceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvidenceInsights' {Maybe Int
compliantEvidenceCount :: Maybe Int
$sel:compliantEvidenceCount:EvidenceInsights' :: EvidenceInsights -> Maybe Int
compliantEvidenceCount} -> Maybe Int
compliantEvidenceCount) (\s :: EvidenceInsights
s@EvidenceInsights' {} Maybe Int
a -> EvidenceInsights
s {$sel:compliantEvidenceCount:EvidenceInsights' :: Maybe Int
compliantEvidenceCount = Maybe Int
a} :: EvidenceInsights)

-- | The number of evidence that a compliance check ruling isn\'t available
-- for. Evidence is inconclusive when the associated control uses Security
-- Hub or Config as a data source but you didn\'t enable those services.
-- This is also the case when a control uses a data source that doesn’t
-- support compliance checks (for example, manual evidence, API calls, or
-- CloudTrail).
--
-- If evidence has a compliance check status of /not applicable/ in the
-- console, it\'s classified as /inconclusive/ in @EvidenceInsights@ data.
evidenceInsights_inconclusiveEvidenceCount :: Lens.Lens' EvidenceInsights (Prelude.Maybe Prelude.Int)
evidenceInsights_inconclusiveEvidenceCount :: Lens' EvidenceInsights (Maybe Int)
evidenceInsights_inconclusiveEvidenceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvidenceInsights' {Maybe Int
inconclusiveEvidenceCount :: Maybe Int
$sel:inconclusiveEvidenceCount:EvidenceInsights' :: EvidenceInsights -> Maybe Int
inconclusiveEvidenceCount} -> Maybe Int
inconclusiveEvidenceCount) (\s :: EvidenceInsights
s@EvidenceInsights' {} Maybe Int
a -> EvidenceInsights
s {$sel:inconclusiveEvidenceCount:EvidenceInsights' :: Maybe Int
inconclusiveEvidenceCount = Maybe Int
a} :: EvidenceInsights)

-- | The number of compliance check evidence that Audit Manager classified as
-- non-compliant. This includes evidence that was collected from Security
-- Hub with a /Fail/ ruling, or collected from Config with a
-- /Non-compliant/ ruling.
evidenceInsights_noncompliantEvidenceCount :: Lens.Lens' EvidenceInsights (Prelude.Maybe Prelude.Int)
evidenceInsights_noncompliantEvidenceCount :: Lens' EvidenceInsights (Maybe Int)
evidenceInsights_noncompliantEvidenceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvidenceInsights' {Maybe Int
noncompliantEvidenceCount :: Maybe Int
$sel:noncompliantEvidenceCount:EvidenceInsights' :: EvidenceInsights -> Maybe Int
noncompliantEvidenceCount} -> Maybe Int
noncompliantEvidenceCount) (\s :: EvidenceInsights
s@EvidenceInsights' {} Maybe Int
a -> EvidenceInsights
s {$sel:noncompliantEvidenceCount:EvidenceInsights' :: Maybe Int
noncompliantEvidenceCount = Maybe Int
a} :: EvidenceInsights)

instance Data.FromJSON EvidenceInsights where
  parseJSON :: Value -> Parser EvidenceInsights
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EvidenceInsights"
      ( \Object
x ->
          Maybe Int -> Maybe Int -> Maybe Int -> EvidenceInsights
EvidenceInsights'
            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
"compliantEvidenceCount")
            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
"inconclusiveEvidenceCount")
            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
"noncompliantEvidenceCount")
      )

instance Prelude.Hashable EvidenceInsights where
  hashWithSalt :: Int -> EvidenceInsights -> Int
hashWithSalt Int
_salt EvidenceInsights' {Maybe Int
noncompliantEvidenceCount :: Maybe Int
inconclusiveEvidenceCount :: Maybe Int
compliantEvidenceCount :: Maybe Int
$sel:noncompliantEvidenceCount:EvidenceInsights' :: EvidenceInsights -> Maybe Int
$sel:inconclusiveEvidenceCount:EvidenceInsights' :: EvidenceInsights -> Maybe Int
$sel:compliantEvidenceCount:EvidenceInsights' :: EvidenceInsights -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
compliantEvidenceCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
inconclusiveEvidenceCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
noncompliantEvidenceCount

instance Prelude.NFData EvidenceInsights where
  rnf :: EvidenceInsights -> ()
rnf EvidenceInsights' {Maybe Int
noncompliantEvidenceCount :: Maybe Int
inconclusiveEvidenceCount :: Maybe Int
compliantEvidenceCount :: Maybe Int
$sel:noncompliantEvidenceCount:EvidenceInsights' :: EvidenceInsights -> Maybe Int
$sel:inconclusiveEvidenceCount:EvidenceInsights' :: EvidenceInsights -> Maybe Int
$sel:compliantEvidenceCount:EvidenceInsights' :: EvidenceInsights -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
compliantEvidenceCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
inconclusiveEvidenceCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
noncompliantEvidenceCount