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

import Amazonka.AuditManager.Types.AssessmentReportsDestination
import Amazonka.AuditManager.Types.AssessmentStatus
import Amazonka.AuditManager.Types.Delegation
import Amazonka.AuditManager.Types.Role
import Amazonka.AuditManager.Types.Scope
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The metadata associated with the specified assessment.
--
-- /See:/ 'newAssessmentMetadata' smart constructor.
data AssessmentMetadata = AssessmentMetadata'
  { -- | Specifies when the assessment was created.
    AssessmentMetadata -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The overall status of the assessment.
    AssessmentMetadata -> Maybe AssessmentStatus
status :: Prelude.Maybe AssessmentStatus,
    -- | The time of the most recent update.
    AssessmentMetadata -> Maybe POSIX
lastUpdated :: Prelude.Maybe Core.POSIX,
    -- | The roles associated with the assessment.
    AssessmentMetadata -> Maybe [Role]
roles :: Prelude.Maybe [Role],
    -- | The delegations associated with the assessment.
    AssessmentMetadata -> Maybe [Delegation]
delegations :: Prelude.Maybe [Delegation],
    -- | The name of the assessment.
    AssessmentMetadata -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The destination in which evidence reports are stored for the specified
    -- assessment.
    AssessmentMetadata -> Maybe AssessmentReportsDestination
assessmentReportsDestination :: Prelude.Maybe AssessmentReportsDestination,
    -- | The wrapper of Amazon Web Services accounts and services in scope for
    -- the assessment.
    AssessmentMetadata -> Maybe Scope
scope :: Prelude.Maybe Scope,
    -- | The name of a compliance standard related to the assessment, such as
    -- PCI-DSS.
    AssessmentMetadata -> Maybe Text
complianceType :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the assessment.
    AssessmentMetadata -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The description of the assessment.
    AssessmentMetadata -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (AssessmentMetadata -> AssessmentMetadata -> Bool
(AssessmentMetadata -> AssessmentMetadata -> Bool)
-> (AssessmentMetadata -> AssessmentMetadata -> Bool)
-> Eq AssessmentMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssessmentMetadata -> AssessmentMetadata -> Bool
$c/= :: AssessmentMetadata -> AssessmentMetadata -> Bool
== :: AssessmentMetadata -> AssessmentMetadata -> Bool
$c== :: AssessmentMetadata -> AssessmentMetadata -> Bool
Prelude.Eq, ReadPrec [AssessmentMetadata]
ReadPrec AssessmentMetadata
Int -> ReadS AssessmentMetadata
ReadS [AssessmentMetadata]
(Int -> ReadS AssessmentMetadata)
-> ReadS [AssessmentMetadata]
-> ReadPrec AssessmentMetadata
-> ReadPrec [AssessmentMetadata]
-> Read AssessmentMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssessmentMetadata]
$creadListPrec :: ReadPrec [AssessmentMetadata]
readPrec :: ReadPrec AssessmentMetadata
$creadPrec :: ReadPrec AssessmentMetadata
readList :: ReadS [AssessmentMetadata]
$creadList :: ReadS [AssessmentMetadata]
readsPrec :: Int -> ReadS AssessmentMetadata
$creadsPrec :: Int -> ReadS AssessmentMetadata
Prelude.Read, Int -> AssessmentMetadata -> ShowS
[AssessmentMetadata] -> ShowS
AssessmentMetadata -> String
(Int -> AssessmentMetadata -> ShowS)
-> (AssessmentMetadata -> String)
-> ([AssessmentMetadata] -> ShowS)
-> Show AssessmentMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssessmentMetadata] -> ShowS
$cshowList :: [AssessmentMetadata] -> ShowS
show :: AssessmentMetadata -> String
$cshow :: AssessmentMetadata -> String
showsPrec :: Int -> AssessmentMetadata -> ShowS
$cshowsPrec :: Int -> AssessmentMetadata -> ShowS
Prelude.Show, (forall x. AssessmentMetadata -> Rep AssessmentMetadata x)
-> (forall x. Rep AssessmentMetadata x -> AssessmentMetadata)
-> Generic AssessmentMetadata
forall x. Rep AssessmentMetadata x -> AssessmentMetadata
forall x. AssessmentMetadata -> Rep AssessmentMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssessmentMetadata x -> AssessmentMetadata
$cfrom :: forall x. AssessmentMetadata -> Rep AssessmentMetadata x
Prelude.Generic)

