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

import Amazonka.AuditManager.Types.ControlMappingSource
import Amazonka.AuditManager.Types.ControlType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A control in Audit Manager.
--
-- /See:/ 'newControl' smart constructor.
data Control = Control'
  { -- | The IAM user or role that most recently updated the control.
    Control -> Maybe Text
lastUpdatedBy :: Prelude.Maybe Prelude.Text,
    -- | The steps to follow to determine if the control has been satisfied.
    Control -> Maybe Text
testingInformation :: Prelude.Maybe Prelude.Text,
    -- | Specifies when the control was most recently updated.
    Control -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the specified control.
    Control -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Specifies when the control was created.
    Control -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The data mapping sources for the specified control.
    Control -> Maybe (NonEmpty ControlMappingSource)
controlMappingSources :: Prelude.Maybe (Prelude.NonEmpty ControlMappingSource),
    -- | The IAM user or role that created the control.
    Control -> Maybe Text
createdBy :: Prelude.Maybe Prelude.Text,
    -- | The recommended actions to carry out if the control is not fulfilled.
    Control -> Maybe Text
actionPlanInstructions :: Prelude.Maybe Prelude.Text,
    -- | The data source that determines from where Audit Manager collects
    -- evidence for the control.
    Control -> Maybe Text
controlSources :: Prelude.Maybe Prelude.Text,
    -- | The name of the specified control.
    Control -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The title of the action plan for remediating the control.
    Control -> Maybe Text
actionPlanTitle :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the control.
    Control -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The type of control, such as custom or standard.
    Control -> Maybe ControlType
type' :: Prelude.Maybe ControlType,
    -- | The description of the specified control.
    Control -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags associated with the control.
    Control -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (Control -> Control -> Bool
(Control -> Control -> Bool)
-> (Control -> Control -> Bool) -> Eq Control
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Control -> Control -> Bool
$c/= :: Control -> Control -> Bool
== :: Control -> Control -> Bool
$c== :: Control -> Control -> Bool
Prelude.Eq, ReadPrec [Control]
ReadPrec Control
Int -> ReadS Control
ReadS [Control]
(Int -> ReadS Control)
-> ReadS [Control]
-> ReadPrec Control
-> ReadPrec [Control]
-> Read Control
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Control]
$creadListPrec :: ReadPrec [Control]
readPrec :: ReadPrec Control
$creadPrec :: ReadPrec Control
readList :: ReadS [Control]
$creadList :: ReadS [Control]
readsPrec :: Int -> ReadS Control
$creadsPrec :: Int -> ReadS Control
Prelude.Read, Int -> Control -> ShowS
[Control] -> ShowS
Control -> String
(Int -> Control -> ShowS)
-> (Control -> String) -> ([Control] -> ShowS) -> Show Control
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Control] -> ShowS
$cshowList :: [Control] -> ShowS
show :: Control -> String
$cshow :: Control -> String
showsPrec :: Int -> Control -> ShowS
$cshowsPrec :: Int -> Control -> ShowS
Prelude.Show, (forall x. Control -> Rep Control x)
-> (forall x. Rep Control x -> Control) -> Generic Control
forall x. Rep Control x -> Control
forall x. Control -> Rep Control x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Control x -> Control
$cfrom :: forall x. Control -> Rep Control x
Prelude.Generic)

-- |
-- Create a value of 'Control' 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:
--
-- 'lastUpdatedBy', 'control_lastUpdatedBy' - The IAM user or role that most recently updated the control.
--
-- 'testingInformation', 'control_testingInformation' - The steps to follow to determine if the control has been satisfied.
--
-- 'lastUpdatedAt', 'control_lastUpdatedAt' - Specifies when the control was most recently updated.
--
-- 'arn', 'control_arn' - The Amazon Resource Name (ARN) of the specified control.
--
-- 'createdAt', 'control_createdAt' - Specifies when the control was created.
--
-- 'controlMappingSources', 'control_controlMappingSources' - The data mapping sources for the specified control.
--
-- 'createdBy', 'control_createdBy' - The IAM user or role that created the control.
--
-- 'actionPlanInstructions', 'control_actionPlanInstructions' - The recommended actions to carry out if the control is not fulfilled.
--
-- 'controlSources', 'control_controlSources' - The data source that determines from where Audit Manager collects
-- evidence for the control.
--
-- 'name', 'control_name' - The name of the specified control.
--
-- 'actionPlanTitle', 'control_actionPlanTitle' - The title of the action plan for remediating the control.
--
-- 'id', 'control_id' - The unique identifier for the control.
--
-- 'type'', 'control_type' - The type of control, such as custom or standard.
--
-- 'description', 'control_description' - The description of the specified control.
--
-- 'tags', 'control_tags' - The tags associated with the control.
newControl ::
  Control
