{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.DMS.Types.RedisAuthTypeValue
import Amazonka.DMS.Types.SslSecurityProtocolValue
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data RedisSettings = RedisSettings'
{
RedisSettings -> Maybe (Sensitive Text)
authPassword :: Prelude.Maybe (Data.Sensitive Prelude.Text),
RedisSettings -> Maybe RedisAuthTypeValue
authType :: Prelude.Maybe RedisAuthTypeValue,
RedisSettings -> Maybe Text
authUserName :: Prelude.Maybe Prelude.Text,
RedisSettings -> Maybe Text
sslCaCertificateArn :: Prelude.Maybe Prelude.Text,
RedisSettings -> Maybe SslSecurityProtocolValue
sslSecurityProtocol :: Prelude.Maybe SslSecurityProtocolValue,
RedisSettings -> Text
serverName :: Prelude.Text,
RedisSettings -> Int
port :: Prelude.Int
}
deriving (RedisSettings -> RedisSettings -> Bool
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
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. 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'
{ $sel:authPassword:RedisSettings' :: Maybe (Sensitive Text)
authPassword = forall a. Maybe a
Prelude.Nothing,
$sel:authType:RedisSettings' :: Maybe RedisAuthTypeValue
authType = forall a. Maybe a
Prelude.Nothing,
$sel:authUserName:RedisSettings' :: Maybe Text
authUserName = forall a. Maybe a
Prelude.Nothing,
$sel:sslCaCertificateArn:RedisSettings' :: Maybe Text
sslCaCertificateArn = forall a. Maybe a
Prelude.Nothing,
$sel:sslSecurityProtocol:RedisSettings' :: Maybe SslSecurityProtocolValue
sslSecurityProtocol = forall a. Maybe a
Prelude.Nothing,
$sel:serverName:RedisSettings' :: Text
serverName = Text
pServerName_,
$sel:port:RedisSettings' :: Int
port = Int
pPort_
}
redisSettings_authPassword :: Lens.Lens' RedisSettings (Prelude.Maybe Prelude.Text)
redisSettings_authPassword :: Lens' RedisSettings (Maybe Text)
redisSettings_authPassword = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
redisSettings_authType :: Lens.Lens' RedisSettings (Prelude.Maybe RedisAuthTypeValue)
redisSettings_authType :: Lens' RedisSettings (Maybe RedisAuthTypeValue)
redisSettings_authType = 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_authUserName :: Lens.Lens' RedisSettings (Prelude.Maybe Prelude.Text)
redisSettings_authUserName :: Lens' RedisSettings (Maybe Text)
redisSettings_authUserName = 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 :: Lens' RedisSettings (Maybe Text)
redisSettings_sslCaCertificateArn = 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_sslSecurityProtocol :: Lens.Lens' RedisSettings (Prelude.Maybe SslSecurityProtocolValue)
redisSettings_sslSecurityProtocol :: Lens' RedisSettings (Maybe SslSecurityProtocolValue)
redisSettings_sslSecurityProtocol = 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_serverName :: Lens.Lens' RedisSettings Prelude.Text
redisSettings_serverName :: Lens' RedisSettings Text
redisSettings_serverName = 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 :: Lens' RedisSettings Int
redisSettings_port = 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 Data.FromJSON RedisSettings where
parseJSON :: Value -> Parser RedisSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RedisSettings"
( \Object
x ->
Maybe (Sensitive Text)
-> Maybe RedisAuthTypeValue
-> Maybe Text
-> Maybe Text
-> Maybe SslSecurityProtocolValue
-> Text
-> Int
-> RedisSettings
RedisSettings'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AuthPassword")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AuthType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AuthUserName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SslCaCertificateArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SslSecurityProtocol")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ServerName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Port")
)
instance Prelude.Hashable RedisSettings where
hashWithSalt :: Int -> RedisSettings -> Int
hashWithSalt Int
_salt RedisSettings' {Int
Maybe Text
Maybe (Sensitive Text)
Maybe RedisAuthTypeValue
Maybe SslSecurityProtocolValue
Text
port :: Int
serverName :: Text
sslSecurityProtocol :: Maybe SslSecurityProtocolValue
sslCaCertificateArn :: Maybe Text
authUserName :: Maybe Text
authType :: Maybe RedisAuthTypeValue
authPassword :: Maybe (Sensitive Text)
$sel:port:RedisSettings' :: RedisSettings -> Int
$sel:serverName:RedisSettings' :: RedisSettings -> Text
$sel:sslSecurityProtocol:RedisSettings' :: RedisSettings -> Maybe SslSecurityProtocolValue
$sel:sslCaCertificateArn:RedisSettings' :: RedisSettings -> Maybe Text
$sel:authUserName:RedisSettings' :: RedisSettings -> Maybe Text
$sel:authType:RedisSettings' :: RedisSettings -> Maybe RedisAuthTypeValue
$sel:authPassword:RedisSettings' :: RedisSettings -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
authPassword
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RedisAuthTypeValue
authType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authUserName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sslCaCertificateArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SslSecurityProtocolValue
sslSecurityProtocol
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serverName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
port
instance Prelude.NFData RedisSettings where
rnf :: RedisSettings -> ()
rnf RedisSettings' {Int
Maybe Text
Maybe (Sensitive Text)
Maybe RedisAuthTypeValue
Maybe SslSecurityProtocolValue
Text
port :: Int
serverName :: Text
sslSecurityProtocol :: Maybe SslSecurityProtocolValue
sslCaCertificateArn :: Maybe Text
authUserName :: Maybe Text
authType :: Maybe RedisAuthTypeValue
authPassword :: Maybe (Sensitive Text)
$sel:port:RedisSettings' :: RedisSettings -> Int
$sel:serverName:RedisSettings' :: RedisSettings -> Text
$sel:sslSecurityProtocol:RedisSettings' :: RedisSettings -> Maybe SslSecurityProtocolValue
$sel:sslCaCertificateArn:RedisSettings' :: RedisSettings -> Maybe Text
$sel:authUserName:RedisSettings' :: RedisSettings -> Maybe Text
$sel:authType:RedisSettings' :: RedisSettings -> Maybe RedisAuthTypeValue
$sel:authPassword:RedisSettings' :: RedisSettings -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
authPassword
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RedisAuthTypeValue
authType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authUserName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sslCaCertificateArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SslSecurityProtocolValue
sslSecurityProtocol
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serverName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
port
instance Data.ToJSON RedisSettings where
toJSON :: RedisSettings -> Value
toJSON RedisSettings' {Int
Maybe Text
Maybe (Sensitive Text)
Maybe RedisAuthTypeValue
Maybe SslSecurityProtocolValue
Text
port :: Int
serverName :: Text
sslSecurityProtocol :: Maybe SslSecurityProtocolValue
sslCaCertificateArn :: Maybe Text
authUserName :: Maybe Text
authType :: Maybe RedisAuthTypeValue
authPassword :: Maybe (Sensitive Text)
$sel:port:RedisSettings' :: RedisSettings -> Int
$sel:serverName:RedisSettings' :: RedisSettings -> Text
$sel:sslSecurityProtocol:RedisSettings' :: RedisSettings -> Maybe SslSecurityProtocolValue
$sel:sslCaCertificateArn:RedisSettings' :: RedisSettings -> Maybe Text
$sel:authUserName:RedisSettings' :: RedisSettings -> Maybe Text
$sel:authType:RedisSettings' :: RedisSettings -> Maybe RedisAuthTypeValue
$sel:authPassword:RedisSettings' :: RedisSettings -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AuthPassword" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
authPassword,
(Key
"AuthType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RedisAuthTypeValue
authType,
(Key
"AuthUserName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
authUserName,
(Key
"SslCaCertificateArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sslCaCertificateArn,
(Key
"SslSecurityProtocol" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SslSecurityProtocolValue
sslSecurityProtocol,
forall a. a -> Maybe a
Prelude.Just (Key
"ServerName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serverName),
forall a. a -> Maybe a
Prelude.Just (Key
"Port" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
port)
]
)