-- |
-- Create a value of 'AssessmentMetadata' 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:
--
-- 'creationTime', 'assessmentMetadata_creationTime' - Specifies when the assessment was created.
--
-- 'status', 'assessmentMetadata_status' - The overall status of the assessment.
--
-- 'lastUpdated', 'assessmentMetadata_lastUpdated' - The time of the most recent update.
--
-- 'roles', 'assessmentMetadata_roles' - The roles associated with the assessment.
--
-- 'delegations', 'assessmentMetadata_delegations' - The delegations associated with the assessment.
--
-- 'name', 'assessmentMetadata_name' - The name of the assessment.
--
-- 'assessmentReportsDestination', 'assessmentMetadata_assessmentReportsDestination' - The destination in which evidence reports are stored for the specified
-- assessment.
--
-- 'scope', 'assessmentMetadata_scope' - The wrapper of Amazon Web Services accounts and services in scope for
-- the assessment.
--
-- 'complianceType', 'assessmentMetadata_complianceType' - The name of a compliance standard related to the assessment, such as
-- PCI-DSS.
--
-- 'id', 'assessmentMetadata_id' - The unique identifier for the assessment.
--
-- 'description', 'assessmentMetadata_description' - The description of the assessment.
newAssessmentMetadata ::
  AssessmentMetadata
newAssessmentMetadata :: AssessmentMetadata
newAssessmentMetadata =
  AssessmentMetadata' :: Maybe POSIX
