{-# 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.OpenSearch.Types.EncryptionAtRestOptionsStatus
-- 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.OpenSearch.Types.EncryptionAtRestOptionsStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpenSearch.Types.EncryptionAtRestOptions
import Amazonka.OpenSearch.Types.OptionStatus
import qualified Amazonka.Prelude as Prelude

-- | Status of the encryption At Rest options for the specified domain.
--
-- /See:/ 'newEncryptionAtRestOptionsStatus' smart constructor.
data EncryptionAtRestOptionsStatus = EncryptionAtRestOptionsStatus'
  { -- | The Encryption At Rest options for the specified domain.
    EncryptionAtRestOptionsStatus -> EncryptionAtRestOptions
options :: EncryptionAtRestOptions,
    -- | The status of the Encryption At Rest options for the specified domain.
    EncryptionAtRestOptionsStatus -> OptionStatus
status :: OptionStatus
  }
  deriving (EncryptionAtRestOptionsStatus
-> EncryptionAtRestOptionsStatus -> Bool
(EncryptionAtRestOptionsStatus
 -> EncryptionAtRestOptionsStatus -> Bool)
-> (EncryptionAtRestOptionsStatus
    -> EncryptionAtRestOptionsStatus -> Bool)
-> Eq EncryptionAtRestOptionsStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EncryptionAtRestOptionsStatus
-> EncryptionAtRestOptionsStatus -> Bool
$c/= :: EncryptionAtRestOptionsStatus
-> EncryptionAtRestOptionsStatus -> Bool
== :: EncryptionAtRestOptionsStatus
-> EncryptionAtRestOptionsStatus -> Bool
$c== :: EncryptionAtRestOptionsStatus
-> EncryptionAtRestOptionsStatus -> Bool
Prelude.Eq, ReadPrec [EncryptionAtRestOptionsStatus]
ReadPrec EncryptionAtRestOptionsStatus
Int -> ReadS EncryptionAtRestOptionsStatus
ReadS [EncryptionAtRestOptionsStatus]
(Int -> ReadS EncryptionAtRestOptionsStatus)
-> ReadS [EncryptionAtRestOptionsStatus]
-> ReadPrec EncryptionAtRestOptionsStatus
-> ReadPrec [EncryptionAtRestOptionsStatus]
-> Read EncryptionAtRestOptionsStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EncryptionAtRestOptionsStatus]
$creadListPrec :: ReadPrec [EncryptionAtRestOptionsStatus]
readPrec :: ReadPrec EncryptionAtRestOptionsStatus
$creadPrec :: ReadPrec EncryptionAtRestOptionsStatus
readList :: ReadS [EncryptionAtRestOptionsStatus]
$creadList :: ReadS [EncryptionAtRestOptionsStatus]
readsPrec :: Int -> ReadS EncryptionAtRestOptionsStatus
$creadsPrec :: Int -> ReadS EncryptionAtRestOptionsStatus
Prelude.Read, Int -> EncryptionAtRestOptionsStatus -> ShowS
[EncryptionAtRestOptionsStatus] -> ShowS
EncryptionAtRestOptionsStatus -> String
(Int -> EncryptionAtRestOptionsStatus -> ShowS)
-> (EncryptionAtRestOptionsStatus -> String)
-> ([EncryptionAtRestOptionsStatus] -> ShowS)
-> Show EncryptionAtRestOptionsStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EncryptionAtRestOptionsStatus] -> ShowS
$cshowList :: [EncryptionAtRestOptionsStatus] -> ShowS
show :: EncryptionAtRestOptionsStatus -> String
$cshow :: EncryptionAtRestOptionsStatus -> String
showsPrec :: Int -> EncryptionAtRestOptionsStatus -> ShowS
$cshowsPrec :: Int -> EncryptionAtRestOptionsStatus -> ShowS
Prelude.Show, (forall x.
 EncryptionAtRestOptionsStatus
 -> Rep EncryptionAtRestOptionsStatus x)
-> (forall x.
    Rep EncryptionAtRestOptionsStatus x
    -> EncryptionAtRestOptionsStatus)
-> Generic EncryptionAtRestOptionsStatus
forall x.
Rep EncryptionAtRestOptionsStatus x
-> EncryptionAtRestOptionsStatus
forall x.
EncryptionAtRestOptionsStatus
-> Rep EncryptionAtRestOptionsStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EncryptionAtRestOptionsStatus x
-> EncryptionAtRestOptionsStatus
$cfrom :: forall x.
EncryptionAtRestOptionsStatus
-> Rep EncryptionAtRestOptionsStatus x
Prelude.Generic)

-- |
-- Create a value of 'EncryptionAtRestOptionsStatus' 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:
--
-- 'options', 'encryptionAtRestOptionsStatus_options' - The Encryption At Rest options for the specified domain.
--
-- 'status', 'encryptionAtRestOptionsStatus_status' - The status of the Encryption At Rest options for the specified domain.
newEncryptionAtRestOptionsStatus ::
  -- | 'options'
  EncryptionAtRestOptions ->
  -- | 'status'
  OptionStatus ->
  EncryptionAtRestOptionsStatus
