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

import Amazonka.AuditManager.Types.Resource
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A record that contains the information needed to demonstrate compliance
-- with the requirements specified by a control. Examples of evidence
-- include change activity triggered by a user, or a system configuration
-- snapshot.
--
-- /See:/ 'newEvidence' smart constructor.
data Evidence = Evidence'
  { -- | The timestamp that represents when the evidence was collected.
    Evidence -> Maybe POSIX
time :: Prelude.Maybe Core.POSIX,
    -- | Specifies whether the evidence is included in the assessment report.
    Evidence -> Maybe Text
assessmentReportSelection :: Prelude.Maybe Prelude.Text,
    -- | The type of automated evidence.
    Evidence -> Maybe Text
evidenceByType :: Prelude.Maybe Prelude.Text,
    -- | The evaluation status for evidence that falls under the compliance check
    -- category. For evidence collected from Security Hub, a /Pass/ or /Fail/
    -- result is shown. For evidence collected from Config, a /Compliant/ or
    -- /Noncompliant/ result is shown.
    Evidence -> Maybe Text
complianceCheck :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services account from which the evidence is collected,
    -- and its organization path.
    Evidence -> Maybe Text
awsOrganization :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the specified Amazon Web Services account.
    Evidence -> Maybe Text
awsAccountId :: Prelude.Maybe Prelude.Text,
    -- | The names and values used by the evidence event, including an attribute
    -- name (such as @allowUsersToChangePassword@) and value (such as @true@ or
    -- @false@).
    Evidence -> Maybe (HashMap Text Text)
attributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The identifier for the specified Amazon Web Services account.
    Evidence -> Maybe Text
evidenceAwsAccountId :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the evidence.
    Evidence -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The data source from which the specified evidence was collected.
    Evidence -> Maybe Text
dataSource :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the folder in which the evidence is stored.
    Evidence -> Maybe Text
evidenceFolderId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the IAM user or role associated with the
    -- evidence.
    Evidence -> Maybe Text
iamId :: Prelude.Maybe Prelude.Text,
    -- | The name of the specified evidence event.
    Evidence -> Maybe Text
eventName :: Prelude.Maybe Prelude.Text,
    -- | The list of resources assessed to generate the evidence.
    Evidence -> Maybe [Resource]
resourcesIncluded :: Prelude.Maybe [Resource],
    -- | The Amazon Web Service from which the evidence is collected.
    Evidence -> Maybe Text
eventSource :: Prelude.Maybe Prelude.Text
  }
  deriving (Evidence -> Evidence -> Bool
(Evidence -> Evidence -> Bool)
-> (Evidence -> Evidence -> Bool) -> Eq Evidence
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Evidence -> Evidence -> Bool
$c/= :: Evidence -> Evidence -> Bool
== :: Evidence -> Evidence -> Bool
$c== :: Evidence -> Evidence -> Bool
Prelude.Eq, ReadPrec [Evidence]
ReadPrec Evidence
Int -> ReadS Evidence
ReadS [Evidence]
(Int -> ReadS Evidence)
-> ReadS [Evidence]
-> ReadPrec Evidence
-> ReadPrec [Evidence]
-> Read Evidence
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Evidence]
$creadListPrec :: ReadPrec [Evidence]
readPrec :: ReadPrec Evidence
$creadPrec :: ReadPrec Evidence
readList :: ReadS [Evidence]
$creadList :: ReadS [Evidence]
readsPrec :: Int -> ReadS Evidence
$creadsPrec :: Int -> ReadS Evidence
Prelude.Read, Int -> Evidence -> ShowS
[Evidence] -> ShowS
Evidence -> String
(Int -> Evidence -> ShowS)
-> (Evidence -> String) -> ([Evidence] -> ShowS) -> Show Evidence
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Evidence] -> ShowS
$cshowList :: [Evidence] -> ShowS
show :: Evidence -> String
$cshow :: Evidence -> String
showsPrec :: Int -> Evidence -> ShowS
$cshowsPrec :: Int -> Evidence -> ShowS
Prelude.Show, (forall x. Evidence -> Rep Evidence x)
-> (forall x. Rep Evidence x -> Evidence) -> Generic Evidence
forall x. Rep Evidence x -> Evidence
forall x. Evidence -> Rep Evidence x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Evidence x -> Evidence
$cfrom :: forall x. Evidence -> Rep Evidence x
Prelude.Generic)

