{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The control mapping fields that represent the source for evidence
-- collection, along with related parameters and metadata. This doesn\'t
-- contain @mappingID@.
--
-- /See:/ 'newCreateControlMappingSource' smart constructor.
data CreateControlMappingSource = CreateControlMappingSource'
  { -- | The description of the data source that determines where Audit Manager
    -- collects evidence from for the control.
    CreateControlMappingSource -> Maybe Text
sourceDescription :: Prelude.Maybe Prelude.Text,
    -- | The frequency of evidence collection for the control mapping source.
    CreateControlMappingSource -> Maybe SourceFrequency
sourceFrequency :: Prelude.Maybe SourceFrequency,
    CreateControlMappingSource -> Maybe SourceKeyword
sourceKeyword :: Prelude.Maybe SourceKeyword,
    -- | The name of the control mapping data source.
    CreateControlMappingSource -> Maybe Text
sourceName :: Prelude.Maybe Prelude.Text,
    -- | The setup option for the data source, which reflects if the evidence
    -- collection is automated or manual.
    CreateControlMappingSource -> Maybe SourceSetUpOption
sourceSetUpOption :: Prelude.Maybe SourceSetUpOption,
    -- | Specifies one of the five types of data sources for evidence collection.
    CreateControlMappingSource -> Maybe SourceType
sourceType :: Prelude.Maybe SourceType,
    -- | The instructions for troubleshooting the control.
    CreateControlMappingSource -> Maybe Text
troubleshootingText :: Prelude.Maybe Prelude.Text
  }
  deriving (CreateControlMappingSource -> CreateControlMappingSource -> Bool
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]
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
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.
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:
--
-- 'sourceDescription', 'createControlMappingSource_sourceDescription' - The description of the data source that determines where Audit Manager
-- collects evidence from for the control.
--
-- 'sourceFrequency', 'createControlMappingSource_sourceFrequency' - The frequency of evidence collection for the control mapping source.
--
-- 'sourceKeyword', 'createControlMappingSource_sourceKeyword' - Undocumented member.
--
-- 'sourceName', 'createControlMappingSource_sourceName' - The name of the control mapping data source.
--
-- 'sourceSetUpOption', 'createControlMappingSource_sourceSetUpOption' - The setup option for the data source, which reflects if the evidence
-- collection is automated or manual.
--
-- 'sourceType', 'createControlMappingSource_sourceType' - Specifies one of the five types of data sources for evidence collection.
--
-- 'troubleshootingText', 'createControlMappingSource_troubleshootingText' - The instructions for troubleshooting the control.
newCreateControlMappingSource ::
  CreateControlMappingSource
newCreateControlMappingSource :: CreateControlMappingSource
newCreateControlMappingSource =
  CreateControlMappingSource'
    { $sel:sourceDescription:CreateControlMappingSource' :: Maybe Text
sourceDescription =
        forall a. Maybe a
Prelude.Nothing,
      $sel:sourceFrequency:CreateControlMappingSource' :: Maybe SourceFrequency
sourceFrequency = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceKeyword:CreateControlMappingSource' :: Maybe SourceKeyword
sourceKeyword = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceName:CreateControlMappingSource' :: Maybe Text
sourceName = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceSetUpOption:CreateControlMappingSource' :: Maybe SourceSetUpOption
sourceSetUpOption = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceType:CreateControlMappingSource' :: Maybe SourceType
sourceType = forall a. Maybe a
Prelude.Nothing,
      $sel:troubleshootingText:CreateControlMappingSource' :: Maybe Text
troubleshootingText = forall a. Maybe a
Prelude.Nothing
    }

-- | The description of the data source that determines where Audit Manager
-- collects evidence from for the control.
createControlMappingSource_sourceDescription :: Lens.Lens' CreateControlMappingSource (Prelude.Maybe Prelude.Text)
createControlMappingSource_sourceDescription :: Lens' CreateControlMappingSource (Maybe Text)
createControlMappingSource_sourceDescription = 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 control mapping source.
createControlMappingSource_sourceFrequency :: Lens.Lens' CreateControlMappingSource (Prelude.Maybe SourceFrequency)
createControlMappingSource_sourceFrequency :: Lens' CreateControlMappingSource (Maybe SourceFrequency)
createControlMappingSource_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 :: Lens' CreateControlMappingSource (Maybe SourceKeyword)
createControlMappingSource_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 name of the control mapping data source.
createControlMappingSource_sourceName :: Lens.Lens' CreateControlMappingSource (Prelude.Maybe Prelude.Text)
createControlMappingSource_sourceName :: Lens' CreateControlMappingSource (Maybe Text)
createControlMappingSource_sourceName = 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)

-- | 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 :: Lens' CreateControlMappingSource (Maybe SourceSetUpOption)
createControlMappingSource_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)

-- | Specifies one of the five types of data sources for evidence collection.
createControlMappingSource_sourceType :: Lens.Lens' CreateControlMappingSource (Prelude.Maybe SourceType)
createControlMappingSource_sourceType :: Lens' CreateControlMappingSource (Maybe SourceType)
createControlMappingSource_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 control.
createControlMappingSource_troubleshootingText :: Lens.Lens' CreateControlMappingSource (Prelude.Maybe Prelude.Text)
createControlMappingSource_troubleshootingText :: Lens' CreateControlMappingSource (Maybe Text)
createControlMappingSource_troubleshootingText = 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)

instance Prelude.Hashable CreateControlMappingSource where
  hashWithSalt :: Int -> CreateControlMappingSource -> Int
hashWithSalt Int
_salt CreateControlMappingSource' {Maybe Text
Maybe SourceFrequency
Maybe SourceKeyword
Maybe SourceSetUpOption
Maybe SourceType
troubleshootingText :: Maybe Text
sourceType :: Maybe SourceType
sourceSetUpOption :: Maybe SourceSetUpOption
sourceName :: Maybe Text
sourceKeyword :: Maybe SourceKeyword
sourceFrequency :: Maybe SourceFrequency
sourceDescription :: Maybe Text
$sel:troubleshootingText:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe Text
$sel:sourceType:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceType
$sel:sourceSetUpOption:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceSetUpOption
$sel:sourceName:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe Text
$sel:sourceKeyword:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceKeyword
$sel:sourceFrequency:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceFrequency
$sel:sourceDescription:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SourceFrequency
sourceFrequency
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SourceKeyword
sourceKeyword
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SourceSetUpOption
sourceSetUpOption
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SourceType
sourceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
troubleshootingText

instance Prelude.NFData CreateControlMappingSource where
  rnf :: CreateControlMappingSource -> ()
rnf CreateControlMappingSource' {Maybe Text
Maybe SourceFrequency
Maybe SourceKeyword
Maybe SourceSetUpOption
Maybe SourceType
troubleshootingText :: Maybe Text
sourceType :: Maybe SourceType
sourceSetUpOption :: Maybe SourceSetUpOption
sourceName :: Maybe Text
sourceKeyword :: Maybe SourceKeyword
sourceFrequency :: Maybe SourceFrequency
sourceDescription :: Maybe Text
$sel:troubleshootingText:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe Text
$sel:sourceType:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceType
$sel:sourceSetUpOption:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceSetUpOption
$sel:sourceName:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe Text
$sel:sourceKeyword:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceKeyword
$sel:sourceFrequency:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe SourceFrequency
$sel:sourceDescription:CreateControlMappingSource' :: CreateControlMappingSource -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SourceFrequency
sourceFrequency
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SourceKeyword
sourceKeyword
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SourceSetUpOption
sourceSetUpOption
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SourceType
sourceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
troubleshootingText

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