newEncryptionAtRestOptionsStatus :: EncryptionAtRestOptions
-> OptionStatus -> EncryptionAtRestOptionsStatus
newEncryptionAtRestOptionsStatus EncryptionAtRestOptions
pOptions_ OptionStatus
pStatus_ =
  EncryptionAtRestOptionsStatus' :: EncryptionAtRestOptions
-> OptionStatus -> EncryptionAtRestOptionsStatus
EncryptionAtRestOptionsStatus'
    { $sel:options:EncryptionAtRestOptionsStatus' :: EncryptionAtRestOptions
options = EncryptionAtRestOptions
pOptions_,
      $sel:status:EncryptionAtRestOptionsStatus' :: OptionStatus
status = OptionStatus
pStatus_
    }

-- | The Encryption At Rest options for the specified domain.
encryptionAtRestOptionsStatus_options :: Lens.Lens' EncryptionAtRestOptionsStatus EncryptionAtRestOptions
encryptionAtRestOptionsStatus_options :: (EncryptionAtRestOptions -> f EncryptionAtRestOptions)
-> EncryptionAtRestOptionsStatus -> f EncryptionAtRestOptionsStatus
encryptionAtRestOptionsStatus_options = (EncryptionAtRestOptionsStatus -> EncryptionAtRestOptions)
-> (EncryptionAtRestOptionsStatus
    -> EncryptionAtRestOptions -> EncryptionAtRestOptionsStatus)
-> Lens
     EncryptionAtRestOptionsStatus
     EncryptionAtRestOptionsStatus
     EncryptionAtRestOptions
     EncryptionAtRestOptions
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EncryptionAtRestOptionsStatus' {EncryptionAtRestOptions
options :: EncryptionAtRestOptions
$sel:options:EncryptionAtRestOptionsStatus' :: EncryptionAtRestOptionsStatus -> EncryptionAtRestOptions
options} -> EncryptionAtRestOptions
options) (\s :: EncryptionAtRestOptionsStatus
s@EncryptionAtRestOptionsStatus' {} EncryptionAtRestOptions
a -> EncryptionAtRestOptionsStatus
s {$sel:options:EncryptionAtRestOptionsStatus' :: EncryptionAtRestOptions
options = EncryptionAtRestOptions
a} :: EncryptionAtRestOptionsStatus)

-- | The status of the Encryption At Rest options for the specified domain.
encryptionAtRestOptionsStatus_status :: Lens.Lens' EncryptionAtRestOptionsStatus OptionStatus
encryptionAtRestOptionsStatus_status :: (OptionStatus -> f OptionStatus)
-> EncryptionAtRestOptionsStatus -> f EncryptionAtRestOptionsStatus
encryptionAtRestOptionsStatus_status = (EncryptionAtRestOptionsStatus -> OptionStatus)
-> (EncryptionAtRestOptionsStatus
    -> OptionStatus -> EncryptionAtRestOptionsStatus)
-> Lens
     EncryptionAtRestOptionsStatus
     EncryptionAtRestOptionsStatus
     OptionStatus
     OptionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EncryptionAtRestOptionsStatus' {OptionStatus
status :: OptionStatus
$sel:status:EncryptionAtRestOptionsStatus' :: EncryptionAtRestOptionsStatus -> OptionStatus
status} -> OptionStatus
status) (\s :: EncryptionAtRestOptionsStatus
s@EncryptionAtRestOptionsStatus' {} OptionStatus
a -> EncryptionAtRestOptionsStatus
s {$sel:status:EncryptionAtRestOptionsStatus' :: OptionStatus
status = OptionStatus
a} :: EncryptionAtRestOptionsStatus)

instance Core.FromJSON EncryptionAtRestOptionsStatus where
  parseJSON :: Value -> Parser EncryptionAtRestOptionsStatus
parseJSON =
    String
-> (Object -> Parser EncryptionAtRestOptionsStatus)
-> Value
-> Parser EncryptionAtRestOptionsStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EncryptionAtRestOptionsStatus"
      ( \Object
x ->
          EncryptionAtRestOptions
-> OptionStatus -> EncryptionAtRestOptionsStatus
EncryptionAtRestOptionsStatus'
            (EncryptionAtRestOptions
 -> OptionStatus -> EncryptionAtRestOptionsStatus)
-> Parser EncryptionAtRestOptions
-> Parser (OptionStatus -> EncryptionAtRestOptionsStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser EncryptionAtRestOptions
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Options")
            Parser (OptionStatus -> EncryptionAtRestOptionsStatus)
-> Parser OptionStatus -> Parser EncryptionAtRestOptionsStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser OptionStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Status")
      )

instance
  Prelude.Hashable
    EncryptionAtRestOptionsStatus

instance Prelude.NFData EncryptionAtRestOptionsStatus