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

import Amazonka.AuditManager.Types.SourceFrequency
import Amazonka.AuditManager.Types.SourceKeyword
import Amazonka.AuditManager.Types.SourceSetUpOption
import Amazonka.AuditManager.Types.SourceType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Control mapping fields that represent the source for evidence
-- collection, along with related parameters and metadata. This does not
-- contain @mappingID@.
--
-- /See:/ 'newCreateControlMappingSource' smart constructor.
data CreateControlMappingSource = CreateControlMappingSource'
  { -- | The name of the control mapping data source.
    CreateControlMappingSource -> Maybe Text
sourceName :: Prelude.Maybe Prelude.Text,
    -- | Specifies one of the five types of data sources for evidence collection.
    CreateControlMappingSource -> Maybe SourceType
sourceType :: Prelude.Maybe SourceType,
    -- | The instructions for troubleshooting the specified control.
    CreateControlMappingSource -> Maybe Text
troubleshootingText :: Prelude.Maybe Prelude.Text,
    -- | The description of the data source that determines from where Audit
    -- Manager collects evidence for the control.
    CreateControlMappingSource -> Maybe Text
sourceDescription :: Prelude.Maybe Prelude.Text,
    -- | The frequency of evidence collection for the specified control mapping
    -- source.
    CreateControlMappingSource -> Maybe SourceFrequency
sourceFrequency :: Prelude.Maybe SourceFrequency,
    CreateControlMappingSource -> Maybe SourceKeyword
sourceKeyword :: Prelude.Maybe SourceKeyword,
    -- | The setup option for the data source, which reflects if the evidence
    -- collection is automated or manual.
    CreateControlMappingSource -> Maybe SourceSetUpOption
sourceSetUpOption :: Prelude.Maybe SourceSetUpOption
  }
  deriving (CreateControlMappingSource -> CreateControlMappingSource -> Bool
(CreateControlMappingSource -> CreateControlMappingSource -> Bool)
-> (CreateControlMappingSource
    -> CreateControlMappingSource -> Bool)
-> Eq CreateControlMappingSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateControlMappingSource -> CreateControlMappingSource -> Bool
$c/= :: CreateControlMappingSource -> CreateControlMappingSource -> Bool
== :: CreateControlMappingSource -> CreateControlMappingSource -> Bool
$c== :: CreateControlMappingSource -> CreateControlMappingSource -> Bool
Prelude.Eq, ReadPrec [CreateControlMappingSource]
ReadPrec CreateControlMappingSource
Int -> ReadS CreateControlMappingSource
ReadS [CreateControlMappingSource]
(Int -> ReadS CreateControlMappingSource)
-> ReadS [CreateControlMappingSource]
-> ReadPrec CreateControlMappingSource
-> ReadPrec [CreateControlMappingSource]
-> Read CreateControlMappingSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateControlMappingSource]
$creadListPrec :: ReadPrec [CreateControlMappingSource]
readPrec :: ReadPrec CreateControlMappingSource
$creadPrec :: ReadPrec CreateControlMappingSource
readList :: ReadS [CreateControlMappingSource]
$creadList :: ReadS [CreateControlMappingSource]
readsPrec :: Int -> ReadS CreateControlMappingSource
$creadsPrec :: Int -> ReadS CreateControlMappingSource
Prelude.Read, Int -> CreateControlMappingSource -> ShowS
[CreateControlMappingSource] -> ShowS
CreateControlMappingSource -> String
(Int -> CreateControlMappingSource -> ShowS)
-> (CreateControlMappingSource -> String)
-> ([CreateControlMappingSource] -> ShowS)
-> Show CreateControlMappingSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateControlMappingSource] -> ShowS
$cshowList :: [CreateControlMappingSource] -> ShowS
show :: CreateControlMappingSource -> String
$cshow :: CreateControlMappingSource -> String
showsPrec :: Int -> CreateControlMappingSource -> ShowS
$cshowsPrec :: Int -> CreateControlMappingSource -> ShowS
Prelude.Show, (forall x.
 CreateControlMappingSource -> Rep CreateControlMappingSource x)
