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

import Amazonka.AuditManager.Types.AssessmentControlSet
import Amazonka.AuditManager.Types.FrameworkMetadata
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The file used to structure and automate Audit Manager assessments for a
-- given compliance standard.
--
-- /See:/ 'newAssessmentFramework' smart constructor.
data AssessmentFramework = AssessmentFramework'
  { -- | The Amazon Resource Name (ARN) of the specified framework.
    AssessmentFramework -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The control sets associated with the framework.
    AssessmentFramework -> Maybe [AssessmentControlSet]
controlSets :: Prelude.Maybe [AssessmentControlSet],
    AssessmentFramework -> Maybe FrameworkMetadata
metadata :: Prelude.Maybe FrameworkMetadata,
    -- | The unique identifier for the framework.
    AssessmentFramework -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (AssessmentFramework -> AssessmentFramework -> Bool
(AssessmentFramework -> AssessmentFramework -> Bool)
-> (AssessmentFramework -> AssessmentFramework -> Bool)
-> Eq AssessmentFramework
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssessmentFramework -> AssessmentFramework -> Bool
$c/= :: AssessmentFramework -> AssessmentFramework -> Bool
== :: AssessmentFramework -> AssessmentFramework -> Bool
$c== :: AssessmentFramework -> AssessmentFramework -> Bool
Prelude.Eq, ReadPrec [AssessmentFramework]
ReadPrec AssessmentFramework
Int -> ReadS AssessmentFramework
ReadS [AssessmentFramework]
(Int -> ReadS AssessmentFramework)
-> ReadS [AssessmentFramework]
-> ReadPrec AssessmentFramework
-> ReadPrec [AssessmentFramework]
-> Read AssessmentFramework
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssessmentFramework]
$creadListPrec :: ReadPrec [AssessmentFramework]
readPrec :: ReadPrec AssessmentFramework
$creadPrec :: ReadPrec AssessmentFramework
readList :: ReadS [AssessmentFramework]
$creadList :: ReadS [AssessmentFramework]
readsPrec :: Int -> ReadS AssessmentFramework
$creadsPrec :: Int -> ReadS AssessmentFramework
Prelude.Read, Int -> AssessmentFramework -> ShowS
[AssessmentFramework] -> ShowS
AssessmentFramework -> String
(Int -> AssessmentFramework -> ShowS)
-> (AssessmentFramework -> String)
-> ([AssessmentFramework] -> ShowS)
-> Show AssessmentFramework
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssessmentFramework] -> ShowS
$cshowList :: [AssessmentFramework] -> ShowS
show :: AssessmentFramework -> String
$cshow :: AssessmentFramework -> String
showsPrec :: Int -> AssessmentFramework -> ShowS
$cshowsPrec :: Int -> AssessmentFramework -> ShowS
Prelude.Show, (forall x. AssessmentFramework -> Rep AssessmentFramework x)
-> (forall x. Rep AssessmentFramework x -> AssessmentFramework)
-> Generic AssessmentFramework
forall x. Rep AssessmentFramework x -> AssessmentFramework
forall x. AssessmentFramework -> Rep AssessmentFramework x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssessmentFramework x -> AssessmentFramework
$cfrom :: forall x. AssessmentFramework -> Rep AssessmentFramework x
Prelude.Generic)

-- |
-- Create a value of 'AssessmentFramework' 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:
--
-- 'arn', 'assessmentFramework_arn' - The Amazon Resource Name (ARN) of the specified framework.
--
-- 'controlSets', 'assessmentFramework_controlSets' - The control sets associated with the framework.
--
-- 'metadata', 'assessmentFramework_metadata' - Undocumented member.
--
-- 'id', 'assessmentFramework_id' - The unique identifier for the framework.
newAssessmentFramework ::
  AssessmentFramework
newAssessmentFramework :: AssessmentFramework
newAssessmentFramework =
  AssessmentFramework' :: Maybe Text
-> Maybe [AssessmentControlSet]
-> Maybe FrameworkMetadata
-> Maybe Text
-> AssessmentFramework
AssessmentFramework'
    { $sel:arn:AssessmentFramework' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:controlSets:AssessmentFramework' :: Maybe [AssessmentControlSet]
controlSets = Maybe [AssessmentControlSet]
forall a. Maybe a
Prelude.Nothing,
      $sel:metadata:AssessmentFramework' :: Maybe FrameworkMetadata
metadata = Maybe FrameworkMetadata
forall a. Maybe a
Prelude.Nothing,
      $sel:id:AssessmentFramework' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the specified framework.
assessmentFramework_arn :: Lens.Lens' AssessmentFramework (Prelude.Maybe Prelude.Text)
assessmentFramework_arn :: (Maybe Text -> f (Maybe Text))
-> AssessmentFramework -> f AssessmentFramework
assessmentFramework_arn = (AssessmentFramework -> Maybe Text)
-> (AssessmentFramework -> Maybe Text -> AssessmentFramework)
-> Lens
     AssessmentFramework AssessmentFramework (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentFramework' {Maybe Text
arn :: Maybe Text
$sel:arn:AssessmentFramework' :: AssessmentFramework -> Maybe Text
arn} -> Maybe Text
arn) (\s :: AssessmentFramework
s@AssessmentFramework' {} Maybe Text
a -> AssessmentFramework
s {$sel:arn:AssessmentFramework' :: Maybe Text
arn = Maybe Text
a} :: AssessmentFramework)