-> Maybe AssessmentStatus
-> Maybe POSIX
-> Maybe [Role]
-> Maybe [Delegation]
-> Maybe Text
-> Maybe AssessmentReportsDestination
-> Maybe Scope
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AssessmentMetadata
AssessmentMetadata'
    { $sel:creationTime:AssessmentMetadata' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:AssessmentMetadata' :: Maybe AssessmentStatus
status = Maybe AssessmentStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdated:AssessmentMetadata' :: Maybe POSIX
lastUpdated = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:roles:AssessmentMetadata' :: Maybe [Role]
roles = Maybe [Role]
forall a. Maybe a
Prelude.Nothing,
      $sel:delegations:AssessmentMetadata' :: Maybe [Delegation]
delegations = Maybe [Delegation]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:AssessmentMetadata' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:assessmentReportsDestination:AssessmentMetadata' :: Maybe AssessmentReportsDestination
assessmentReportsDestination = Maybe AssessmentReportsDestination
forall a. Maybe a
Prelude.Nothing,
      $sel:scope:AssessmentMetadata' :: Maybe Scope
scope = Maybe Scope
forall a. Maybe a
Prelude.Nothing,
      $sel:complianceType:AssessmentMetadata' :: Maybe Text
complianceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:AssessmentMetadata' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:AssessmentMetadata' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies when the assessment was created.
assessmentMetadata_creationTime :: Lens.Lens' AssessmentMetadata (Prelude.Maybe Prelude.UTCTime)
assessmentMetadata_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AssessmentMetadata -> f AssessmentMetadata
assessmentMetadata_creationTime = (AssessmentMetadata -> Maybe POSIX)
-> (AssessmentMetadata -> Maybe POSIX -> AssessmentMetadata)
-> Lens
     AssessmentMetadata AssessmentMetadata (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentMetadata' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:AssessmentMetadata' :: AssessmentMetadata -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: AssessmentMetadata
s@AssessmentMetadata' {} Maybe POSIX
a -> AssessmentMetadata
s {$sel:creationTime:AssessmentMetadata' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: AssessmentMetadata) ((Maybe POSIX -> f (Maybe POSIX))
 -> AssessmentMetadata -> f AssessmentMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AssessmentMetadata
-> f AssessmentMetadata
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 overall status of the assessment.
assessmentMetadata_status :: Lens.Lens' AssessmentMetadata (Prelude.Maybe AssessmentStatus)
assessmentMetadata_status :: (Maybe AssessmentStatus -> f (Maybe AssessmentStatus))
-> AssessmentMetadata -> f AssessmentMetadata
assessmentMetadata_status = (AssessmentMetadata -> Maybe AssessmentStatus)
-> (AssessmentMetadata
    -> Maybe AssessmentStatus -> AssessmentMetadata)
-> Lens
     AssessmentMetadata
     AssessmentMetadata
     (Maybe AssessmentStatus)
     (Maybe AssessmentStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentMetadata' {Maybe AssessmentStatus
status :: Maybe AssessmentStatus
$sel:status:AssessmentMetadata' :: AssessmentMetadata -> Maybe AssessmentStatus
status} -> Maybe AssessmentStatus
status) (\s :: AssessmentMetadata
s@AssessmentMetadata' {} Maybe AssessmentStatus
a -> AssessmentMetadata
s {$sel:status:AssessmentMetadata' :: Maybe AssessmentStatus
status = Maybe AssessmentStatus
a} :: AssessmentMetadata)

-- | The time of the most recent update.
assessmentMetadata_lastUpdated :: Lens.Lens' AssessmentMetadata (Prelude.Maybe Prelude.UTCTime)
assessmentMetadata_lastUpdated :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AssessmentMetadata -> f AssessmentMetadata
assessmentMetadata_lastUpdated = (AssessmentMetadata -> Maybe POSIX)
-> (AssessmentMetadata -> Maybe POSIX -> AssessmentMetadata)
-> Lens
     AssessmentMetadata AssessmentMetadata (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentMetadata' {Maybe POSIX
lastUpdated :: Maybe POSIX
$sel:lastUpdated:AssessmentMetadata' :: AssessmentMetadata -> Maybe POSIX
lastUpdated} -> Maybe POSIX
lastUpdated) (\s :: AssessmentMetadata
s@AssessmentMetadata' {} Maybe POSIX
a -> AssessmentMetadata
s {$sel:lastUpdated:AssessmentMetadata' :: Maybe POSIX
lastUpdated = Maybe POSIX
a} :: AssessmentMetadata) ((Maybe POSIX -> f (Maybe POSIX))
 -> AssessmentMetadata -> f AssessmentMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AssessmentMetadata
-> f AssessmentMetadata
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 roles associated with the assessment.
assessmentMetadata_roles :: Lens.Lens' AssessmentMetadata (Prelude.Maybe [Role])
assessmentMetadata_roles :: (Maybe [Role] -> f (Maybe [Role]))
-> AssessmentMetadata -> f AssessmentMetadata
assessmentMetadata_roles = (AssessmentMetadata -> Maybe [Role])
-> (AssessmentMetadata -> Maybe [Role] -> AssessmentMetadata)
-> Lens
     AssessmentMetadata AssessmentMetadata (Maybe [Role]) (Maybe [Role])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentMetadata' {Maybe [Role]
roles :: Maybe [Role]
$sel:roles:AssessmentMetadata' :: AssessmentMetadata -> Maybe [Role]
roles} -> Maybe [Role]
roles) (\s :: AssessmentMetadata
s@AssessmentMetadata' {} Maybe [Role]
a -> AssessmentMetadata
s {$sel:roles:AssessmentMetadata' :: Maybe [Role]
roles = Maybe [Role]
a} :: AssessmentMetadata) ((Maybe [Role] -> f (Maybe [Role]))
 -> AssessmentMetadata -> f AssessmentMetadata)
-> ((Maybe [Role] -> f (Maybe [Role]))
    -> Maybe [Role] -> f (Maybe [Role]))
