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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Control entity attributes that uniquely identify an existing control to
-- be added to a framework in Audit Manager.
--
-- /See:/ 'newCreateAssessmentFrameworkControl' smart constructor.
data CreateAssessmentFrameworkControl = CreateAssessmentFrameworkControl'
  { -- | The unique identifier of the control.
    CreateAssessmentFrameworkControl -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (CreateAssessmentFrameworkControl
-> CreateAssessmentFrameworkControl -> Bool
(CreateAssessmentFrameworkControl
 -> CreateAssessmentFrameworkControl -> Bool)
-> (CreateAssessmentFrameworkControl
    -> CreateAssessmentFrameworkControl -> Bool)
-> Eq CreateAssessmentFrameworkControl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAssessmentFrameworkControl
-> CreateAssessmentFrameworkControl -> Bool
$c/= :: CreateAssessmentFrameworkControl
-> CreateAssessmentFrameworkControl -> Bool
== :: CreateAssessmentFrameworkControl
-> CreateAssessmentFrameworkControl -> Bool
$c== :: CreateAssessmentFrameworkControl
-> CreateAssessmentFrameworkControl -> Bool
Prelude.Eq, ReadPrec [CreateAssessmentFrameworkControl]
ReadPrec CreateAssessmentFrameworkControl
Int -> ReadS CreateAssessmentFrameworkControl
ReadS [CreateAssessmentFrameworkControl]
(Int -> ReadS CreateAssessmentFrameworkControl)
-> ReadS [CreateAssessmentFrameworkControl]
-> ReadPrec CreateAssessmentFrameworkControl
-> ReadPrec [CreateAssessmentFrameworkControl]
-> Read CreateAssessmentFrameworkControl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAssessmentFrameworkControl]
$creadListPrec :: ReadPrec [CreateAssessmentFrameworkControl]
readPrec :: ReadPrec CreateAssessmentFrameworkControl
$creadPrec :: ReadPrec CreateAssessmentFrameworkControl
readList :: ReadS [CreateAssessmentFrameworkControl]
$creadList :: ReadS [CreateAssessmentFrameworkControl]
readsPrec :: Int -> ReadS CreateAssessmentFrameworkControl
$creadsPrec :: Int -> ReadS CreateAssessmentFrameworkControl
Prelude.Read, Int -> CreateAssessmentFrameworkControl -> ShowS
[CreateAssessmentFrameworkControl] -> ShowS
CreateAssessmentFrameworkControl -> String
(Int -> CreateAssessmentFrameworkControl -> ShowS)
-> (CreateAssessmentFrameworkControl -> String)
-> ([CreateAssessmentFrameworkControl] -> ShowS)
-> Show CreateAssessmentFrameworkControl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAssessmentFrameworkControl] -> ShowS
$cshowList :: [CreateAssessmentFrameworkControl] -> ShowS
show :: CreateAssessmentFrameworkControl -> String
$cshow :: CreateAssessmentFrameworkControl -> String
showsPrec :: Int -> CreateAssessmentFrameworkControl -> ShowS
$cshowsPrec :: Int -> CreateAssessmentFrameworkControl -> ShowS
Prelude.Show, (forall x.
 CreateAssessmentFrameworkControl
 -> Rep CreateAssessmentFrameworkControl x)
-> (forall x.
    Rep CreateAssessmentFrameworkControl x
    -> CreateAssessmentFrameworkControl)
-> Generic CreateAssessmentFrameworkControl
forall x.
Rep CreateAssessmentFrameworkControl x
-> CreateAssessmentFrameworkControl
forall x.
CreateAssessmentFrameworkControl
-> Rep CreateAssessmentFrameworkControl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAssessmentFrameworkControl x
-> CreateAssessmentFrameworkControl
$cfrom :: forall x.
CreateAssessmentFrameworkControl
-> Rep CreateAssessmentFrameworkControl x
Prelude.Generic)

-- |
-- Create a value of 'CreateAssessmentFrameworkControl' 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:
--
-- 'id', 'createAssessmentFrameworkControl_id' - The unique identifier of the control.
newCreateAssessmentFrameworkControl ::
  CreateAssessmentFrameworkControl
newCreateAssessmentFrameworkControl :: CreateAssessmentFrameworkControl
newCreateAssessmentFrameworkControl =
  CreateAssessmentFrameworkControl' :: Maybe Text -> CreateAssessmentFrameworkControl
CreateAssessmentFrameworkControl'
    { $sel:id:CreateAssessmentFrameworkControl' :: Maybe Text
id =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

instance
  Prelude.Hashable
    CreateAssessmentFrameworkControl

instance
  Prelude.NFData
    CreateAssessmentFrameworkControl

instance Core.ToJSON CreateAssessmentFrameworkControl where
  toJSON :: CreateAssessmentFrameworkControl -> Value
toJSON CreateAssessmentFrameworkControl' {Maybe Text
id :: Maybe Text
$sel:id:CreateAssessmentFrameworkControl' :: CreateAssessmentFrameworkControl -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ([Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [(Text
"id" 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
id])