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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElasticSearch.Types.EncryptionAtRestOptions
import Amazonka.ElasticSearch.Types.OptionStatus
import qualified Amazonka.Prelude as Prelude

-- | Status of the Encryption At Rest options for the specified Elasticsearch
-- domain.
--
-- /See:/ 'newEncryptionAtRestOptionsStatus' smart constructor.
data EncryptionAtRestOptionsStatus = EncryptionAtRestOptionsStatus'
  { -- | Specifies the Encryption At Rest options for the specified Elasticsearch
    -- domain.
    EncryptionAtRestOptionsStatus -> EncryptionAtRestOptions
options :: EncryptionAtRestOptions,
    -- | Specifies the status of the Encryption At Rest options for the specified
    -- Elasticsearch domain.
    EncryptionAtRestOptionsStatus -> OptionStatus
status :: OptionStatus
  }
  deriving (EncryptionAtRestOptionsStatus
-> EncryptionAtRestOptionsStatus -> Bool
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]
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
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.
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' - Specifies the Encryption At Rest options for the specified Elasticsearch
-- domain.
--
-- 'status', 'encryptionAtRestOptionsStatus_status' - Specifies the status of the Encryption At Rest options for the specified
-- Elasticsearch domain.
newEncryptionAtRestOptionsStatus ::
  -- | 'options'
  EncryptionAtRestOptions ->
  -- | 'status'
  OptionStatus ->
  EncryptionAtRestOptionsStatus
newEncryptionAtRestOptionsStatus :: EncryptionAtRestOptions
-> OptionStatus -> EncryptionAtRestOptionsStatus
newEncryptionAtRestOptionsStatus EncryptionAtRestOptions
pOptions_ OptionStatus
pStatus_ =
  EncryptionAtRestOptionsStatus'
    { $sel:options:EncryptionAtRestOptionsStatus' :: EncryptionAtRestOptions
options = EncryptionAtRestOptions
pOptions_,
      $sel:status:EncryptionAtRestOptionsStatus' :: OptionStatus
status = OptionStatus
pStatus_
    }

-- | Specifies the Encryption At Rest options for the specified Elasticsearch
-- domain.
encryptionAtRestOptionsStatus_options :: Lens.Lens' EncryptionAtRestOptionsStatus EncryptionAtRestOptions
encryptionAtRestOptionsStatus_options :: Lens' EncryptionAtRestOptionsStatus EncryptionAtRestOptions
encryptionAtRestOptionsStatus_options = 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)

-- | Specifies the status of the Encryption At Rest options for the specified
-- Elasticsearch domain.
encryptionAtRestOptionsStatus_status :: Lens.Lens' EncryptionAtRestOptionsStatus OptionStatus
encryptionAtRestOptionsStatus_status :: Lens' EncryptionAtRestOptionsStatus OptionStatus
encryptionAtRestOptionsStatus_status = 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 Data.FromJSON EncryptionAtRestOptionsStatus where
  parseJSON :: Value -> Parser EncryptionAtRestOptionsStatus
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EncryptionAtRestOptionsStatus"
      ( \Object
x ->
          EncryptionAtRestOptions
-> OptionStatus -> EncryptionAtRestOptionsStatus
EncryptionAtRestOptionsStatus'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Options")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Status")
      )

instance
  Prelude.Hashable
    EncryptionAtRestOptionsStatus
  where
  hashWithSalt :: Int -> EncryptionAtRestOptionsStatus -> Int
hashWithSalt Int
_salt EncryptionAtRestOptionsStatus' {EncryptionAtRestOptions
OptionStatus
status :: OptionStatus
options :: EncryptionAtRestOptions
$sel:status:EncryptionAtRestOptionsStatus' :: EncryptionAtRestOptionsStatus -> OptionStatus
$sel:options:EncryptionAtRestOptionsStatus' :: EncryptionAtRestOptionsStatus -> EncryptionAtRestOptions
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EncryptionAtRestOptions
options
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` OptionStatus
status

instance Prelude.NFData EncryptionAtRestOptionsStatus where
  rnf :: EncryptionAtRestOptionsStatus -> ()
rnf EncryptionAtRestOptionsStatus' {EncryptionAtRestOptions
OptionStatus
status :: OptionStatus
options :: EncryptionAtRestOptions
$sel:status:EncryptionAtRestOptionsStatus' :: EncryptionAtRestOptionsStatus -> OptionStatus
$sel:options:EncryptionAtRestOptionsStatus' :: EncryptionAtRestOptionsStatus -> EncryptionAtRestOptions
..} =
    forall a. NFData a => a -> ()
Prelude.rnf EncryptionAtRestOptions
options
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf OptionStatus
status