-> (Maybe [Role] -> f (Maybe [Role]))
-> AssessmentMetadata
-> f AssessmentMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Role] [Role] [Role] [Role]
-> Iso (Maybe [Role]) (Maybe [Role]) (Maybe [Role]) (Maybe [Role])
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 [Role] [Role] [Role] [Role]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The delegations associated with the assessment.
assessmentMetadata_delegations :: Lens.Lens' AssessmentMetadata (Prelude.Maybe [Delegation])
assessmentMetadata_delegations :: (Maybe [Delegation] -> f (Maybe [Delegation]))
-> AssessmentMetadata -> f AssessmentMetadata
assessmentMetadata_delegations = (AssessmentMetadata -> Maybe [Delegation])
-> (AssessmentMetadata -> Maybe [Delegation] -> AssessmentMetadata)
-> Lens
     AssessmentMetadata
     AssessmentMetadata
     (Maybe [Delegation])
     (Maybe [Delegation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentMetadata' {Maybe [Delegation]
delegations :: Maybe [Delegation]
$sel:delegations:AssessmentMetadata' :: AssessmentMetadata -> Maybe [Delegation]
delegations} -> Maybe [Delegation]
delegations) (\s :: AssessmentMetadata
s@AssessmentMetadata' {} Maybe [Delegation]
a -> AssessmentMetadata
s {$sel:delegations:AssessmentMetadata' :: Maybe [Delegation]
delegations = Maybe [Delegation]
a} :: AssessmentMetadata) ((Maybe [Delegation] -> f (Maybe [Delegation]))
 -> AssessmentMetadata -> f AssessmentMetadata)
-> ((Maybe [Delegation] -> f (Maybe [Delegation]))
    -> Maybe [Delegation] -> f (Maybe [Delegation]))
-> (Maybe [Delegation] -> f (Maybe [Delegation]))
-> AssessmentMetadata
-> f AssessmentMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Delegation] [Delegation] [Delegation] [Delegation]
-> Iso
     (Maybe [Delegation])
     (Maybe [Delegation])
     (Maybe [Delegation])
     (Maybe [Delegation])
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 [Delegation] [Delegation] [Delegation] [Delegation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the assessment.
assessmentMetadata_name :: Lens.Lens' AssessmentMetadata (Prelude.Maybe Prelude.Text)
assessmentMetadata_name :: (Maybe Text -> f (Maybe Text))
-> AssessmentMetadata -> f AssessmentMetadata
assessmentMetadata_name = (AssessmentMetadata -> Maybe Text)
-> (AssessmentMetadata -> Maybe Text -> AssessmentMetadata)
-> Lens
     AssessmentMetadata AssessmentMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentMetadata' {Maybe Text
name :: Maybe Text
$sel:name:AssessmentMetadata' :: AssessmentMetadata -> Maybe Text
name} -> Maybe Text
name) (\s :: AssessmentMetadata
s@AssessmentMetadata' {} Maybe Text
a -> AssessmentMetadata
s {$sel:name:AssessmentMetadata' :: Maybe Text
name = Maybe Text
a} :: AssessmentMetadata)

-- | The destination in which evidence reports are stored for the specified
-- assessment.
assessmentMetadata_assessmentReportsDestination :: Lens.Lens' AssessmentMetadata (Prelude.Maybe AssessmentReportsDestination)
assessmentMetadata_assessmentReportsDestination :: (Maybe AssessmentReportsDestination
 -> f (Maybe AssessmentReportsDestination))
-> AssessmentMetadata -> f AssessmentMetadata
assessmentMetadata_assessmentReportsDestination = (AssessmentMetadata -> Maybe AssessmentReportsDestination)
-> (AssessmentMetadata
    -> Maybe AssessmentReportsDestination -> AssessmentMetadata)
