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

import qualified Amazonka.Core as Core
import Amazonka.DAX.Types.SSEStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The description of the server-side encryption status on the specified
-- DAX cluster.
--
-- /See:/ 'newSSEDescription' smart constructor.
data SSEDescription = SSEDescription'
  { -- | The current state of server-side encryption:
    --
    -- -   @ENABLING@ - Server-side encryption is being enabled.
    --
    -- -   @ENABLED@ - Server-side encryption is enabled.
    --
    -- -   @DISABLING@ - Server-side encryption is being disabled.
    --
    -- -   @DISABLED@ - Server-side encryption is disabled.
    SSEDescription -> Maybe SSEStatus
status :: Prelude.Maybe SSEStatus
  }
  deriving (SSEDescription -> SSEDescription -> Bool
(SSEDescription -> SSEDescription -> Bool)
-> (SSEDescription -> SSEDescription -> Bool) -> Eq SSEDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SSEDescription -> SSEDescription -> Bool
$c/= :: SSEDescription -> SSEDescription -> Bool
== :: SSEDescription -> SSEDescription -> Bool
$c== :: SSEDescription -> SSEDescription -> Bool
Prelude.Eq, ReadPrec [SSEDescription]
ReadPrec SSEDescription
Int -> ReadS SSEDescription
ReadS [SSEDescription]
(Int -> ReadS SSEDescription)
-> ReadS [SSEDescription]
-> ReadPrec SSEDescription
-> ReadPrec [SSEDescription]
-> Read SSEDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SSEDescription]
$creadListPrec :: ReadPrec [SSEDescription]
readPrec :: ReadPrec SSEDescription
$creadPrec :: ReadPrec SSEDescription
readList :: ReadS [SSEDescription]
$creadList :: ReadS [SSEDescription]
readsPrec :: Int -> ReadS SSEDescription
$creadsPrec :: Int -> ReadS SSEDescription
Prelude.Read, Int -> SSEDescription -> ShowS
[SSEDescription] -> ShowS
SSEDescription -> String
(Int -> SSEDescription -> ShowS)
-> (SSEDescription -> String)
-> ([SSEDescription] -> ShowS)
-> Show SSEDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SSEDescription] -> ShowS
$cshowList :: [SSEDescription] -> ShowS
show :: SSEDescription -> String
$cshow :: SSEDescription -> String
showsPrec :: Int -> SSEDescription -> ShowS
$cshowsPrec :: Int -> SSEDescription -> ShowS
Prelude.Show, (forall x. SSEDescription -> Rep SSEDescription x)
-> (forall x. Rep SSEDescription x -> SSEDescription)
-> Generic SSEDescription
forall x. Rep SSEDescription x -> SSEDescription
forall x. SSEDescription -> Rep SSEDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SSEDescription x -> SSEDescription
$cfrom :: forall x. SSEDescription -> Rep SSEDescription x
Prelude.Generic)

-- |
-- Create a value of 'SSEDescription' 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:
--
-- 'status', 'sSEDescription_status' - The current state of server-side encryption:
--
-- -   @ENABLING@ - Server-side encryption is being enabled.
--
-- -   @ENABLED@ - Server-side encryption is enabled.
--
-- -   @DISABLING@ - Server-side encryption is being disabled.
--
-- -   @DISABLED@ - Server-side encryption is disabled.
newSSEDescription ::
  SSEDescription
newSSEDescription :: SSEDescription
newSSEDescription =
  SSEDescription' :: Maybe SSEStatus -> SSEDescription
SSEDescription' {$sel:status:SSEDescription' :: Maybe SSEStatus
status = Maybe SSEStatus
forall a. Maybe a
Prelude.Nothing}

-- | The current state of server-side encryption:
--
-- -   @ENABLING@ - Server-side encryption is being enabled.
--
-- -   @ENABLED@ - Server-side encryption is enabled.
--
-- -   @DISABLING@ - Server-side encryption is being disabled.
--
-- -   @DISABLED@ - Server-side encryption is disabled.
sSEDescription_status :: Lens.Lens' SSEDescription (Prelude.Maybe SSEStatus)
sSEDescription_status :: (Maybe SSEStatus -> f (Maybe SSEStatus))
-> SSEDescription -> f SSEDescription
sSEDescription_status = (SSEDescription -> Maybe SSEStatus)
-> (SSEDescription -> Maybe SSEStatus -> SSEDescription)
-> Lens
     SSEDescription SSEDescription (Maybe SSEStatus) (Maybe SSEStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSEDescription' {Maybe SSEStatus
status :: Maybe SSEStatus
$sel:status:SSEDescription' :: SSEDescription -> Maybe SSEStatus
status} -> Maybe SSEStatus
status) (\s :: SSEDescription
s@SSEDescription' {} Maybe SSEStatus
a -> SSEDescription
s {$sel:status:SSEDescription' :: Maybe SSEStatus
status = Maybe SSEStatus
a} :: SSEDescription)

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

instance Prelude.Hashable SSEDescription

instance Prelude.NFData SSEDescription