{-# 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 #-}
module Amazonka.OpenSearch.Types.AdvancedSecurityOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpenSearch.Types.SAMLOptionsOutput
import qualified Amazonka.Prelude as Prelude
data AdvancedSecurityOptions = AdvancedSecurityOptions'
{
AdvancedSecurityOptions -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
AdvancedSecurityOptions -> Maybe Bool
internalUserDatabaseEnabled :: Prelude.Maybe Prelude.Bool,
AdvancedSecurityOptions -> Maybe SAMLOptionsOutput
sAMLOptions :: Prelude.Maybe SAMLOptionsOutput
}
deriving (AdvancedSecurityOptions -> AdvancedSecurityOptions -> Bool
(AdvancedSecurityOptions -> AdvancedSecurityOptions -> Bool)
-> (AdvancedSecurityOptions -> AdvancedSecurityOptions -> Bool)
-> Eq AdvancedSecurityOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdvancedSecurityOptions -> AdvancedSecurityOptions -> Bool
$c/= :: AdvancedSecurityOptions -> AdvancedSecurityOptions -> Bool
== :: AdvancedSecurityOptions -> AdvancedSecurityOptions -> Bool
$c== :: AdvancedSecurityOptions -> AdvancedSecurityOptions -> Bool
Prelude.Eq, ReadPrec [AdvancedSecurityOptions]
ReadPrec AdvancedSecurityOptions
Int -> ReadS AdvancedSecurityOptions
ReadS [AdvancedSecurityOptions]
(Int -> ReadS AdvancedSecurityOptions)
-> ReadS [AdvancedSecurityOptions]
-> ReadPrec AdvancedSecurityOptions
-> ReadPrec [AdvancedSecurityOptions]
-> Read AdvancedSecurityOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AdvancedSecurityOptions]
$creadListPrec :: ReadPrec [AdvancedSecurityOptions]
readPrec :: ReadPrec AdvancedSecurityOptions
$creadPrec :: ReadPrec AdvancedSecurityOptions
readList :: ReadS [AdvancedSecurityOptions]
$creadList :: ReadS [AdvancedSecurityOptions]
readsPrec :: Int -> ReadS AdvancedSecurityOptions
$creadsPrec :: Int -> ReadS AdvancedSecurityOptions
Prelude.Read, Int -> AdvancedSecurityOptions -> ShowS
[AdvancedSecurityOptions] -> ShowS
AdvancedSecurityOptions -> String
(Int -> AdvancedSecurityOptions -> ShowS)
-> (AdvancedSecurityOptions -> String)
-> ([AdvancedSecurityOptions] -> ShowS)
-> Show AdvancedSecurityOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdvancedSecurityOptions] -> ShowS
$cshowList :: [AdvancedSecurityOptions] -> ShowS
show :: AdvancedSecurityOptions -> String
$cshow :: AdvancedSecurityOptions -> String
showsPrec :: Int -> AdvancedSecurityOptions -> ShowS
$cshowsPrec :: Int -> AdvancedSecurityOptions -> ShowS
Prelude.Show, (forall x.
AdvancedSecurityOptions -> Rep AdvancedSecurityOptions x)
-> (forall x.
Rep AdvancedSecurityOptions x -> AdvancedSecurityOptions)
-> Generic AdvancedSecurityOptions
forall x. Rep AdvancedSecurityOptions x -> AdvancedSecurityOptions
forall x. AdvancedSecurityOptions -> Rep AdvancedSecurityOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AdvancedSecurityOptions x -> AdvancedSecurityOptions
$cfrom :: forall x. AdvancedSecurityOptions -> Rep AdvancedSecurityOptions x
Prelude.Generic)
newAdvancedSecurityOptions ::
AdvancedSecurityOptions
newAdvancedSecurityOptions :: AdvancedSecurityOptions
newAdvancedSecurityOptions =
AdvancedSecurityOptions' :: Maybe Bool
-> Maybe Bool -> Maybe SAMLOptionsOutput -> AdvancedSecurityOptions
AdvancedSecurityOptions'
{ $sel:enabled:AdvancedSecurityOptions' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:internalUserDatabaseEnabled:AdvancedSecurityOptions' :: Maybe Bool
internalUserDatabaseEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:sAMLOptions:AdvancedSecurityOptions' :: Maybe SAMLOptionsOutput
sAMLOptions = Maybe SAMLOptionsOutput
forall a. Maybe a
Prelude.Nothing
}
advancedSecurityOptions_enabled :: Lens.Lens' AdvancedSecurityOptions (Prelude.Maybe Prelude.Bool)
advancedSecurityOptions_enabled :: (Maybe Bool -> f (Maybe Bool))
-> AdvancedSecurityOptions -> f AdvancedSecurityOptions
advancedSecurityOptions_enabled = (AdvancedSecurityOptions -> Maybe Bool)
-> (AdvancedSecurityOptions
-> Maybe Bool -> AdvancedSecurityOptions)
-> Lens
AdvancedSecurityOptions
AdvancedSecurityOptions
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdvancedSecurityOptions' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:AdvancedSecurityOptions' :: AdvancedSecurityOptions -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: AdvancedSecurityOptions
s@AdvancedSecurityOptions' {} Maybe Bool
a -> AdvancedSecurityOptions
s {$sel:enabled:AdvancedSecurityOptions' :: Maybe Bool
enabled = Maybe Bool
a} :: AdvancedSecurityOptions)
advancedSecurityOptions_internalUserDatabaseEnabled :: Lens.Lens' AdvancedSecurityOptions (Prelude.Maybe Prelude.Bool)
advancedSecurityOptions_internalUserDatabaseEnabled :: (Maybe Bool -> f (Maybe Bool))
-> AdvancedSecurityOptions -> f AdvancedSecurityOptions
advancedSecurityOptions_internalUserDatabaseEnabled = (AdvancedSecurityOptions -> Maybe Bool)
-> (AdvancedSecurityOptions
-> Maybe Bool -> AdvancedSecurityOptions)
-> Lens
AdvancedSecurityOptions
AdvancedSecurityOptions
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdvancedSecurityOptions' {Maybe Bool
internalUserDatabaseEnabled :: Maybe Bool
$sel:internalUserDatabaseEnabled:AdvancedSecurityOptions' :: AdvancedSecurityOptions -> Maybe Bool
internalUserDatabaseEnabled} -> Maybe Bool
internalUserDatabaseEnabled) (\s :: AdvancedSecurityOptions
s@AdvancedSecurityOptions' {} Maybe Bool
a -> AdvancedSecurityOptions
s {$sel:internalUserDatabaseEnabled:AdvancedSecurityOptions' :: Maybe Bool
internalUserDatabaseEnabled = Maybe Bool
a} :: AdvancedSecurityOptions)
advancedSecurityOptions_sAMLOptions :: Lens.Lens' AdvancedSecurityOptions (Prelude.Maybe SAMLOptionsOutput)
advancedSecurityOptions_sAMLOptions :: (Maybe SAMLOptionsOutput -> f (Maybe SAMLOptionsOutput))
-> AdvancedSecurityOptions -> f AdvancedSecurityOptions
advancedSecurityOptions_sAMLOptions = (AdvancedSecurityOptions -> Maybe SAMLOptionsOutput)
-> (AdvancedSecurityOptions
-> Maybe SAMLOptionsOutput -> AdvancedSecurityOptions)
-> Lens
AdvancedSecurityOptions
AdvancedSecurityOptions
(Maybe SAMLOptionsOutput)
(Maybe SAMLOptionsOutput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdvancedSecurityOptions' {Maybe SAMLOptionsOutput
sAMLOptions :: Maybe SAMLOptionsOutput
$sel:sAMLOptions:AdvancedSecurityOptions' :: AdvancedSecurityOptions -> Maybe SAMLOptionsOutput
sAMLOptions} -> Maybe SAMLOptionsOutput
sAMLOptions) (\s :: AdvancedSecurityOptions
s@AdvancedSecurityOptions' {} Maybe SAMLOptionsOutput
a -> AdvancedSecurityOptions
s {$sel:sAMLOptions:AdvancedSecurityOptions' :: Maybe SAMLOptionsOutput
sAMLOptions = Maybe SAMLOptionsOutput
a} :: AdvancedSecurityOptions)
instance Core.FromJSON AdvancedSecurityOptions where
parseJSON :: Value -> Parser AdvancedSecurityOptions
parseJSON =
String
-> (Object -> Parser AdvancedSecurityOptions)
-> Value
-> Parser AdvancedSecurityOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AdvancedSecurityOptions"
( \Object
x ->
Maybe Bool
-> Maybe Bool -> Maybe SAMLOptionsOutput -> AdvancedSecurityOptions
AdvancedSecurityOptions'
(Maybe Bool
-> Maybe Bool
-> Maybe SAMLOptionsOutput
-> AdvancedSecurityOptions)
-> Parser (Maybe Bool)
-> Parser
(Maybe Bool -> Maybe SAMLOptionsOutput -> AdvancedSecurityOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Enabled")
Parser
(Maybe Bool -> Maybe SAMLOptionsOutput -> AdvancedSecurityOptions)
-> Parser (Maybe Bool)
-> Parser (Maybe SAMLOptionsOutput -> AdvancedSecurityOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InternalUserDatabaseEnabled")
Parser (Maybe SAMLOptionsOutput -> AdvancedSecurityOptions)
-> Parser (Maybe SAMLOptionsOutput)
-> Parser AdvancedSecurityOptions
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SAMLOptionsOutput)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SAMLOptions")
)
instance Prelude.Hashable AdvancedSecurityOptions
instance Prelude.NFData AdvancedSecurityOptions