-- |
-- Create a value of 'Evidence' 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:
--
-- 'time', 'evidence_time' - The timestamp that represents when the evidence was collected.
--
-- 'assessmentReportSelection', 'evidence_assessmentReportSelection' - Specifies whether the evidence is included in the assessment report.
--
-- 'evidenceByType', 'evidence_evidenceByType' - The type of automated evidence.
--
-- 'complianceCheck', 'evidence_complianceCheck' - The evaluation status for evidence that falls under the compliance check
-- category. For evidence collected from Security Hub, a /Pass/ or /Fail/
-- result is shown. For evidence collected from Config, a /Compliant/ or
-- /Noncompliant/ result is shown.
--
-- 'awsOrganization', 'evidence_awsOrganization' - The Amazon Web Services account from which the evidence is collected,
-- and its organization path.
--
-- 'awsAccountId', 'evidence_awsAccountId' - The identifier for the specified Amazon Web Services account.
--
-- 'attributes', 'evidence_attributes' - The names and values used by the evidence event, including an attribute
-- name (such as @allowUsersToChangePassword@) and value (such as @true@ or
-- @false@).
--
-- 'evidenceAwsAccountId', 'evidence_evidenceAwsAccountId' - The identifier for the specified Amazon Web Services account.
--
-- 'id', 'evidence_id' - The identifier for the evidence.
--
-- 'dataSource', 'evidence_dataSource' - The data source from which the specified evidence was collected.
--
-- 'evidenceFolderId', 'evidence_evidenceFolderId' - The identifier for the folder in which the evidence is stored.
--
-- 'iamId', 'evidence_iamId' - The unique identifier for the IAM user or role associated with the
-- evidence.
--
-- 'eventName', 'evidence_eventName' - The name of the specified evidence event.
--
-- 'resourcesIncluded', 'evidence_resourcesIncluded' - The list of resources assessed to generate the evidence.
--
-- 'eventSource', 'evidence_eventSource' - The Amazon Web Service from which the evidence is collected.
newEvidence ::
  Evidence
newEvidence :: Evidence
newEvidence =
  Evidence' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Resource]
-> Maybe Text
-> Evidence
Evidence'
    { $sel:time:Evidence' :: Maybe POSIX
time = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:assessmentReportSelection:Evidence' :: Maybe Text
assessmentReportSelection = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:evidenceByType:Evidence' :: Maybe Text
evidenceByType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:complianceCheck:Evidence' :: Maybe Text
complianceCheck = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:awsOrganization:Evidence' :: Maybe Text
awsOrganization = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:awsAccountId:Evidence' :: Maybe Text
awsAccountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:Evidence' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:evidenceAwsAccountId:Evidence' :: Maybe Text
evidenceAwsAccountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:Evidence' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSource:Evidence' :: Maybe Text
dataSource = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:evidenceFolderId:Evidence' :: Maybe Text
evidenceFolderId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:iamId:Evidence' :: Maybe Text
iamId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:eventName:Evidence' :: Maybe Text
eventName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourcesIncluded:Evidence' :: Maybe [Resource]
resourcesIncluded = Maybe [Resource]
forall a. Maybe a
Prelude.Nothing,
      $sel:eventSource:Evidence' :: Maybe Text
eventSource = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The timestamp that represents when the evidence was collected.
evidence_time :: Lens.Lens' Evidence (Prelude.Maybe Prelude.UTCTime)
evidence_time :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Evidence -> f Evidence
evidence_time = (Evidence -> Maybe POSIX)
-> (Evidence -> Maybe POSIX -> Evidence)
-> Lens Evidence Evidence (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe POSIX
time :: Maybe POSIX
$sel:time:Evidence' :: Evidence -> Maybe POSIX
time} -> Maybe POSIX
time) (\s :: Evidence
s@Evidence' {} Maybe POSIX
a -> Evidence
s {$sel:time:Evidence' :: Maybe POSIX
time = Maybe POSIX
a} :: Evidence) ((Maybe POSIX -> f (Maybe POSIX)) -> Evidence -> f Evidence)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Evidence
-> f Evidence
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 whether the evidence is included in the assessment report.
evidence_assessmentReportSelection :: Lens.Lens' Evidence (Prelude.Maybe Prelude.Text)
evidence_assessmentReportSelection :: (Maybe Text -> f (Maybe Text)) -> Evidence -> f Evidence
evidence_assessmentReportSelection = (Evidence -> Maybe Text)
-> (Evidence -> Maybe Text -> Evidence)
-> Lens Evidence Evidence (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe Text
assessmentReportSelection :: Maybe Text
$sel:assessmentReportSelection:Evidence' :: Evidence -> Maybe Text
assessmentReportSelection} -> Maybe Text
assessmentReportSelection) (\s :: Evidence
s@Evidence' {} Maybe Text
a -> Evidence
s {$sel:assessmentReportSelection:Evidence' :: Maybe Text
assessmentReportSelection = Maybe Text
a} :: Evidence)