newControl :: Control
newControl =
  Control' :: Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe (NonEmpty ControlMappingSource)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ControlType
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Control
Control'
    { $sel:lastUpdatedBy:Control' :: Maybe Text
lastUpdatedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:testingInformation:Control' :: Maybe Text
testingInformation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedAt:Control' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Control' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:Control' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:controlMappingSources:Control' :: Maybe (NonEmpty ControlMappingSource)
controlMappingSources = Maybe (NonEmpty ControlMappingSource)
forall a. Maybe a
Prelude.Nothing,
      $sel:createdBy:Control' :: Maybe Text
createdBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:actionPlanInstructions:Control' :: Maybe Text
actionPlanInstructions = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:controlSources:Control' :: Maybe Text
controlSources = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Control' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:actionPlanTitle:Control' :: Maybe Text
actionPlanTitle = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:Control' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':Control' :: Maybe ControlType
type' = Maybe ControlType
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Control' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Control' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The IAM user or role that most recently updated the control.
control_lastUpdatedBy :: Lens.Lens' Control (Prelude.Maybe Prelude.Text)
control_lastUpdatedBy :: (Maybe Text -> f (Maybe Text)) -> Control -> f Control
control_lastUpdatedBy = (Control -> Maybe Text)
-> (Control -> Maybe Text -> Control)
-> Lens Control Control (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Control' {Maybe Text
lastUpdatedBy :: Maybe Text
$sel:lastUpdatedBy:Control' :: Control -> Maybe Text
lastUpdatedBy} -> Maybe Text
lastUpdatedBy) (\s :: Control
s@Control' {} Maybe Text
a -> Control
s {$sel:lastUpdatedBy:Control' :: Maybe Text
lastUpdatedBy = Maybe Text
a} :: Control)

-- | The steps to follow to determine if the control has been satisfied.
control_testingInformation :: Lens.Lens' Control (Prelude.Maybe Prelude.Text)
control_testingInformation :: (Maybe Text -> f (Maybe Text)) -> Control -> f Control
control_testingInformation = (Control -> Maybe Text)
-> (Control -> Maybe Text -> Control)
-> Lens Control Control (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Control' {Maybe Text
testingInformation :: Maybe Text
$sel:testingInformation:Control' :: Control -> Maybe Text
testingInformation} -> Maybe Text
testingInformation) (\s :: Control
s@Control' {} Maybe Text
a -> Control
s {$sel:testingInformation:Control' :: Maybe Text
testingInformation = Maybe Text
a} :: Control)

