{-# 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.MasterUserOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MasterUserOptions = MasterUserOptions'
{
MasterUserOptions -> Maybe (Sensitive Text)
masterUserPassword :: Prelude.Maybe (Core.Sensitive Prelude.Text),
MasterUserOptions -> Maybe (Sensitive Text)
masterUserName :: Prelude.Maybe (Core.Sensitive Prelude.Text),
MasterUserOptions -> Maybe Text
masterUserARN :: Prelude.Maybe Prelude.Text
}
deriving (MasterUserOptions -> MasterUserOptions -> Bool
(MasterUserOptions -> MasterUserOptions -> Bool)
-> (MasterUserOptions -> MasterUserOptions -> Bool)
-> Eq MasterUserOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MasterUserOptions -> MasterUserOptions -> Bool
$c/= :: MasterUserOptions -> MasterUserOptions -> Bool
== :: MasterUserOptions -> MasterUserOptions -> Bool
$c== :: MasterUserOptions -> MasterUserOptions -> Bool
Prelude.Eq, Int -> MasterUserOptions -> ShowS
[MasterUserOptions] -> ShowS
MasterUserOptions -> String
(Int -> MasterUserOptions -> ShowS)
-> (MasterUserOptions -> String)
-> ([MasterUserOptions] -> ShowS)
-> Show MasterUserOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MasterUserOptions] -> ShowS
$cshowList :: [MasterUserOptions] -> ShowS
show :: MasterUserOptions -> String
$cshow :: MasterUserOptions -> String
showsPrec :: Int -> MasterUserOptions -> ShowS
$cshowsPrec :: Int -> MasterUserOptions -> ShowS
Prelude.Show, (forall x. MasterUserOptions -> Rep MasterUserOptions x)
-> (forall x. Rep MasterUserOptions x -> MasterUserOptions)
-> Generic MasterUserOptions
forall x. Rep MasterUserOptions x -> MasterUserOptions
forall x. MasterUserOptions -> Rep MasterUserOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MasterUserOptions x -> MasterUserOptions
$cfrom :: forall x. MasterUserOptions -> Rep MasterUserOptions x
Prelude.Generic)
newMasterUserOptions ::
MasterUserOptions
newMasterUserOptions :: MasterUserOptions
newMasterUserOptions =
MasterUserOptions' :: Maybe (Sensitive Text)
-> Maybe (Sensitive Text) -> Maybe Text -> MasterUserOptions
MasterUserOptions'
{ $sel:masterUserPassword:MasterUserOptions' :: Maybe (Sensitive Text)
masterUserPassword =
Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:masterUserName:MasterUserOptions' :: Maybe (Sensitive Text)
masterUserName = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:masterUserARN:MasterUserOptions' :: Maybe Text
masterUserARN = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
masterUserOptions_masterUserPassword :: Lens.Lens' MasterUserOptions (Prelude.Maybe Prelude.Text)
masterUserOptions_masterUserPassword :: (Maybe Text -> f (Maybe Text))
-> MasterUserOptions -> f MasterUserOptions
masterUserOptions_masterUserPassword = (MasterUserOptions -> Maybe (Sensitive Text))
-> (MasterUserOptions
-> Maybe (Sensitive Text) -> MasterUserOptions)
-> Lens
MasterUserOptions
MasterUserOptions
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MasterUserOptions' {Maybe (Sensitive Text)
masterUserPassword :: Maybe (Sensitive Text)
$sel:masterUserPassword:MasterUserOptions' :: MasterUserOptions -> Maybe (Sensitive Text)
masterUserPassword} -> Maybe (Sensitive Text)
masterUserPassword) (\s :: MasterUserOptions
s@MasterUserOptions' {} Maybe (Sensitive Text)
a -> MasterUserOptions
s {$sel:masterUserPassword:MasterUserOptions' :: Maybe (Sensitive Text)
masterUserPassword = Maybe (Sensitive Text)
a} :: MasterUserOptions) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> MasterUserOptions -> f MasterUserOptions)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> MasterUserOptions
-> f MasterUserOptions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
masterUserOptions_masterUserName :: Lens.Lens' MasterUserOptions (Prelude.Maybe Prelude.Text)
masterUserOptions_masterUserName :: (Maybe Text -> f (Maybe Text))
-> MasterUserOptions -> f MasterUserOptions
masterUserOptions_masterUserName = (MasterUserOptions -> Maybe (Sensitive Text))
-> (MasterUserOptions
-> Maybe (Sensitive Text) -> MasterUserOptions)
-> Lens
MasterUserOptions
MasterUserOptions
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MasterUserOptions' {Maybe (Sensitive Text)
masterUserName :: Maybe (Sensitive Text)
$sel:masterUserName:MasterUserOptions' :: MasterUserOptions -> Maybe (Sensitive Text)
masterUserName} -> Maybe (Sensitive Text)
masterUserName) (\s :: MasterUserOptions
s@MasterUserOptions' {} Maybe (Sensitive Text)
a -> MasterUserOptions
s {$sel:masterUserName:MasterUserOptions' :: Maybe (Sensitive Text)
masterUserName = Maybe (Sensitive Text)
a} :: MasterUserOptions) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> MasterUserOptions -> f MasterUserOptions)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> MasterUserOptions
-> f MasterUserOptions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
masterUserOptions_masterUserARN :: Lens.Lens' MasterUserOptions (Prelude.Maybe Prelude.Text)
masterUserOptions_masterUserARN :: (Maybe Text -> f (Maybe Text))
-> MasterUserOptions -> f MasterUserOptions
masterUserOptions_masterUserARN = (MasterUserOptions -> Maybe Text)
-> (MasterUserOptions -> Maybe Text -> MasterUserOptions)
-> Lens
MasterUserOptions MasterUserOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MasterUserOptions' {Maybe Text
masterUserARN :: Maybe Text
$sel:masterUserARN:MasterUserOptions' :: MasterUserOptions -> Maybe Text
masterUserARN} -> Maybe Text
masterUserARN) (\s :: MasterUserOptions
s@MasterUserOptions' {} Maybe Text
a -> MasterUserOptions
s {$sel:masterUserARN:MasterUserOptions' :: Maybe Text
masterUserARN = Maybe Text
a} :: MasterUserOptions)
instance Prelude.Hashable MasterUserOptions
instance Prelude.NFData MasterUserOptions
instance Core.ToJSON MasterUserOptions where
toJSON :: MasterUserOptions -> Value
toJSON MasterUserOptions' {Maybe Text
Maybe (Sensitive Text)
masterUserARN :: Maybe Text
masterUserName :: Maybe (Sensitive Text)
masterUserPassword :: Maybe (Sensitive Text)
$sel:masterUserARN:MasterUserOptions' :: MasterUserOptions -> Maybe Text
$sel:masterUserName:MasterUserOptions' :: MasterUserOptions -> Maybe (Sensitive Text)
$sel:masterUserPassword:MasterUserOptions' :: MasterUserOptions -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"MasterUserPassword" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
masterUserPassword,
(Text
"MasterUserName" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
masterUserName,
(Text
"MasterUserARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
masterUserARN
]
)