-- | The type of automated evidence.
evidence_evidenceByType :: Lens.Lens' Evidence (Prelude.Maybe Prelude.Text)
evidence_evidenceByType :: (Maybe Text -> f (Maybe Text)) -> Evidence -> f Evidence
evidence_evidenceByType = (Evidence -> Maybe Text)
-> (Evidence -> Maybe Text -> Evidence)
-> Lens Evidence Evidence (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe Text
evidenceByType :: Maybe Text
$sel:evidenceByType:Evidence' :: Evidence -> Maybe Text
evidenceByType} -> Maybe Text
evidenceByType) (\s :: Evidence
s@Evidence' {} Maybe Text
a -> Evidence
s {$sel:evidenceByType:Evidence' :: Maybe Text
evidenceByType = Maybe Text
a} :: Evidence)

-- | The evaluation status for evidence that falls under the compliance check
-- category. For evidence collected from Security Hub, a /Pass/ or /Fail/
-- result is shown. For evidence collected from Config, a /Compliant/ or
-- /Noncompliant/ result is shown.
evidence_complianceCheck :: Lens.Lens' Evidence (Prelude.Maybe Prelude.Text)
evidence_complianceCheck :: (Maybe Text -> f (Maybe Text)) -> Evidence -> f Evidence
evidence_complianceCheck = (Evidence -> Maybe Text)
-> (Evidence -> Maybe Text -> Evidence)
-> Lens Evidence Evidence (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe Text
complianceCheck :: Maybe Text
$sel:complianceCheck:Evidence' :: Evidence -> Maybe Text
complianceCheck} -> Maybe Text
complianceCheck) (\s :: Evidence
s@Evidence' {} Maybe Text
a -> Evidence
s {$sel:complianceCheck:Evidence' :: Maybe Text
complianceCheck = Maybe Text
a} :: Evidence)

-- | The Amazon Web Services account from which the evidence is collected,
-- and its organization path.
evidence_awsOrganization :: Lens.Lens' Evidence (Prelude.Maybe Prelude.Text)
evidence_awsOrganization :: (Maybe Text -> f (Maybe Text)) -> Evidence -> f Evidence
evidence_awsOrganization = (Evidence -> Maybe Text)
-> (Evidence -> Maybe Text -> Evidence)
-> Lens Evidence Evidence (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe Text
awsOrganization :: Maybe Text
$sel:awsOrganization:Evidence' :: Evidence -> Maybe Text
awsOrganization} -> Maybe Text
awsOrganization) (\s :: Evidence
s@Evidence' {} Maybe Text
a -> Evidence
s {$sel:awsOrganization:Evidence' :: Maybe Text
awsOrganization = Maybe Text
a} :: Evidence)