-- | The control sets associated with the framework.
assessmentFramework_controlSets :: Lens.Lens' AssessmentFramework (Prelude.Maybe [AssessmentControlSet])
assessmentFramework_controlSets :: (Maybe [AssessmentControlSet] -> f (Maybe [AssessmentControlSet]))
-> AssessmentFramework -> f AssessmentFramework
assessmentFramework_controlSets = (AssessmentFramework -> Maybe [AssessmentControlSet])
-> (AssessmentFramework
    -> Maybe [AssessmentControlSet] -> AssessmentFramework)
-> Lens
     AssessmentFramework
     AssessmentFramework
     (Maybe [AssessmentControlSet])
     (Maybe [AssessmentControlSet])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentFramework' {Maybe [AssessmentControlSet]
controlSets :: Maybe [AssessmentControlSet]
$sel:controlSets:AssessmentFramework' :: AssessmentFramework -> Maybe [AssessmentControlSet]
controlSets} -> Maybe [AssessmentControlSet]
controlSets) (\s :: AssessmentFramework
s@AssessmentFramework' {} Maybe [AssessmentControlSet]
a -> AssessmentFramework
s {$sel:controlSets:AssessmentFramework' :: Maybe [AssessmentControlSet]
controlSets = Maybe [AssessmentControlSet]
a} :: AssessmentFramework) ((Maybe [AssessmentControlSet] -> f (Maybe [AssessmentControlSet]))
 -> AssessmentFramework -> f AssessmentFramework)
-> ((Maybe [AssessmentControlSet]
     -> f (Maybe [AssessmentControlSet]))
    -> Maybe [AssessmentControlSet]
    -> f (Maybe [AssessmentControlSet]))
-> (Maybe [AssessmentControlSet]
    -> f (Maybe [AssessmentControlSet]))
-> AssessmentFramework
-> f AssessmentFramework
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AssessmentControlSet]
  [AssessmentControlSet]
  [AssessmentControlSet]
  [AssessmentControlSet]
-> Iso
     (Maybe [AssessmentControlSet])
     (Maybe [AssessmentControlSet])
     (Maybe [AssessmentControlSet])
     (Maybe [AssessmentControlSet])
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
  [AssessmentControlSet]
  [AssessmentControlSet]
  [AssessmentControlSet]
  [AssessmentControlSet]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
assessmentFramework_metadata :: Lens.Lens' AssessmentFramework (Prelude.Maybe FrameworkMetadata)
assessmentFramework_metadata :: (Maybe FrameworkMetadata -> f (Maybe FrameworkMetadata))
-> AssessmentFramework -> f AssessmentFramework
assessmentFramework_metadata = (AssessmentFramework -> Maybe FrameworkMetadata)
-> (AssessmentFramework
    -> Maybe FrameworkMetadata -> AssessmentFramework)
-> Lens
     AssessmentFramework
     AssessmentFramework
     (Maybe FrameworkMetadata)
     (Maybe FrameworkMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentFramework' {Maybe FrameworkMetadata
metadata :: Maybe FrameworkMetadata
$sel:metadata:AssessmentFramework' :: AssessmentFramework -> Maybe FrameworkMetadata
metadata} -> Maybe FrameworkMetadata
metadata) (\s :: AssessmentFramework
s@AssessmentFramework' {} Maybe FrameworkMetadata
a -> AssessmentFramework
s {$sel:metadata:AssessmentFramework' :: Maybe FrameworkMetadata
metadata = Maybe FrameworkMetadata
a} :: AssessmentFramework)

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

instance Core.FromJSON AssessmentFramework where
  parseJSON :: Value -> Parser AssessmentFramework
parseJSON =
    String
-> (Object -> Parser AssessmentFramework)
-> Value
-> Parser AssessmentFramework
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AssessmentFramework"
      ( \Object
x ->
          Maybe Text
-> Maybe [AssessmentControlSet]
-> Maybe FrameworkMetadata
-> Maybe Text
-> AssessmentFramework
AssessmentFramework'
            (Maybe Text
 -> Maybe [AssessmentControlSet]
 -> Maybe FrameworkMetadata
 -> Maybe Text
 -> AssessmentFramework)
-> Parser (Maybe Text)
-> Parser
     (Maybe [AssessmentControlSet]
      -> Maybe FrameworkMetadata -> Maybe Text -> AssessmentFramework)
forall (f :: * -> *) a b. Functor 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
"arn")
            Parser
  (Maybe [AssessmentControlSet]
   -> Maybe FrameworkMetadata -> Maybe Text -> AssessmentFramework)
-> Parser (Maybe [AssessmentControlSet])
-> Parser
     (Maybe FrameworkMetadata -> Maybe Text -> AssessmentFramework)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [AssessmentControlSet]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"controlSets" Parser (Maybe (Maybe [AssessmentControlSet]))
-> Maybe [AssessmentControlSet]
-> Parser (Maybe [AssessmentControlSet])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AssessmentControlSet]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe FrameworkMetadata -> Maybe Text -> AssessmentFramework)
-> Parser (Maybe FrameworkMetadata)
-> Parser (Maybe Text -> AssessmentFramework)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FrameworkMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"metadata")
            Parser (Maybe Text -> AssessmentFramework)
-> Parser (Maybe Text) -> Parser AssessmentFramework
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")
      )

instance Prelude.Hashable AssessmentFramework

instance Prelude.NFData AssessmentFramework