-> (forall x.
    Rep CreateControlMappingSource x -> CreateControlMappingSource)
-> Generic CreateControlMappingSource
forall x.
Rep CreateControlMappingSource x -> CreateControlMappingSource
forall x.
CreateControlMappingSource -> Rep CreateControlMappingSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateControlMappingSource x -> CreateControlMappingSource
$cfrom :: forall x.
CreateControlMappingSource -> Rep CreateControlMappingSource x
Prelude.Generic)

-- |
-- Create a value of 'CreateControlMappingSource' 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:
--
-- 'sourceName', 'createControlMappingSource_sourceName' - The name of the control mapping data source.
--
-- 'sourceType', 'createControlMappingSource_sourceType' - Specifies one of the five types of data sources for evidence collection.
--
-- 'troubleshootingText', 'createControlMappingSource_troubleshootingText' - The instructions for troubleshooting the specified control.
--
-- 'sourceDescription', 'createControlMappingSource_sourceDescription' - The description of the data source that determines from where Audit
-- Manager collects evidence for the control.
--
-- 'sourceFrequency', 'createControlMappingSource_sourceFrequency' - The frequency of evidence collection for the specified control mapping
-- source.
--
-- 'sourceKeyword', 'createControlMappingSource_sourceKeyword' - Undocumented member.
--
-- 'sourceSetUpOption', 'createControlMappingSource_sourceSetUpOption' - The setup option for the data source, which reflects if the evidence
-- collection is automated or manual.
newCreateControlMappingSource ::
  CreateControlMappingSource
newCreateControlMappingSource :: CreateControlMappingSource
newCreateControlMappingSource =
  CreateControlMappingSource' :: Maybe Text
-> Maybe SourceType
-> Maybe Text
-> Maybe Text
-> Maybe SourceFrequency
-> Maybe SourceKeyword
-> Maybe SourceSetUpOption
-> CreateControlMappingSource
CreateControlMappingSource'
    { $sel:sourceName:CreateControlMappingSource' :: Maybe Text
sourceName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceType:CreateControlMappingSource' :: Maybe SourceType
sourceType = Maybe SourceType
forall a. Maybe a
Prelude.Nothing,
      $sel:troubleshootingText:CreateControlMappingSource' :: Maybe Text
troubleshootingText = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceDescription:CreateControlMappingSource' :: Maybe Text
sourceDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceFrequency:CreateControlMappingSource' :: Maybe SourceFrequency
sourceFrequency = Maybe SourceFrequency
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceKeyword:CreateControlMappingSource' :: Maybe SourceKeyword
sourceKeyword = Maybe SourceKeyword
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceSetUpOption:CreateControlMappingSource' :: Maybe SourceSetUpOption
sourceSetUpOption = Maybe SourceSetUpOption
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the control mapping data source.
createControlMappingSource_sourceName :: Lens.Lens' CreateControlMappingSource (Prelude.Maybe Prelude.Text)
createControlMappingSource_sourceName :: (Maybe Text -> f (Maybe Text))
-> CreateControlMappingSource -> f CreateControlMappingSource
createControlMappingSource_sourceName = (CreateControlMappingSource -> Maybe Text)
-> (CreateControlMappingSource
    -> Maybe Text -> CreateControlMappingSource)
-> Lens
     CreateControlMappingSource
     CreateControlMappingSource
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateControlMappingSource' {Maybe Text
sourceName :: Maybe Text
$sel:sourceName:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe Text
sourceName} -> Maybe Text
sourceName) (\s :: CreateControlMappingSource
s@CreateControlMappingSource' {} Maybe Text
a -> CreateControlMappingSource
s {$sel:sourceName:CreateControlMappingSource' :: Maybe Text
sourceName = Maybe Text
a} :: CreateControlMappingSource)