-- | Specifies when the control was most recently updated.
control_lastUpdatedAt :: Lens.Lens' Control (Prelude.Maybe Prelude.UTCTime)
control_lastUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Control -> f Control
control_lastUpdatedAt = (Control -> Maybe POSIX)
-> (Control -> Maybe POSIX -> Control)
-> Lens Control Control (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Control' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:Control' :: Control -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: Control
s@Control' {} Maybe POSIX
a -> Control
s {$sel:lastUpdatedAt:Control' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: Control) ((Maybe POSIX -> f (Maybe POSIX)) -> Control -> f Control)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Control
-> f Control
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 Amazon Resource Name (ARN) of the specified control.
control_arn :: Lens.Lens' Control (Prelude.Maybe Prelude.Text)
control_arn :: (Maybe Text -> f (Maybe Text)) -> Control -> f Control
control_arn = (Control -> Maybe Text)
-> (Control -> Maybe Text -> Control)
-> Lens Control Control (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Control' {Maybe Text
arn :: Maybe Text
$sel:arn:Control' :: Control -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Control
s@Control' {} Maybe Text
a -> Control
s {$sel:arn:Control' :: Maybe Text
arn = Maybe Text
a} :: Control)

-- | Specifies when the control was created.
control_createdAt :: Lens.Lens' Control (Prelude.Maybe Prelude.UTCTime)
control_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Control -> f Control
control_createdAt = (Control -> Maybe POSIX)
-> (Control -> Maybe POSIX -> Control)
-> Lens Control Control (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Control' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Control' :: Control -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Control
s@Control' {} Maybe POSIX
a -> Control
s {$sel:createdAt:Control' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Control) ((Maybe POSIX -> f (Maybe POSIX)) -> Control -> f Control)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Control
-> f Control
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 data mapping sources for the specified control.
control_controlMappingSources :: Lens.Lens' Control (Prelude.Maybe (Prelude.NonEmpty ControlMappingSource))
control_controlMappingSources :: (Maybe (NonEmpty ControlMappingSource)
 -> f (Maybe (NonEmpty ControlMappingSource)))
-> Control -> f Control
control_controlMappingSources = (Control -> Maybe (NonEmpty ControlMappingSource))
-> (Control -> Maybe (NonEmpty ControlMappingSource) -> Control)
-> Lens
     Control
     Control
     (Maybe (NonEmpty ControlMappingSource))
     (Maybe (NonEmpty ControlMappingSource))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Control' {Maybe (NonEmpty ControlMappingSource)
controlMappingSources :: Maybe (NonEmpty ControlMappingSource)
$sel:controlMappingSources:Control' :: Control -> Maybe (NonEmpty ControlMappingSource)
controlMappingSources} -> Maybe (NonEmpty ControlMappingSource)
controlMappingSources) (\s :: Control
s@Control' {} Maybe (NonEmpty ControlMappingSource)
a -> Control
s {$sel:controlMappingSources:Control' :: Maybe (NonEmpty ControlMappingSource)
controlMappingSources = Maybe (NonEmpty ControlMappingSource)
a} :: Control) ((Maybe (NonEmpty ControlMappingSource)
  -> f (Maybe (NonEmpty ControlMappingSource)))
 -> Control -> f Control)
-> ((Maybe (NonEmpty ControlMappingSource)
     -> f (Maybe (NonEmpty ControlMappingSource)))
    -> Maybe (NonEmpty ControlMappingSource)
    -> f (Maybe (NonEmpty ControlMappingSource)))
-> (Maybe (NonEmpty ControlMappingSource)
    -> f (Maybe (NonEmpty ControlMappingSource)))
-> Control
-> f Control
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty ControlMappingSource)
  (NonEmpty ControlMappingSource)
  (NonEmpty ControlMappingSource)
  (NonEmpty ControlMappingSource)
-> Iso
     (Maybe (NonEmpty ControlMappingSource))
     (Maybe (NonEmpty ControlMappingSource))
     (Maybe (NonEmpty ControlMappingSource))
     (Maybe (NonEmpty ControlMappingSource))
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
  (NonEmpty ControlMappingSource)
  (NonEmpty ControlMappingSource)
  (NonEmpty ControlMappingSource)
  (NonEmpty ControlMappingSource)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The IAM user or role that created the control.
control_createdBy :: Lens.Lens' Control (Prelude.Maybe Prelude.Text)
control_createdBy :: (Maybe Text -> f (Maybe Text)) -> Control -> f Control
control_createdBy = (Control -> Maybe Text)
-> (Control -> Maybe Text -> Control)
-> Lens Control Control (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Control' {Maybe Text
createdBy :: Maybe Text
$sel:createdBy:Control' :: Control -> Maybe Text
createdBy} -> Maybe Text
createdBy) (\s :: Control
s@Control' {} Maybe Text
a -> Control
s {$sel:createdBy:Control' :: Maybe Text
createdBy = Maybe Text
a} :: Control)

-- | The recommended actions to carry out if the control is not fulfilled.
control_actionPlanInstructions :: Lens.Lens' Control (Prelude.Maybe Prelude.Text)
control_actionPlanInstructions :: (Maybe Text -> f (Maybe Text)) -> Control -> f Control
control_actionPlanInstructions = (Control -> Maybe Text)
-> (Control -> Maybe Text -> Control)
-> Lens Control Control (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Control' {Maybe Text
actionPlanInstructions :: Maybe Text
$sel:actionPlanInstructions:Control' :: Control -> Maybe Text
actionPlanInstructions} -> Maybe Text
actionPlanInstructions) (\s :: Control
s@Control' {} Maybe Text
a -> Control
s {$sel:actionPlanInstructions:Control' :: Maybe Text
actionPlanInstructions = Maybe Text
a} :: Control)

-- | The data source that determines from where Audit Manager collects
-- evidence for the control.
control_controlSources :: Lens.Lens' Control (Prelude.Maybe Prelude.Text)
control_controlSources :: (Maybe Text -> f (Maybe Text)) -> Control -> f Control
control_controlSources = (Control -> Maybe Text)
-> (Control -> Maybe Text -> Control)
-> Lens Control Control (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Control' {Maybe Text
controlSources :: Maybe Text
$sel:controlSources:Control' :: Control -> Maybe Text
controlSources} -> Maybe Text
controlSources) (\s :: Control
s@Control' {} Maybe Text
a -> Control
s {$sel:controlSources:Control' :: Maybe Text
controlSources = Maybe Text
a} :: Control)

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

