{-# 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.DMS.Types.RedisSettings where
import qualified Amazonka.Core as Core
import Amazonka.DMS.Types.RedisAuthTypeValue
import Amazonka.DMS.Types.SslSecurityProtocolValue
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RedisSettings = RedisSettings'
{
RedisSettings -> Maybe SslSecurityProtocolValue
sslSecurityProtocol :: Prelude.Maybe SslSecurityProtocolValue,
RedisSettings -> Maybe Text
authUserName :: Prelude.Maybe Prelude.Text,
RedisSettings -> Maybe Text
sslCaCertificateArn :: Prelude.Maybe Prelude.Text,
RedisSettings -> Maybe (Sensitive Text)
authPassword :: Prelude.Maybe (Core.Sensitive Prelude.Text),
RedisSettings -> Maybe RedisAuthTypeValue
authType :: Prelude.Maybe RedisAuthTypeValue,
RedisSettings -> Text
serverName :: Prelude.Text,
RedisSettings -> Int
port :: Prelude.Int
}
deriving (RedisSettings -> RedisSettings -> Bool
(RedisSettings -> RedisSettings -> Bool)
-> (RedisSettings -> RedisSettings -> Bool) -> Eq RedisSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedisSettings -> RedisSettings -> Bool
$c/= :: RedisSettings -> RedisSettings -> Bool
== :: RedisSettings -> RedisSettings -> Bool
$c== :: RedisSettings -> RedisSettings -> Bool
Prelude.Eq, Int -> RedisSettings -> ShowS
[RedisSettings] -> ShowS
RedisSettings -> String
(Int -> RedisSettings -> ShowS)
-> (RedisSettings -> String)
-> ([RedisSettings] -> ShowS)
-> Show RedisSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedisSettings] -> ShowS
$cshowList :: [RedisSettings] -> ShowS
show :: RedisSettings -> String
$cshow :: RedisSettings -> String
showsPrec :: Int -> RedisSettings -> ShowS
$cshowsPrec :: Int -> RedisSettings -> ShowS
Prelude.Show, (forall x. RedisSettings -> Rep RedisSettings x)
-> (forall x. Rep RedisSettings x -> RedisSettings)
-> Generic RedisSettings
forall x. Rep RedisSettings x -> RedisSettings
forall x. RedisSettings -> Rep RedisSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RedisSettings x -> RedisSettings
$cfrom :: forall x. RedisSettings -> Rep RedisSettings x
Prelude.Generic)
newRedisSettings ::
Prelude.Text ->
Prelude.Int ->
RedisSettings
newRedisSettings :: Text -> Int -> RedisSettings
newRedisSettings Text
pServerName_ Int
pPort_ =
RedisSettings' :: Maybe SslSecurityProtocolValue
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe RedisAuthTypeValue
-> Text
-> Int
-> RedisSettings
RedisSettings'
{ $sel:sslSecurityProtocol:RedisSettings' :: Maybe SslSecurityProtocolValue
sslSecurityProtocol =
Maybe SslSecurityProtocolValue
forall a. Maybe a
Prelude.Nothing,
$sel:authUserName:RedisSettings' :: Maybe Text
authUserName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sslCaCertificateArn:RedisSettings' :: Maybe Text
sslCaCertificateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:authPassword:RedisSettings' :: Maybe (Sensitive Text)
authPassword = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:authType:RedisSettings' :: Maybe RedisAuthTypeValue
authType = Maybe RedisAuthTypeValue
forall a. Maybe a
Prelude.Nothing,
$sel:serverName:RedisSettings' :: Text
serverName = Text
pServerName_,
$sel:port:RedisSettings' :: Int
port = Int
pPort_
}
redisSettings_sslSecurityProtocol :: Lens.Lens' RedisSettings (Prelude.Maybe SslSecurityProtocolValue)
redisSettings_sslSecurityProtocol :: (Maybe SslSecurityProtocolValue
-> f (Maybe SslSecurityProtocolValue))
-> RedisSettings -> f RedisSettings
redisSettings_sslSecurityProtocol = (RedisSettings -> Maybe SslSecurityProtocolValue)
-> (RedisSettings
-> Maybe SslSecurityProtocolValue -> RedisSettings)
-> Lens
RedisSettings
RedisSettings
(Maybe SslSecurityProtocolValue)
(Maybe SslSecurityProtocolValue)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedisSettings' {Maybe SslSecurityProtocolValue
sslSecurityProtocol :: Maybe SslSecurityProtocolValue
$sel:sslSecurityProtocol:RedisSettings' :: RedisSettings -> Maybe SslSecurityProtocolValue
sslSecurityProtocol} -> Maybe SslSecurityProtocolValue
sslSecurityProtocol) (\s :: RedisSettings
s@RedisSettings' {} Maybe SslSecurityProtocolValue
a -> RedisSettings
s {$sel:sslSecurityProtocol:RedisSettings' :: Maybe SslSecurityProtocolValue
sslSecurityProtocol = Maybe SslSecurityProtocolValue
a} :: RedisSettings)
redisSettings_authUserName :: Lens.Lens' RedisSettings (Prelude.Maybe Prelude.Text)
redisSettings_authUserName :: (Maybe Text -> f (Maybe Text)) -> RedisSettings -> f RedisSettings
redisSettings_authUserName = (RedisSettings -> Maybe Text)
-> (RedisSettings -> Maybe Text -> RedisSettings)
-> Lens RedisSettings RedisSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedisSettings' {Maybe Text
authUserName :: Maybe Text
$sel:authUserName:RedisSettings' :: RedisSettings -> Maybe Text
authUserName} -> Maybe Text
authUserName) (\s :: RedisSettings
s@RedisSettings' {} Maybe Text
a -> RedisSettings
s {$sel:authUserName:RedisSettings' :: Maybe Text
authUserName = Maybe Text
a} :: RedisSettings)
redisSettings_sslCaCertificateArn :: Lens.Lens' RedisSettings (Prelude.Maybe Prelude.Text)
redisSettings_sslCaCertificateArn :: (Maybe Text -> f (Maybe Text)) -> RedisSettings -> f RedisSettings
redisSettings_sslCaCertificateArn = (RedisSettings -> Maybe Text)
-> (RedisSettings -> Maybe Text -> RedisSettings)
-> Lens RedisSettings RedisSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedisSettings' {Maybe Text
sslCaCertificateArn :: Maybe Text
$sel:sslCaCertificateArn:RedisSettings' :: RedisSettings -> Maybe Text
sslCaCertificateArn} -> Maybe Text
sslCaCertificateArn) (\s :: RedisSettings
s@RedisSettings' {} Maybe Text
a -> RedisSettings
s {$sel:sslCaCertificateArn:RedisSettings' :: Maybe Text
sslCaCertificateArn = Maybe Text
a} :: RedisSettings)
redisSettings_authPassword :: Lens.Lens' RedisSettings (Prelude.Maybe Prelude.Text)
redisSettings_authPassword :: (Maybe Text -> f (Maybe Text)) -> RedisSettings -> f RedisSettings
redisSettings_authPassword = (RedisSettings -> Maybe (Sensitive Text))
-> (RedisSettings -> Maybe (Sensitive Text) -> RedisSettings)
-> Lens
RedisSettings
RedisSettings
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedisSettings' {Maybe (Sensitive Text)
authPassword :: Maybe (Sensitive Text)
$sel:authPassword:RedisSettings' :: RedisSettings -> Maybe (Sensitive Text)
authPassword} -> Maybe (Sensitive Text)
authPassword) (\s :: RedisSettings
s@RedisSettings' {} Maybe (Sensitive Text)
a -> RedisSettings
s {$sel:authPassword:RedisSettings' :: Maybe (Sensitive Text)
authPassword = Maybe (Sensitive Text)
a} :: RedisSettings) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> RedisSettings -> f RedisSettings)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> RedisSettings
-> f RedisSettings
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
redisSettings_authType :: Lens.Lens' RedisSettings (Prelude.Maybe RedisAuthTypeValue)
redisSettings_authType :: (Maybe RedisAuthTypeValue -> f (Maybe RedisAuthTypeValue))
-> RedisSettings -> f RedisSettings
redisSettings_authType = (RedisSettings -> Maybe RedisAuthTypeValue)
-> (RedisSettings -> Maybe RedisAuthTypeValue -> RedisSettings)
-> Lens
RedisSettings
RedisSettings
(Maybe RedisAuthTypeValue)
(Maybe RedisAuthTypeValue)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedisSettings' {Maybe RedisAuthTypeValue
authType :: Maybe RedisAuthTypeValue
$sel:authType:RedisSettings' :: RedisSettings -> Maybe RedisAuthTypeValue
authType} -> Maybe RedisAuthTypeValue
authType) (\s :: RedisSettings
s@RedisSettings' {} Maybe RedisAuthTypeValue
a -> RedisSettings
s {$sel:authType:RedisSettings' :: Maybe RedisAuthTypeValue
authType = Maybe RedisAuthTypeValue
a} :: RedisSettings)
redisSettings_serverName :: Lens.Lens' RedisSettings Prelude.Text
redisSettings_serverName :: (Text -> f Text) -> RedisSettings -> f RedisSettings
redisSettings_serverName = (RedisSettings -> Text)
-> (RedisSettings -> Text -> RedisSettings)
-> Lens RedisSettings RedisSettings Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedisSettings' {Text
serverName :: Text
$sel:serverName:RedisSettings' :: RedisSettings -> Text
serverName} -> Text
serverName) (\s :: RedisSettings
s@RedisSettings' {} Text
a -> RedisSettings
s {$sel:serverName:RedisSettings' :: Text
serverName = Text
a} :: RedisSettings)
redisSettings_port :: Lens.Lens' RedisSettings Prelude.Int
redisSettings_port :: (Int -> f Int) -> RedisSettings -> f RedisSettings
redisSettings_port = (RedisSettings -> Int)
-> (RedisSettings -> Int -> RedisSettings)
-> Lens RedisSettings RedisSettings Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedisSettings' {Int
port :: Int
$sel:port:RedisSettings' :: RedisSettings -> Int
port} -> Int
port) (\s :: RedisSettings
s@RedisSettings' {} Int
a -> RedisSettings
s {$sel:port:RedisSettings' :: Int
port = Int
a} :: RedisSettings)
instance Core.FromJSON RedisSettings where
parseJSON :: Value -> Parser RedisSettings
parseJSON =
String
-> (Object -> Parser RedisSettings)
-> Value
-> Parser RedisSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RedisSettings"
( \Object
x ->
Maybe SslSecurityProtocolValue
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe RedisAuthTypeValue
-> Text
-> Int
-> RedisSettings
RedisSettings'
(Maybe SslSecurityProtocolValue
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe RedisAuthTypeValue
-> Text
-> Int
-> RedisSettings)
-> Parser (Maybe SslSecurityProtocolValue)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe RedisAuthTypeValue
-> Text
-> Int
-> RedisSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe SslSecurityProtocolValue)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SslSecurityProtocol")
Parser
(Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe RedisAuthTypeValue
-> Text
-> Int
-> RedisSettings)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe (Sensitive Text)
-> Maybe RedisAuthTypeValue
-> Text
-> Int
-> RedisSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AuthUserName")
Parser
(Maybe Text
-> Maybe (Sensitive Text)
-> Maybe RedisAuthTypeValue
-> Text
-> Int
-> RedisSettings)
-> Parser (Maybe Text)
-> Parser
(Maybe (Sensitive Text)
-> Maybe RedisAuthTypeValue -> Text -> Int -> RedisSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SslCaCertificateArn")
Parser
(Maybe (Sensitive Text)
-> Maybe RedisAuthTypeValue -> Text -> Int -> RedisSettings)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe RedisAuthTypeValue -> Text -> Int -> RedisSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AuthPassword")
Parser (Maybe RedisAuthTypeValue -> Text -> Int -> RedisSettings)
-> Parser (Maybe RedisAuthTypeValue)
-> Parser (Text -> Int -> RedisSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RedisAuthTypeValue)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AuthType")
Parser (Text -> Int -> RedisSettings)
-> Parser Text -> Parser (Int -> RedisSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ServerName")
Parser (Int -> RedisSettings) -> Parser Int -> Parser RedisSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Port")
)
instance Prelude.Hashable RedisSettings
instance Prelude.NFData RedisSettings
instance Core.ToJSON RedisSettings where
toJSON :: RedisSettings -> Value
toJSON RedisSettings' {Int
Maybe Text
Maybe (Sensitive Text)
Maybe RedisAuthTypeValue
Maybe SslSecurityProtocolValue
Text
port :: Int
serverName :: Text
authType :: Maybe RedisAuthTypeValue
authPassword :: Maybe (Sensitive Text)
sslCaCertificateArn :: Maybe Text
authUserName :: Maybe Text
sslSecurityProtocol :: Maybe SslSecurityProtocolValue
$sel:port:RedisSettings' :: RedisSettings -> Int
$sel:serverName:RedisSettings' :: RedisSettings -> Text
$sel:authType:RedisSettings' :: RedisSettings -> Maybe RedisAuthTypeValue
$sel:authPassword:RedisSettings' :: RedisSettings -> Maybe (Sensitive Text)
$sel:sslCaCertificateArn:RedisSettings' :: RedisSettings -> Maybe Text
$sel:authUserName:RedisSettings' :: RedisSettings -> Maybe Text
$sel:sslSecurityProtocol:RedisSettings' :: RedisSettings -> Maybe SslSecurityProtocolValue
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SslSecurityProtocol" Text -> SslSecurityProtocolValue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(SslSecurityProtocolValue -> Pair)
-> Maybe SslSecurityProtocolValue -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SslSecurityProtocolValue
sslSecurityProtocol,
(Text
"AuthUserName" 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
authUserName,
(Text
"SslCaCertificateArn" 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
sslCaCertificateArn,
(Text
"AuthPassword" 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)
authPassword,
(Text
"AuthType" Text -> RedisAuthTypeValue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RedisAuthTypeValue -> Pair)
-> Maybe RedisAuthTypeValue -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RedisAuthTypeValue
authType,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServerName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serverName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Port" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
port)
]
)