{-# 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.DAX.Types.SSESpecification
-- 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.DAX.Types.SSESpecification where

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

-- | Represents the settings used to enable server-side encryption.
--
-- /See:/ 'newSSESpecification' smart constructor.
data SSESpecification = SSESpecification'
  { -- | Indicates whether server-side encryption is enabled (true) or disabled
    -- (false) on the cluster.
    SSESpecification -> Bool
enabled :: Prelude.Bool
  }
  deriving (SSESpecification -> SSESpecification -> Bool
(SSESpecification -> SSESpecification -> Bool)
-> (SSESpecification -> SSESpecification -> Bool)
-> Eq SSESpecification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SSESpecification -> SSESpecification -> Bool
$c/= :: SSESpecification -> SSESpecification -> Bool
== :: SSESpecification -> SSESpecification -> Bool
$c== :: SSESpecification -> SSESpecification -> Bool
Prelude.Eq, ReadPrec [SSESpecification]
ReadPrec SSESpecification
Int -> ReadS SSESpecification
ReadS [SSESpecification]
(Int -> ReadS SSESpecification)
-> ReadS [SSESpecification]
-> ReadPrec SSESpecification
-> ReadPrec [SSESpecification]
-> Read SSESpecification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SSESpecification]
$creadListPrec :: ReadPrec [SSESpecification]
readPrec :: ReadPrec SSESpecification
$creadPrec :: ReadPrec SSESpecification
readList :: ReadS [SSESpecification]
$creadList :: ReadS [SSESpecification]
readsPrec :: Int -> ReadS SSESpecification
$creadsPrec :: Int -> ReadS SSESpecification
Prelude.Read, Int -> SSESpecification -> ShowS
[SSESpecification] -> ShowS
SSESpecification -> String
(Int -> SSESpecification -> ShowS)
-> (SSESpecification -> String)
-> ([SSESpecification] -> ShowS)
-> Show SSESpecification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SSESpecification] -> ShowS
$cshowList :: [SSESpecification] -> ShowS
show :: SSESpecification -> String
$cshow :: SSESpecification -> String
showsPrec :: Int -> SSESpecification -> ShowS
$cshowsPrec :: Int -> SSESpecification -> ShowS
Prelude.Show, (forall x. SSESpecification -> Rep SSESpecification x)
-> (forall x. Rep SSESpecification x -> SSESpecification)
-> Generic SSESpecification
forall x. Rep SSESpecification x -> SSESpecification
forall x. SSESpecification -> Rep SSESpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SSESpecification x -> SSESpecification
$cfrom :: forall x. SSESpecification -> Rep SSESpecification x
Prelude.Generic)

-- |
-- Create a value of 'SSESpecification' 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:
--
-- 'enabled', 'sSESpecification_enabled' - Indicates whether server-side encryption is enabled (true) or disabled
-- (false) on the cluster.
newSSESpecification ::
  -- | 'enabled'
  Prelude.Bool ->
  SSESpecification
newSSESpecification :: Bool -> SSESpecification
newSSESpecification Bool
pEnabled_ =
  SSESpecification' :: Bool -> SSESpecification
SSESpecification' {$sel:enabled:SSESpecification' :: Bool
enabled = Bool
pEnabled_}

-- | Indicates whether server-side encryption is enabled (true) or disabled
-- (false) on the cluster.
sSESpecification_enabled :: Lens.Lens' SSESpecification Prelude.Bool
sSESpecification_enabled :: (Bool -> f Bool) -> SSESpecification -> f SSESpecification
sSESpecification_enabled = (SSESpecification -> Bool)
-> (SSESpecification -> Bool -> SSESpecification)
-> Lens SSESpecification SSESpecification Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSESpecification' {Bool
enabled :: Bool
$sel:enabled:SSESpecification' :: SSESpecification -> Bool
enabled} -> Bool
enabled) (\s :: SSESpecification
s@SSESpecification' {} Bool
a -> SSESpecification
s {$sel:enabled:SSESpecification' :: Bool
enabled = Bool
a} :: SSESpecification)

instance Prelude.Hashable SSESpecification

instance Prelude.NFData SSESpecification

instance Core.ToJSON SSESpecification where
  toJSON :: SSESpecification -> Value
toJSON SSESpecification' {Bool
enabled :: Bool
$sel:enabled:SSESpecification' :: SSESpecification -> Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Enabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
enabled)]
      )