-- | Specifies one of the five types of data sources for evidence collection.
createControlMappingSource_sourceType :: Lens.Lens' CreateControlMappingSource (Prelude.Maybe SourceType)
createControlMappingSource_sourceType :: (Maybe SourceType -> f (Maybe SourceType))
-> CreateControlMappingSource -> f CreateControlMappingSource
createControlMappingSource_sourceType = (CreateControlMappingSource -> Maybe SourceType)
-> (CreateControlMappingSource
    -> Maybe SourceType -> CreateControlMappingSource)
-> Lens
     CreateControlMappingSource
     CreateControlMappingSource
     (Maybe SourceType)
     (Maybe SourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateControlMappingSource' {Maybe SourceType
sourceType :: Maybe SourceType
$sel:sourceType:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceType
sourceType} -> Maybe SourceType
sourceType) (\s :: CreateControlMappingSource
s@CreateControlMappingSource' {} Maybe SourceType
a -> CreateControlMappingSource
s {$sel:sourceType:CreateControlMappingSource' :: Maybe SourceType
sourceType = Maybe SourceType
a} :: CreateControlMappingSource)

-- | The instructions for troubleshooting the specified control.
createControlMappingSource_troubleshootingText :: Lens.Lens' CreateControlMappingSource (Prelude.Maybe Prelude.Text)
createControlMappingSource_troubleshootingText :: (Maybe Text -> f (Maybe Text))
-> CreateControlMappingSource -> f CreateControlMappingSource
createControlMappingSource_troubleshootingText = (CreateControlMappingSource -> Maybe Text)
-> (CreateControlMappingSource
    -> Maybe Text -> CreateControlMappingSource)
-> Lens
     CreateControlMappingSource
     CreateControlMappingSource
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateControlMappingSource' {Maybe Text
troubleshootingText :: Maybe Text
$sel:troubleshootingText:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe Text
troubleshootingText} -> Maybe Text
troubleshootingText) (\s :: CreateControlMappingSource
s@CreateControlMappingSource' {} Maybe Text
a -> CreateControlMappingSource
s {$sel:troubleshootingText:CreateControlMappingSource' :: Maybe Text
troubleshootingText = Maybe Text
a} :: CreateControlMappingSource)

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

-- | The frequency of evidence collection for the specified control mapping
-- source.
createControlMappingSource_sourceFrequency :: Lens.Lens' CreateControlMappingSource (Prelude.Maybe SourceFrequency)
createControlMappingSource_sourceFrequency :: (Maybe SourceFrequency -> f (Maybe SourceFrequency))
-> CreateControlMappingSource -> f CreateControlMappingSource
createControlMappingSource_sourceFrequency = (CreateControlMappingSource -> Maybe SourceFrequency)
-> (CreateControlMappingSource
    -> Maybe SourceFrequency -> CreateControlMappingSource)
-> Lens
     CreateControlMappingSource
     CreateControlMappingSource
     (Maybe SourceFrequency)
     (Maybe SourceFrequency)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateControlMappingSource' {Maybe SourceFrequency
sourceFrequency :: Maybe SourceFrequency
$sel:sourceFrequency:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceFrequency
sourceFrequency} -> Maybe SourceFrequency
sourceFrequency) (\s :: CreateControlMappingSource
s@CreateControlMappingSource' {} Maybe SourceFrequency
a -> CreateControlMappingSource
s {$sel:sourceFrequency:CreateControlMappingSource' :: Maybe SourceFrequency
sourceFrequency = Maybe SourceFrequency
a} :: CreateControlMappingSource)

-- | Undocumented member.
createControlMappingSource_sourceKeyword :: Lens.Lens' CreateControlMappingSource (Prelude.Maybe SourceKeyword)
createControlMappingSource_sourceKeyword :: (Maybe SourceKeyword -> f (Maybe SourceKeyword))
-> CreateControlMappingSource -> f CreateControlMappingSource
createControlMappingSource_sourceKeyword = (CreateControlMappingSource -> Maybe SourceKeyword)
-> (CreateControlMappingSource
    -> Maybe SourceKeyword -> CreateControlMappingSource)
