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

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

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

-- |
-- Create a value of 'AdvancedSecurityOptionsStatus' 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', 'advancedSecurityOptionsStatus_options' - Advanced security options for the specified domain.
--
-- 'status', 'advancedSecurityOptionsStatus_status' - Status of the advanced security options for the specified domain.
newAdvancedSecurityOptionsStatus ::
  -- | 'options'
  AdvancedSecurityOptions ->
  -- | 'status'
  OptionStatus ->
  AdvancedSecurityOptionsStatus
newAdvancedSecurityOptionsStatus :: AdvancedSecurityOptions
-> OptionStatus -> AdvancedSecurityOptionsStatus
newAdvancedSecurityOptionsStatus AdvancedSecurityOptions
pOptions_ OptionStatus
pStatus_ =
  AdvancedSecurityOptionsStatus' :: AdvancedSecurityOptions
-> OptionStatus -> AdvancedSecurityOptionsStatus
AdvancedSecurityOptionsStatus'
    { $sel:options:AdvancedSecurityOptionsStatus' :: AdvancedSecurityOptions
options = AdvancedSecurityOptions
pOptions_,
      $sel:status:AdvancedSecurityOptionsStatus' :: OptionStatus
status = OptionStatus
pStatus_
    }

-- | Advanced security options for the specified domain.
advancedSecurityOptionsStatus_options :: Lens.Lens' AdvancedSecurityOptionsStatus AdvancedSecurityOptions
advancedSecurityOptionsStatus_options :: (AdvancedSecurityOptions -> f AdvancedSecurityOptions)
-> AdvancedSecurityOptionsStatus -> f AdvancedSecurityOptionsStatus
advancedSecurityOptionsStatus_options = (AdvancedSecurityOptionsStatus -> AdvancedSecurityOptions)
-> (AdvancedSecurityOptionsStatus
    -> AdvancedSecurityOptions -> AdvancedSecurityOptionsStatus)
-> Lens
     AdvancedSecurityOptionsStatus
     AdvancedSecurityOptionsStatus
     AdvancedSecurityOptions
     AdvancedSecurityOptions
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdvancedSecurityOptionsStatus' {AdvancedSecurityOptions
options :: AdvancedSecurityOptions
$sel:options:AdvancedSecurityOptionsStatus' :: AdvancedSecurityOptionsStatus -> AdvancedSecurityOptions
options} -> AdvancedSecurityOptions
options) (\s :: AdvancedSecurityOptionsStatus
s@AdvancedSecurityOptionsStatus' {} AdvancedSecurityOptions
a -> AdvancedSecurityOptionsStatus
s {$sel:options:AdvancedSecurityOptionsStatus' :: AdvancedSecurityOptions
options = AdvancedSecurityOptions
a} :: AdvancedSecurityOptionsStatus)

-- | Status of the advanced security options for the specified domain.
advancedSecurityOptionsStatus_status :: Lens.Lens' AdvancedSecurityOptionsStatus OptionStatus
advancedSecurityOptionsStatus_status :: (OptionStatus -> f OptionStatus)
-> AdvancedSecurityOptionsStatus -> f AdvancedSecurityOptionsStatus
advancedSecurityOptionsStatus_status = (AdvancedSecurityOptionsStatus -> OptionStatus)
-> (AdvancedSecurityOptionsStatus
    -> OptionStatus -> AdvancedSecurityOptionsStatus)
-> Lens
     AdvancedSecurityOptionsStatus
     AdvancedSecurityOptionsStatus
     OptionStatus
     OptionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdvancedSecurityOptionsStatus' {OptionStatus
status :: OptionStatus
$sel:status:AdvancedSecurityOptionsStatus' :: AdvancedSecurityOptionsStatus -> OptionStatus
status} -> OptionStatus
status) (\s :: AdvancedSecurityOptionsStatus
s@AdvancedSecurityOptionsStatus' {} OptionStatus
a -> AdvancedSecurityOptionsStatus
s {$sel:status:AdvancedSecurityOptionsStatus' :: OptionStatus
status = OptionStatus
a} :: AdvancedSecurityOptionsStatus)

instance Core.FromJSON AdvancedSecurityOptionsStatus where
  parseJSON :: Value -> Parser AdvancedSecurityOptionsStatus
parseJSON =
    String
-> (Object -> Parser AdvancedSecurityOptionsStatus)
-> Value
-> Parser AdvancedSecurityOptionsStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AdvancedSecurityOptionsStatus"
      ( \Object
x ->
          AdvancedSecurityOptions
-> OptionStatus -> AdvancedSecurityOptionsStatus
AdvancedSecurityOptionsStatus'
            (AdvancedSecurityOptions
 -> OptionStatus -> AdvancedSecurityOptionsStatus)
-> Parser AdvancedSecurityOptions
-> Parser (OptionStatus -> AdvancedSecurityOptionsStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser AdvancedSecurityOptions
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Options")
            Parser (OptionStatus -> AdvancedSecurityOptionsStatus)
-> Parser OptionStatus -> Parser AdvancedSecurityOptionsStatus
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
    AdvancedSecurityOptionsStatus

instance Prelude.NFData AdvancedSecurityOptionsStatus