-> Lens
     AssessmentMetadata
     AssessmentMetadata
     (Maybe AssessmentReportsDestination)
     (Maybe AssessmentReportsDestination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentMetadata' {Maybe AssessmentReportsDestination
assessmentReportsDestination :: Maybe AssessmentReportsDestination
$sel:assessmentReportsDestination:AssessmentMetadata' :: AssessmentMetadata -> Maybe AssessmentReportsDestination
assessmentReportsDestination} -> Maybe AssessmentReportsDestination
assessmentReportsDestination) (\s :: AssessmentMetadata
s@AssessmentMetadata' {} Maybe AssessmentReportsDestination
a -> AssessmentMetadata
s {$sel:assessmentReportsDestination:AssessmentMetadata' :: Maybe AssessmentReportsDestination
assessmentReportsDestination = Maybe AssessmentReportsDestination
a} :: AssessmentMetadata)

-- | The wrapper of Amazon Web Services accounts and services in scope for
-- the assessment.
assessmentMetadata_scope :: Lens.Lens' AssessmentMetadata (Prelude.Maybe Scope)
assessmentMetadata_scope :: (Maybe Scope -> f (Maybe Scope))
-> AssessmentMetadata -> f AssessmentMetadata
assessmentMetadata_scope = (AssessmentMetadata -> Maybe Scope)
-> (AssessmentMetadata -> Maybe Scope -> AssessmentMetadata)
-> Lens
     AssessmentMetadata AssessmentMetadata (Maybe Scope) (Maybe Scope)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentMetadata' {Maybe Scope
scope :: Maybe Scope
$sel:scope:AssessmentMetadata' :: AssessmentMetadata -> Maybe Scope
scope} -> Maybe Scope
scope) (\s :: AssessmentMetadata
s@AssessmentMetadata' {} Maybe Scope
a -> AssessmentMetadata
s {$sel:scope:AssessmentMetadata' :: Maybe Scope
scope = Maybe Scope
a} :: AssessmentMetadata)

-- | The name of a compliance standard related to the assessment, such as
-- PCI-DSS.
assessmentMetadata_complianceType :: Lens.Lens' AssessmentMetadata (Prelude.Maybe Prelude.Text)
assessmentMetadata_complianceType :: (Maybe Text -> f (Maybe Text))
-> AssessmentMetadata -> f AssessmentMetadata
assessmentMetadata_complianceType = (AssessmentMetadata -> Maybe Text)
-> (AssessmentMetadata -> Maybe Text -> AssessmentMetadata)
-> Lens
     AssessmentMetadata AssessmentMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentMetadata' {Maybe Text
complianceType :: Maybe Text
$sel:complianceType:AssessmentMetadata' :: AssessmentMetadata -> Maybe Text
complianceType} -> Maybe Text
complianceType) (\s :: AssessmentMetadata
s@AssessmentMetadata' {} Maybe Text
a -> AssessmentMetadata
s {$sel:complianceType:AssessmentMetadata' :: Maybe Text
complianceType = Maybe Text
a} :: AssessmentMetadata)

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

-- | The description of the assessment.
assessmentMetadata_description :: Lens.Lens' AssessmentMetadata (Prelude.Maybe Prelude.Text)
assessmentMetadata_description :: (Maybe Text -> f (Maybe Text))
-> AssessmentMetadata -> f AssessmentMetadata
assessmentMetadata_description = (AssessmentMetadata -> Maybe Text)
-> (AssessmentMetadata -> Maybe Text -> AssessmentMetadata)
-> Lens
     AssessmentMetadata AssessmentMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentMetadata' {Maybe Text
description :: Maybe Text
$sel:description:AssessmentMetadata' :: AssessmentMetadata -> Maybe Text
description} -> Maybe Text
description) (\s :: AssessmentMetadata
s@AssessmentMetadata' {} Maybe Text
a -> AssessmentMetadata
s {$sel:description:AssessmentMetadata' :: Maybe Text
description = Maybe Text
a} :: AssessmentMetadata)

instance Core.FromJSON AssessmentMetadata where
  parseJSON :: Value -> Parser AssessmentMetadata
parseJSON =
    String