-- | The identifier for the specified Amazon Web Services account.
evidence_awsAccountId :: Lens.Lens' Evidence (Prelude.Maybe Prelude.Text)
evidence_awsAccountId :: (Maybe Text -> f (Maybe Text)) -> Evidence -> f Evidence
evidence_awsAccountId = (Evidence -> Maybe Text)
-> (Evidence -> Maybe Text -> Evidence)
-> Lens Evidence Evidence (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe Text
awsAccountId :: Maybe Text
$sel:awsAccountId:Evidence' :: Evidence -> Maybe Text
awsAccountId} -> Maybe Text
awsAccountId) (\s :: Evidence
s@Evidence' {} Maybe Text
a -> Evidence
s {$sel:awsAccountId:Evidence' :: Maybe Text
awsAccountId = Maybe Text
a} :: Evidence)

-- | The names and values used by the evidence event, including an attribute
-- name (such as @allowUsersToChangePassword@) and value (such as @true@ or
-- @false@).
evidence_attributes :: Lens.Lens' Evidence (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
evidence_attributes :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Evidence -> f Evidence
evidence_attributes = (Evidence -> Maybe (HashMap Text Text))
-> (Evidence -> Maybe (HashMap Text Text) -> Evidence)
-> Lens
     Evidence
     Evidence
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe (HashMap Text Text)
attributes :: Maybe (HashMap Text Text)
$sel:attributes:Evidence' :: Evidence -> Maybe (HashMap Text Text)
attributes} -> Maybe (HashMap Text Text)
attributes) (\s :: Evidence
s@Evidence' {} Maybe (HashMap Text Text)
a -> Evidence
s {$sel:attributes:Evidence' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
a} :: Evidence) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> Evidence -> f Evidence)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Evidence
-> f Evidence
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier for the specified Amazon Web Services account.
evidence_evidenceAwsAccountId :: Lens.Lens' Evidence (Prelude.Maybe Prelude.Text)
evidence_evidenceAwsAccountId :: (Maybe Text -> f (Maybe Text)) -> Evidence -> f Evidence
evidence_evidenceAwsAccountId = (Evidence -> Maybe Text)
-> (Evidence -> Maybe Text -> Evidence)
-> Lens Evidence Evidence (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe Text
evidenceAwsAccountId :: Maybe Text
$sel:evidenceAwsAccountId:Evidence' :: Evidence -> Maybe Text
evidenceAwsAccountId} -> Maybe Text
evidenceAwsAccountId) (\s :: Evidence
s@Evidence' {} Maybe Text
a -> Evidence
s {$sel:evidenceAwsAccountId:Evidence' :: Maybe Text
evidenceAwsAccountId = Maybe Text
a} :: Evidence)

-- | The identifier for the evidence.
evidence_id :: Lens.Lens' Evidence (Prelude.Maybe Prelude.Text)
evidence_id :: (Maybe Text -> f (Maybe Text)) -> Evidence -> f Evidence
evidence_id = (Evidence -> Maybe Text)
-> (Evidence -> Maybe Text -> Evidence)
-> Lens Evidence Evidence (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe Text
id :: Maybe Text
$sel:id:Evidence' :: Evidence -> Maybe Text
id} -> Maybe Text
id) (\s :: Evidence
s@Evidence' {} Maybe Text
a -> Evidence
s {$sel:id:Evidence' :: Maybe Text
id = Maybe Text
a} :: Evidence)

-- | The data source from which the specified evidence was collected.
evidence_dataSource :: Lens.Lens' Evidence (Prelude.Maybe Prelude.Text)
evidence_dataSource :: (Maybe Text -> f (Maybe Text)) -> Evidence -> f Evidence
evidence_dataSource = (Evidence -> Maybe Text)
-> (Evidence -> Maybe Text -> Evidence)
-> Lens Evidence Evidence (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe Text
dataSource :: Maybe Text
$sel:dataSource:Evidence' :: Evidence -> Maybe Text
dataSource} -> Maybe Text
dataSource) (\s :: Evidence
s@Evidence' {} Maybe Text
a -> Evidence
s {$sel:dataSource:Evidence' :: Maybe Text
dataSource = Maybe Text
a} :: Evidence)