-> Lens
     CreateControlMappingSource
     CreateControlMappingSource
     (Maybe SourceKeyword)
     (Maybe SourceKeyword)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateControlMappingSource' {Maybe SourceKeyword
sourceKeyword :: Maybe SourceKeyword
$sel:sourceKeyword:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceKeyword
sourceKeyword} -> Maybe SourceKeyword
sourceKeyword) (\s :: CreateControlMappingSource
s@CreateControlMappingSource' {} Maybe SourceKeyword
a -> CreateControlMappingSource
s {$sel:sourceKeyword:CreateControlMappingSource' :: Maybe SourceKeyword
sourceKeyword = Maybe SourceKeyword
a} :: CreateControlMappingSource)

-- | The setup option for the data source, which reflects if the evidence
-- collection is automated or manual.
createControlMappingSource_sourceSetUpOption :: Lens.Lens' CreateControlMappingSource (Prelude.Maybe SourceSetUpOption)
createControlMappingSource_sourceSetUpOption :: (Maybe SourceSetUpOption -> f (Maybe SourceSetUpOption))
-> CreateControlMappingSource -> f CreateControlMappingSource
createControlMappingSource_sourceSetUpOption = (CreateControlMappingSource -> Maybe SourceSetUpOption)
-> (CreateControlMappingSource
    -> Maybe SourceSetUpOption -> CreateControlMappingSource)
-> Lens
     CreateControlMappingSource
     CreateControlMappingSource
     (Maybe SourceSetUpOption)
     (Maybe SourceSetUpOption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateControlMappingSource' {Maybe SourceSetUpOption
sourceSetUpOption :: Maybe SourceSetUpOption
$sel:sourceSetUpOption:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceSetUpOption
sourceSetUpOption} -> Maybe SourceSetUpOption
sourceSetUpOption) (\s :: CreateControlMappingSource
s@CreateControlMappingSource' {} Maybe SourceSetUpOption
a -> CreateControlMappingSource
s {$sel:sourceSetUpOption:CreateControlMappingSource' :: Maybe SourceSetUpOption
sourceSetUpOption = Maybe SourceSetUpOption
a} :: CreateControlMappingSource)

instance Prelude.Hashable CreateControlMappingSource

instance Prelude.NFData CreateControlMappingSource

instance Core.ToJSON CreateControlMappingSource where
  toJSON :: CreateControlMappingSource -> Value
toJSON CreateControlMappingSource' {Maybe Text
Maybe SourceFrequency
Maybe SourceKeyword
Maybe SourceSetUpOption
Maybe SourceType
sourceSetUpOption :: Maybe SourceSetUpOption
sourceKeyword :: Maybe SourceKeyword
sourceFrequency :: Maybe SourceFrequency
sourceDescription :: Maybe Text
troubleshootingText :: Maybe Text
sourceType :: Maybe SourceType
sourceName :: Maybe Text
$sel:sourceSetUpOption:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceSetUpOption
$sel:sourceKeyword:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceKeyword
$sel:sourceFrequency:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceFrequency
$sel:sourceDescription:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe Text
$sel:troubleshootingText:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe Text
$sel:sourceType:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceType
$sel:sourceName:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"sourceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceName,
            (Text
"sourceType" Text -> SourceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SourceType -> Pair) -> Maybe SourceType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SourceType
sourceType,
            (Text
"troubleshootingText" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
troubleshootingText,
            (Text
"sourceDescription" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceDescription,
            (Text
"sourceFrequency" Text -> SourceFrequency -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SourceFrequency -> Pair) -> Maybe SourceFrequency -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SourceFrequency
sourceFrequency,
            (Text
"sourceKeyword" Text -> SourceKeyword -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SourceKeyword -> Pair) -> Maybe SourceKeyword -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SourceKeyword
sourceKeyword,
            (Text
"sourceSetUpOption" Text -> SourceSetUpOption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SourceSetUpOption -> Pair)
-> Maybe SourceSetUpOption -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SourceSetUpOption
sourceSetUpOption
          ]
      )