{-# 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.ControlTower.Types.EnabledControlSummary
-- 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.ControlTower.Types.EnabledControlSummary where

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

-- | A summary of enabled controls.
--
-- /See:/ 'newEnabledControlSummary' smart constructor.
data EnabledControlSummary = EnabledControlSummary'
  { -- | The ARN of the control. Only __Strongly recommended__ and __Elective__
    -- controls are permitted, with the exception of the __Region deny__
    -- guardrail.
    EnabledControlSummary -> Maybe Text
controlIdentifier :: Prelude.Maybe Prelude.Text
  }
  deriving (EnabledControlSummary -> EnabledControlSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnabledControlSummary -> EnabledControlSummary -> Bool
$c/= :: EnabledControlSummary -> EnabledControlSummary -> Bool
== :: EnabledControlSummary -> EnabledControlSummary -> Bool
$c== :: EnabledControlSummary -> EnabledControlSummary -> Bool
Prelude.Eq, ReadPrec [EnabledControlSummary]
ReadPrec EnabledControlSummary
Int -> ReadS EnabledControlSummary
ReadS [EnabledControlSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnabledControlSummary]
$creadListPrec :: ReadPrec [EnabledControlSummary]
readPrec :: ReadPrec EnabledControlSummary
$creadPrec :: ReadPrec EnabledControlSummary
readList :: ReadS [EnabledControlSummary]
$creadList :: ReadS [EnabledControlSummary]
readsPrec :: Int -> ReadS EnabledControlSummary
$creadsPrec :: Int -> ReadS EnabledControlSummary
Prelude.Read, Int -> EnabledControlSummary -> ShowS
[EnabledControlSummary] -> ShowS
EnabledControlSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnabledControlSummary] -> ShowS
$cshowList :: [EnabledControlSummary] -> ShowS
show :: EnabledControlSummary -> String
$cshow :: EnabledControlSummary -> String
showsPrec :: Int -> EnabledControlSummary -> ShowS
$cshowsPrec :: Int -> EnabledControlSummary -> ShowS
Prelude.Show, forall x. Rep EnabledControlSummary x -> EnabledControlSummary
forall x. EnabledControlSummary -> Rep EnabledControlSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnabledControlSummary x -> EnabledControlSummary
$cfrom :: forall x. EnabledControlSummary -> Rep EnabledControlSummary x
Prelude.Generic)

-- |
-- Create a value of 'EnabledControlSummary' 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:
--
-- 'controlIdentifier', 'enabledControlSummary_controlIdentifier' - The ARN of the control. Only __Strongly recommended__ and __Elective__
-- controls are permitted, with the exception of the __Region deny__
-- guardrail.
newEnabledControlSummary ::
  EnabledControlSummary
newEnabledControlSummary :: EnabledControlSummary
newEnabledControlSummary =
  EnabledControlSummary'
    { $sel:controlIdentifier:EnabledControlSummary' :: Maybe Text
controlIdentifier =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the control. Only __Strongly recommended__ and __Elective__
-- controls are permitted, with the exception of the __Region deny__
-- guardrail.
enabledControlSummary_controlIdentifier :: Lens.Lens' EnabledControlSummary (Prelude.Maybe Prelude.Text)
enabledControlSummary_controlIdentifier :: Lens' EnabledControlSummary (Maybe Text)
enabledControlSummary_controlIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnabledControlSummary' {Maybe Text
controlIdentifier :: Maybe Text
$sel:controlIdentifier:EnabledControlSummary' :: EnabledControlSummary -> Maybe Text
controlIdentifier} -> Maybe Text
controlIdentifier) (\s :: EnabledControlSummary
s@EnabledControlSummary' {} Maybe Text
a -> EnabledControlSummary
s {$sel:controlIdentifier:EnabledControlSummary' :: Maybe Text
controlIdentifier = Maybe Text
a} :: EnabledControlSummary)

instance Data.FromJSON EnabledControlSummary where
  parseJSON :: Value -> Parser EnabledControlSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EnabledControlSummary"
      ( \Object
x ->
          Maybe Text -> EnabledControlSummary
EnabledControlSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"controlIdentifier")
      )

instance Prelude.Hashable EnabledControlSummary where
  hashWithSalt :: Int -> EnabledControlSummary -> Int
hashWithSalt Int
_salt EnabledControlSummary' {Maybe Text
controlIdentifier :: Maybe Text
$sel:controlIdentifier:EnabledControlSummary' :: EnabledControlSummary -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
controlIdentifier

instance Prelude.NFData EnabledControlSummary where
  rnf :: EnabledControlSummary -> ()
rnf EnabledControlSummary' {Maybe Text
controlIdentifier :: Maybe Text
$sel:controlIdentifier:EnabledControlSummary' :: EnabledControlSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
controlIdentifier