-- | The identifier for the folder in which the evidence is stored.
evidence_evidenceFolderId :: Lens.Lens' Evidence (Prelude.Maybe Prelude.Text)
evidence_evidenceFolderId :: (Maybe Text -> f (Maybe Text)) -> Evidence -> f Evidence
evidence_evidenceFolderId = (Evidence -> Maybe Text)
-> (Evidence -> Maybe Text -> Evidence)
-> Lens Evidence Evidence (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe Text
evidenceFolderId :: Maybe Text
$sel:evidenceFolderId:Evidence' :: Evidence -> Maybe Text
evidenceFolderId} -> Maybe Text
evidenceFolderId) (\s :: Evidence
s@Evidence' {} Maybe Text
a -> Evidence
s {$sel:evidenceFolderId:Evidence' :: Maybe Text
evidenceFolderId = Maybe Text
a} :: Evidence)

-- | The unique identifier for the IAM user or role associated with the
-- evidence.
evidence_iamId :: Lens.Lens' Evidence (Prelude.Maybe Prelude.Text)
evidence_iamId :: (Maybe Text -> f (Maybe Text)) -> Evidence -> f Evidence
evidence_iamId = (Evidence -> Maybe Text)
-> (Evidence -> Maybe Text -> Evidence)
-> Lens Evidence Evidence (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe Text
iamId :: Maybe Text
$sel:iamId:Evidence' :: Evidence -> Maybe Text
iamId} -> Maybe Text
iamId) (\s :: Evidence
s@Evidence' {} Maybe Text
a -> Evidence
s {$sel:iamId:Evidence' :: Maybe Text
iamId = Maybe Text
a} :: Evidence)

-- | The name of the specified evidence event.
evidence_eventName :: Lens.Lens' Evidence (Prelude.Maybe Prelude.Text)
evidence_eventName :: (Maybe Text -> f (Maybe Text)) -> Evidence -> f Evidence
evidence_eventName = (Evidence -> Maybe Text)
-> (Evidence -> Maybe Text -> Evidence)
-> Lens Evidence Evidence (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe Text
eventName :: Maybe Text
$sel:eventName:Evidence' :: Evidence -> Maybe Text
eventName} -> Maybe Text
eventName) (\s :: Evidence
s@Evidence' {} Maybe Text
a -> Evidence
s {$sel:eventName:Evidence' :: Maybe Text
eventName = Maybe Text
a} :: Evidence)

-- | The list of resources assessed to generate the evidence.
evidence_resourcesIncluded :: Lens.Lens' Evidence (Prelude.Maybe [Resource])
evidence_resourcesIncluded :: (Maybe [Resource] -> f (Maybe [Resource]))
-> Evidence -> f Evidence
evidence_resourcesIncluded = (Evidence -> Maybe [Resource])
-> (Evidence -> Maybe [Resource] -> Evidence)
-> Lens Evidence Evidence (Maybe [Resource]) (Maybe [Resource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe [Resource]
resourcesIncluded :: Maybe [Resource]
$sel:resourcesIncluded:Evidence' :: Evidence -> Maybe [Resource]
resourcesIncluded} -> Maybe [Resource]
resourcesIncluded) (\s :: Evidence
s@Evidence' {} Maybe [Resource]
a -> Evidence
s {$sel:resourcesIncluded:Evidence' :: Maybe [Resource]
resourcesIncluded = Maybe [Resource]
a} :: Evidence) ((Maybe [Resource] -> f (Maybe [Resource]))
 -> Evidence -> f Evidence)
-> ((Maybe [Resource] -> f (Maybe [Resource]))
    -> Maybe [Resource] -> f (Maybe [Resource]))
