{-# 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.NodeToNodeEncryptionOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data NodeToNodeEncryptionOptions = NodeToNodeEncryptionOptions'
{
NodeToNodeEncryptionOptions -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool
}
deriving (NodeToNodeEncryptionOptions -> NodeToNodeEncryptionOptions -> Bool
(NodeToNodeEncryptionOptions
-> NodeToNodeEncryptionOptions -> Bool)
-> (NodeToNodeEncryptionOptions
-> NodeToNodeEncryptionOptions -> Bool)
-> Eq NodeToNodeEncryptionOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NodeToNodeEncryptionOptions -> NodeToNodeEncryptionOptions -> Bool
$c/= :: NodeToNodeEncryptionOptions -> NodeToNodeEncryptionOptions -> Bool
== :: NodeToNodeEncryptionOptions -> NodeToNodeEncryptionOptions -> Bool
$c== :: NodeToNodeEncryptionOptions -> NodeToNodeEncryptionOptions -> Bool
Prelude.Eq, ReadPrec [NodeToNodeEncryptionOptions]
ReadPrec NodeToNodeEncryptionOptions
Int -> ReadS NodeToNodeEncryptionOptions
ReadS [NodeToNodeEncryptionOptions]
(Int -> ReadS NodeToNodeEncryptionOptions)
-> ReadS [NodeToNodeEncryptionOptions]
-> ReadPrec NodeToNodeEncryptionOptions
-> ReadPrec [NodeToNodeEncryptionOptions]
-> Read NodeToNodeEncryptionOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NodeToNodeEncryptionOptions]
$creadListPrec :: ReadPrec [NodeToNodeEncryptionOptions]
readPrec :: ReadPrec NodeToNodeEncryptionOptions
$creadPrec :: ReadPrec NodeToNodeEncryptionOptions
readList :: ReadS [NodeToNodeEncryptionOptions]
$creadList :: ReadS [NodeToNodeEncryptionOptions]
readsPrec :: Int -> ReadS NodeToNodeEncryptionOptions
$creadsPrec :: Int -> ReadS NodeToNodeEncryptionOptions
Prelude.Read, Int -> NodeToNodeEncryptionOptions -> ShowS
[NodeToNodeEncryptionOptions] -> ShowS
NodeToNodeEncryptionOptions -> String
(Int -> NodeToNodeEncryptionOptions -> ShowS)
-> (NodeToNodeEncryptionOptions -> String)
-> ([NodeToNodeEncryptionOptions] -> ShowS)
-> Show NodeToNodeEncryptionOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NodeToNodeEncryptionOptions] -> ShowS
$cshowList :: [NodeToNodeEncryptionOptions] -> ShowS
show :: NodeToNodeEncryptionOptions -> String
$cshow :: NodeToNodeEncryptionOptions -> String
showsPrec :: Int -> NodeToNodeEncryptionOptions -> ShowS
$cshowsPrec :: Int -> NodeToNodeEncryptionOptions -> ShowS
Prelude.Show, (forall x.
NodeToNodeEncryptionOptions -> Rep NodeToNodeEncryptionOptions x)
-> (forall x.
Rep NodeToNodeEncryptionOptions x -> NodeToNodeEncryptionOptions)
-> Generic NodeToNodeEncryptionOptions
forall x.
Rep NodeToNodeEncryptionOptions x -> NodeToNodeEncryptionOptions
forall x.
NodeToNodeEncryptionOptions -> Rep NodeToNodeEncryptionOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NodeToNodeEncryptionOptions x -> NodeToNodeEncryptionOptions
$cfrom :: forall x.
NodeToNodeEncryptionOptions -> Rep NodeToNodeEncryptionOptions x
Prelude.Generic)
newNodeToNodeEncryptionOptions ::
NodeToNodeEncryptionOptions
newNodeToNodeEncryptionOptions :: NodeToNodeEncryptionOptions
newNodeToNodeEncryptionOptions =
NodeToNodeEncryptionOptions' :: Maybe Bool -> NodeToNodeEncryptionOptions
NodeToNodeEncryptionOptions'
{ $sel:enabled:NodeToNodeEncryptionOptions' :: Maybe Bool
enabled =
Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
nodeToNodeEncryptionOptions_enabled :: Lens.Lens' NodeToNodeEncryptionOptions (Prelude.Maybe Prelude.Bool)
nodeToNodeEncryptionOptions_enabled :: (Maybe Bool -> f (Maybe Bool))
-> NodeToNodeEncryptionOptions -> f NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions_enabled = (NodeToNodeEncryptionOptions -> Maybe Bool)
-> (NodeToNodeEncryptionOptions
-> Maybe Bool -> NodeToNodeEncryptionOptions)
-> Lens
NodeToNodeEncryptionOptions
NodeToNodeEncryptionOptions
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeToNodeEncryptionOptions' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:NodeToNodeEncryptionOptions' :: NodeToNodeEncryptionOptions -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: NodeToNodeEncryptionOptions
s@NodeToNodeEncryptionOptions' {} Maybe Bool
a -> NodeToNodeEncryptionOptions
s {$sel:enabled:NodeToNodeEncryptionOptions' :: Maybe Bool
enabled = Maybe Bool
a} :: NodeToNodeEncryptionOptions)
instance Core.FromJSON NodeToNodeEncryptionOptions where
parseJSON :: Value -> Parser NodeToNodeEncryptionOptions
parseJSON =
String
-> (Object -> Parser NodeToNodeEncryptionOptions)
-> Value
-> Parser NodeToNodeEncryptionOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"NodeToNodeEncryptionOptions"
( \Object
x ->
Maybe Bool -> NodeToNodeEncryptionOptions
NodeToNodeEncryptionOptions'
(Maybe Bool -> NodeToNodeEncryptionOptions)
-> Parser (Maybe Bool) -> Parser NodeToNodeEncryptionOptions
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")
)
instance Prelude.Hashable NodeToNodeEncryptionOptions
instance Prelude.NFData NodeToNodeEncryptionOptions
instance Core.ToJSON NodeToNodeEncryptionOptions where
toJSON :: NodeToNodeEncryptionOptions -> Value
toJSON NodeToNodeEncryptionOptions' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:NodeToNodeEncryptionOptions' :: NodeToNodeEncryptionOptions -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"Enabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enabled]
)