-> (Object -> Parser AssessmentMetadata)
-> Value
-> Parser AssessmentMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AssessmentMetadata"
      ( \Object
x ->
          Maybe POSIX
-> Maybe AssessmentStatus
-> Maybe POSIX
-> Maybe [Role]
-> Maybe [Delegation]
-> Maybe Text
-> Maybe AssessmentReportsDestination
-> Maybe Scope
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AssessmentMetadata
AssessmentMetadata'
            (Maybe POSIX
 -> Maybe AssessmentStatus
 -> Maybe POSIX
 -> Maybe [Role]
 -> Maybe [Delegation]
 -> Maybe Text
 -> Maybe AssessmentReportsDestination
 -> Maybe Scope
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> AssessmentMetadata)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe AssessmentStatus
      -> Maybe POSIX
      -> Maybe [Role]
      -> Maybe [Delegation]
      -> Maybe Text
      -> Maybe AssessmentReportsDestination
      -> Maybe Scope
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AssessmentMetadata)
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
"creationTime")
            Parser
  (Maybe AssessmentStatus
   -> Maybe POSIX
   -> Maybe [Role]
   -> Maybe [Delegation]
   -> Maybe Text
   -> Maybe AssessmentReportsDestination
   -> Maybe Scope
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AssessmentMetadata)
-> Parser (Maybe AssessmentStatus)
-> Parser
     (Maybe POSIX
      -> Maybe [Role]
      -> Maybe [Delegation]
      -> Maybe Text
      -> Maybe AssessmentReportsDestination
      -> Maybe Scope
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AssessmentMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AssessmentStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe POSIX
   -> Maybe [Role]
   -> Maybe [Delegation]
   -> Maybe Text
   -> Maybe AssessmentReportsDestination
   -> Maybe Scope
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AssessmentMetadata)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe [Role]
      -> Maybe [Delegation]
      -> Maybe Text
      -> Maybe AssessmentReportsDestination
      -> Maybe Scope
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AssessmentMetadata)
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
"lastUpdated")
            Parser
  (Maybe [Role]
   -> Maybe [Delegation]
   -> Maybe Text
   -> Maybe AssessmentReportsDestination
   -> Maybe Scope
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AssessmentMetadata)
-> Parser (Maybe [Role])
-> Parser
     (Maybe [Delegation]
      -> Maybe Text
      -> Maybe AssessmentReportsDestination
      -> Maybe Scope
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AssessmentMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Role]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"roles" Parser (Maybe (Maybe [Role]))
-> Maybe [Role] -> Parser (Maybe [Role])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Role]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe [Delegation]
   -> Maybe Text
   -> Maybe AssessmentReportsDestination
   -> Maybe Scope
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AssessmentMetadata)
-> Parser (Maybe [Delegation])
-> Parser
     (Maybe Text
      -> Maybe AssessmentReportsDestination
      -> Maybe Scope
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AssessmentMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Delegation]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"delegations" Parser (Maybe (Maybe [Delegation]))
-> Maybe [Delegation] -> Parser (Maybe [Delegation])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Delegation]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe AssessmentReportsDestination
   -> Maybe Scope
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AssessmentMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe AssessmentReportsDestination
      -> Maybe Scope
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AssessmentMetadata)
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
"name")
            Parser
  (Maybe AssessmentReportsDestination
   -> Maybe Scope
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AssessmentMetadata)
-> Parser (Maybe AssessmentReportsDestination)
-> Parser
     (Maybe Scope
      -> Maybe Text -> Maybe Text -> Maybe Text -> AssessmentMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AssessmentReportsDestination)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"assessmentReportsDestination")
            Parser
  (Maybe Scope
   -> Maybe Text -> Maybe Text -> Maybe Text -> AssessmentMetadata)
-> Parser (Maybe Scope)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> AssessmentMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Scope)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"scope")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> AssessmentMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AssessmentMetadata)
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
"complianceType")
            Parser (Maybe Text -> Maybe Text -> AssessmentMetadata)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AssessmentMetadata)
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 -> AssessmentMetadata)
-> Parser (Maybe Text) -> Parser AssessmentMetadata
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
"description")
      )

instance Prelude.Hashable AssessmentMetadata

instance Prelude.NFData AssessmentMetadata