-> (Maybe [Resource] -> f (Maybe [Resource]))
-> Evidence
-> f Evidence
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Resource] [Resource] [Resource] [Resource]
-> Iso
     (Maybe [Resource])
     (Maybe [Resource])
     (Maybe [Resource])
     (Maybe [Resource])
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 [Resource] [Resource] [Resource] [Resource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Web Service from which the evidence is collected.
evidence_eventSource :: Lens.Lens' Evidence (Prelude.Maybe Prelude.Text)
evidence_eventSource :: (Maybe Text -> f (Maybe Text)) -> Evidence -> f Evidence
evidence_eventSource = (Evidence -> Maybe Text)
-> (Evidence -> Maybe Text -> Evidence)
-> Lens Evidence Evidence (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evidence' {Maybe Text
eventSource :: Maybe Text
$sel:eventSource:Evidence' :: Evidence -> Maybe Text
eventSource} -> Maybe Text
eventSource) (\s :: Evidence
s@Evidence' {} Maybe Text
a -> Evidence
s {$sel:eventSource:Evidence' :: Maybe Text
eventSource = Maybe Text
a} :: Evidence)

instance Core.FromJSON Evidence where
  parseJSON :: Value -> Parser Evidence
parseJSON =
    String -> (Object -> Parser Evidence) -> Value -> Parser Evidence
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Evidence"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Resource]
-> Maybe Text
-> Evidence
Evidence'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Resource]
 -> Maybe Text
 -> Evidence)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Resource]
      -> Maybe Text
      -> Evidence)
forall (f :: * -> *) a b. Functor 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
"time")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Resource]
   -> Maybe Text
   -> Evidence)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Resource]
      -> Maybe Text
      -> Evidence)
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
"assessmentReportSelection")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Resource]
   -> Maybe Text
   -> Evidence)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Resource]
      -> Maybe Text
      -> Evidence)
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
"evidenceByType")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Resource]
   -> Maybe Text
   -> Evidence)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Resource]
      -> Maybe Text
      -> Evidence)
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
"complianceCheck")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Resource]
   -> Maybe Text
   -> Evidence)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Resource]
      -> Maybe Text
      -> Evidence)
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
"awsOrganization")
            Parser
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Resource]
   -> Maybe Text
   -> Evidence)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Resource]
      -> Maybe Text
      -> Evidence)
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
"awsAccountId")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Resource]
   -> Maybe Text
   -> Evidence)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Resource]
      -> Maybe Text
      -> Evidence)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"attributes" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Resource]
   -> Maybe Text
   -> Evidence)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Resource]
      -> Maybe Text
      -> Evidence)
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
"evidenceAwsAccountId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Resource]
   -> Maybe Text
   -> Evidence)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Resource]
      -> Maybe Text
      -> Evidence)
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
"id")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Resource]
   -> Maybe Text
   -> Evidence)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Resource]
      -> Maybe Text
      -> Evidence)
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
"dataSource")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Resource]
   -> Maybe Text
   -> Evidence)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe [Resource] -> Maybe Text -> Evidence)
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
"evidenceFolderId")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe [Resource] -> Maybe Text -> Evidence)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe [Resource] -> Maybe Text -> Evidence)
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
"iamId")
            Parser (Maybe Text -> Maybe [Resource] -> Maybe Text -> Evidence)
-> Parser (Maybe Text)
-> Parser (Maybe [Resource] -> Maybe Text -> Evidence)
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
"eventName")
            Parser (Maybe [Resource] -> Maybe Text -> Evidence)
-> Parser (Maybe [Resource]) -> Parser (Maybe Text -> Evidence)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Resource]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourcesIncluded"
                            Parser (Maybe (Maybe [Resource]))
-> Maybe [Resource] -> Parser (Maybe [Resource])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Resource]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Text -> Evidence)
-> Parser (Maybe Text) -> Parser Evidence
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
"eventSource")
      )

instance Prelude.Hashable Evidence

instance Prelude.NFData Evidence