-- | The title of the action plan for remediating the control.
control_actionPlanTitle :: Lens.Lens' Control (Prelude.Maybe Prelude.Text)
control_actionPlanTitle :: (Maybe Text -> f (Maybe Text)) -> Control -> f Control
control_actionPlanTitle = (Control -> Maybe Text)
-> (Control -> Maybe Text -> Control)
-> Lens Control Control (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Control' {Maybe Text
actionPlanTitle :: Maybe Text
$sel:actionPlanTitle:Control' :: Control -> Maybe Text
actionPlanTitle} -> Maybe Text
actionPlanTitle) (\s :: Control
s@Control' {} Maybe Text
a -> Control
s {$sel:actionPlanTitle:Control' :: Maybe Text
actionPlanTitle = Maybe Text
a} :: Control)

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

-- | The type of control, such as custom or standard.
control_type :: Lens.Lens' Control (Prelude.Maybe ControlType)
control_type :: (Maybe ControlType -> f (Maybe ControlType))
-> Control -> f Control
control_type = (Control -> Maybe ControlType)
-> (Control -> Maybe ControlType -> Control)
-> Lens Control Control (Maybe ControlType) (Maybe ControlType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Control' {Maybe ControlType
type' :: Maybe ControlType
$sel:type':Control' :: Control -> Maybe ControlType
type'} -> Maybe ControlType
type') (\s :: Control
s@Control' {} Maybe ControlType
a -> Control
s {$sel:type':Control' :: Maybe ControlType
type' = Maybe ControlType
a} :: Control)

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

-- | The tags associated with the control.
control_tags :: Lens.Lens' Control (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
control_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Control -> f Control
control_tags = (Control -> Maybe (HashMap Text Text))
-> (Control -> Maybe (HashMap Text Text) -> Control)
-> Lens
     Control
     Control
     (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 (\Control' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:Control' :: Control -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: Control
s@Control' {} Maybe (HashMap Text Text)
a -> Control
s {$sel:tags:Control' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: Control) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> Control -> f Control)
-> ((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)))
-> Control
-> f Control
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

instance Core.FromJSON Control where
  parseJSON :: Value -> Parser Control
parseJSON =
    String -> (Object -> Parser Control) -> Value -> Parser Control
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Control"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe (NonEmpty ControlMappingSource)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ControlType
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Control
Control'
            (Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe (NonEmpty ControlMappingSource)
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ControlType
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Control)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (NonEmpty ControlMappingSource)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ControlType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Control)
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
"lastUpdatedBy")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (NonEmpty ControlMappingSource)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ControlType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Control)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (NonEmpty ControlMappingSource)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ControlType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Control)
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
"testingInformation")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (NonEmpty ControlMappingSource)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ControlType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Control)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe (NonEmpty ControlMappingSource)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ControlType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Control)
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
"lastUpdatedAt")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe (NonEmpty ControlMappingSource)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ControlType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Control)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe (NonEmpty ControlMappingSource)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ControlType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Control)
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
"arn")
            Parser
  (Maybe POSIX
   -> Maybe (NonEmpty ControlMappingSource)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ControlType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Control)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe (NonEmpty ControlMappingSource)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ControlType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Control)
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
"createdAt")
            Parser
  (Maybe (NonEmpty ControlMappingSource)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ControlType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Control)
-> Parser (Maybe (NonEmpty ControlMappingSource))
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ControlType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Control)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty ControlMappingSource))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"controlMappingSources")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ControlType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Control)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ControlType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Control)
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
"createdBy")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ControlType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Control)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ControlType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Control)
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
"actionPlanInstructions")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ControlType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Control)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ControlType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Control)
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
"controlSources")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ControlType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Control)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ControlType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Control)
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 Text
   -> Maybe Text
   -> Maybe ControlType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Control)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ControlType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Control)
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
"actionPlanTitle")
            Parser
  (Maybe Text
   -> Maybe ControlType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Control)
-> Parser (Maybe Text)
-> Parser
     (Maybe ControlType
      -> Maybe Text -> Maybe (HashMap Text Text) -> Control)
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 ControlType
   -> Maybe Text -> Maybe (HashMap Text Text) -> Control)
-> Parser (Maybe ControlType)
-> Parser (Maybe Text -> Maybe (HashMap Text Text) -> Control)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ControlType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
            Parser (Maybe Text -> Maybe (HashMap Text Text) -> Control)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> Control)
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")
            Parser (Maybe (HashMap Text Text) -> Control)
-> Parser (Maybe (HashMap Text Text)) -> Parser Control
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
"tags" 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)
      )

instance Prelude.Hashable Control

instance Prelude.NFData Control