{-# 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.SybaseSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SybaseSettings = SybaseSettings'
{
SybaseSettings -> Maybe Text
serverName :: Prelude.Maybe Prelude.Text,
SybaseSettings -> Maybe Text
secretsManagerAccessRoleArn :: Prelude.Maybe Prelude.Text,
SybaseSettings -> Maybe Text
username :: Prelude.Maybe Prelude.Text,
SybaseSettings -> Maybe (Sensitive Text)
password :: Prelude.Maybe (Core.Sensitive Prelude.Text),
SybaseSettings -> Maybe Text
databaseName :: Prelude.Maybe Prelude.Text,
SybaseSettings -> Maybe Text
secretsManagerSecretId :: Prelude.Maybe Prelude.Text,
SybaseSettings -> Maybe Int
port :: Prelude.Maybe Prelude.Int
}
deriving (SybaseSettings -> SybaseSettings -> Bool
(SybaseSettings -> SybaseSettings -> Bool)
-> (SybaseSettings -> SybaseSettings -> Bool) -> Eq SybaseSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SybaseSettings -> SybaseSettings -> Bool
$c/= :: SybaseSettings -> SybaseSettings -> Bool
== :: SybaseSettings -> SybaseSettings -> Bool
$c== :: SybaseSettings -> SybaseSettings -> Bool
Prelude.Eq, Int -> SybaseSettings -> ShowS
[SybaseSettings] -> ShowS
SybaseSettings -> String
(Int -> SybaseSettings -> ShowS)
-> (SybaseSettings -> String)
-> ([SybaseSettings] -> ShowS)
-> Show SybaseSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SybaseSettings] -> ShowS
$cshowList :: [SybaseSettings] -> ShowS
show :: SybaseSettings -> String
$cshow :: SybaseSettings -> String
showsPrec :: Int -> SybaseSettings -> ShowS
$cshowsPrec :: Int -> SybaseSettings -> ShowS
Prelude.Show, (forall x. SybaseSettings -> Rep SybaseSettings x)
-> (forall x. Rep SybaseSettings x -> SybaseSettings)
-> Generic SybaseSettings
forall x. Rep SybaseSettings x -> SybaseSettings
forall x. SybaseSettings -> Rep SybaseSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SybaseSettings x -> SybaseSettings
$cfrom :: forall x. SybaseSettings -> Rep SybaseSettings x
Prelude.Generic)
newSybaseSettings ::
SybaseSettings
newSybaseSettings :: SybaseSettings
newSybaseSettings =
SybaseSettings' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> SybaseSettings
SybaseSettings'
{ $sel:serverName:SybaseSettings' :: Maybe Text
serverName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:secretsManagerAccessRoleArn:SybaseSettings' :: Maybe Text
secretsManagerAccessRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:username:SybaseSettings' :: Maybe Text
username = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:password:SybaseSettings' :: Maybe (Sensitive Text)
password = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:databaseName:SybaseSettings' :: Maybe Text
databaseName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:secretsManagerSecretId:SybaseSettings' :: Maybe Text
secretsManagerSecretId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:port:SybaseSettings' :: Maybe Int
port = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
sybaseSettings_serverName :: Lens.Lens' SybaseSettings (Prelude.Maybe Prelude.Text)
sybaseSettings_serverName :: (Maybe Text -> f (Maybe Text))
-> SybaseSettings -> f SybaseSettings
sybaseSettings_serverName = (SybaseSettings -> Maybe Text)
-> (SybaseSettings -> Maybe Text -> SybaseSettings)
-> Lens SybaseSettings SybaseSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SybaseSettings' {Maybe Text
serverName :: Maybe Text
$sel:serverName:SybaseSettings' :: SybaseSettings -> Maybe Text
serverName} -> Maybe Text
serverName) (\s :: SybaseSettings
s@SybaseSettings' {} Maybe Text
a -> SybaseSettings
s {$sel:serverName:SybaseSettings' :: Maybe Text
serverName = Maybe Text
a} :: SybaseSettings)
sybaseSettings_secretsManagerAccessRoleArn :: Lens.Lens' SybaseSettings (Prelude.Maybe Prelude.Text)
sybaseSettings_secretsManagerAccessRoleArn :: (Maybe Text -> f (Maybe Text))
-> SybaseSettings -> f SybaseSettings
sybaseSettings_secretsManagerAccessRoleArn = (SybaseSettings -> Maybe Text)
-> (SybaseSettings -> Maybe Text -> SybaseSettings)
-> Lens SybaseSettings SybaseSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SybaseSettings' {Maybe Text
secretsManagerAccessRoleArn :: Maybe Text
$sel:secretsManagerAccessRoleArn:SybaseSettings' :: SybaseSettings -> Maybe Text
secretsManagerAccessRoleArn} -> Maybe Text
secretsManagerAccessRoleArn) (\s :: SybaseSettings
s@SybaseSettings' {} Maybe Text
a -> SybaseSettings
s {$sel:secretsManagerAccessRoleArn:SybaseSettings' :: Maybe Text
secretsManagerAccessRoleArn = Maybe Text
a} :: SybaseSettings)
sybaseSettings_username :: Lens.Lens' SybaseSettings (Prelude.Maybe Prelude.Text)
sybaseSettings_username :: (Maybe Text -> f (Maybe Text))
-> SybaseSettings -> f SybaseSettings
sybaseSettings_username = (SybaseSettings -> Maybe Text)
-> (SybaseSettings -> Maybe Text -> SybaseSettings)
-> Lens SybaseSettings SybaseSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SybaseSettings' {Maybe Text
username :: Maybe Text
$sel:username:SybaseSettings' :: SybaseSettings -> Maybe Text
username} -> Maybe Text
username) (\s :: SybaseSettings
s@SybaseSettings' {} Maybe Text
a -> SybaseSettings
s {$sel:username:SybaseSettings' :: Maybe Text
username = Maybe Text
a} :: SybaseSettings)
sybaseSettings_password :: Lens.Lens' SybaseSettings (Prelude.Maybe Prelude.Text)
sybaseSettings_password :: (Maybe Text -> f (Maybe Text))
-> SybaseSettings -> f SybaseSettings
sybaseSettings_password = (SybaseSettings -> Maybe (Sensitive Text))
-> (SybaseSettings -> Maybe (Sensitive Text) -> SybaseSettings)
-> Lens
SybaseSettings
SybaseSettings
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SybaseSettings' {Maybe (Sensitive Text)
password :: Maybe (Sensitive Text)
$sel:password:SybaseSettings' :: SybaseSettings -> Maybe (Sensitive Text)
password} -> Maybe (Sensitive Text)
password) (\s :: SybaseSettings
s@SybaseSettings' {} Maybe (Sensitive Text)
a -> SybaseSettings
s {$sel:password:SybaseSettings' :: Maybe (Sensitive Text)
password = Maybe (Sensitive Text)
a} :: SybaseSettings) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> SybaseSettings -> f SybaseSettings)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> SybaseSettings
-> f SybaseSettings
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
sybaseSettings_databaseName :: Lens.Lens' SybaseSettings (Prelude.Maybe Prelude.Text)
sybaseSettings_databaseName :: (Maybe Text -> f (Maybe Text))
-> SybaseSettings -> f SybaseSettings
sybaseSettings_databaseName = (SybaseSettings -> Maybe Text)
-> (SybaseSettings -> Maybe Text -> SybaseSettings)
-> Lens SybaseSettings SybaseSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SybaseSettings' {Maybe Text
databaseName :: Maybe Text
$sel:databaseName:SybaseSettings' :: SybaseSettings -> Maybe Text
databaseName} -> Maybe Text
databaseName) (\s :: SybaseSettings
s@SybaseSettings' {} Maybe Text
a -> SybaseSettings
s {$sel:databaseName:SybaseSettings' :: Maybe Text
databaseName = Maybe Text
a} :: SybaseSettings)
sybaseSettings_secretsManagerSecretId :: Lens.Lens' SybaseSettings (Prelude.Maybe Prelude.Text)
sybaseSettings_secretsManagerSecretId :: (Maybe Text -> f (Maybe Text))
-> SybaseSettings -> f SybaseSettings
sybaseSettings_secretsManagerSecretId = (SybaseSettings -> Maybe Text)
-> (SybaseSettings -> Maybe Text -> SybaseSettings)
-> Lens SybaseSettings SybaseSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SybaseSettings' {Maybe Text
secretsManagerSecretId :: Maybe Text
$sel:secretsManagerSecretId:SybaseSettings' :: SybaseSettings -> Maybe Text
secretsManagerSecretId} -> Maybe Text
secretsManagerSecretId) (\s :: SybaseSettings
s@SybaseSettings' {} Maybe Text
a -> SybaseSettings
s {$sel:secretsManagerSecretId:SybaseSettings' :: Maybe Text
secretsManagerSecretId = Maybe Text
a} :: SybaseSettings)
sybaseSettings_port :: Lens.Lens' SybaseSettings (Prelude.Maybe Prelude.Int)
sybaseSettings_port :: (Maybe Int -> f (Maybe Int)) -> SybaseSettings -> f SybaseSettings
sybaseSettings_port = (SybaseSettings -> Maybe Int)
-> (SybaseSettings -> Maybe Int -> SybaseSettings)
-> Lens SybaseSettings SybaseSettings (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SybaseSettings' {Maybe Int
port :: Maybe Int
$sel:port:SybaseSettings' :: SybaseSettings -> Maybe Int
port} -> Maybe Int
port) (\s :: SybaseSettings
s@SybaseSettings' {} Maybe Int
a -> SybaseSettings
s {$sel:port:SybaseSettings' :: Maybe Int
port = Maybe Int
a} :: SybaseSettings)
instance Core.FromJSON SybaseSettings where
parseJSON :: Value -> Parser SybaseSettings
parseJSON =
String
-> (Object -> Parser SybaseSettings)
-> Value
-> Parser SybaseSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SybaseSettings"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> SybaseSettings
SybaseSettings'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> SybaseSettings)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> SybaseSettings)
forall (f :: * -> *) a b. Functor 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
"ServerName")
Parser
(Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> SybaseSettings)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> SybaseSettings)
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
"SecretsManagerAccessRoleArn")
Parser
(Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> SybaseSettings)
-> Parser (Maybe Text)
-> Parser
(Maybe (Sensitive Text)
-> Maybe Text -> Maybe Text -> Maybe Int -> SybaseSettings)
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
"Username")
Parser
(Maybe (Sensitive Text)
-> Maybe Text -> Maybe Text -> Maybe Int -> SybaseSettings)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Text -> Maybe Text -> Maybe Int -> SybaseSettings)
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
"Password")
Parser (Maybe Text -> Maybe Text -> Maybe Int -> SybaseSettings)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Int -> SybaseSettings)
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
"DatabaseName")
Parser (Maybe Text -> Maybe Int -> SybaseSettings)
-> Parser (Maybe Text) -> Parser (Maybe Int -> SybaseSettings)
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
"SecretsManagerSecretId")
Parser (Maybe Int -> SybaseSettings)
-> Parser (Maybe Int) -> Parser SybaseSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Port")
)
instance Prelude.Hashable SybaseSettings
instance Prelude.NFData SybaseSettings
instance Core.ToJSON SybaseSettings where
toJSON :: SybaseSettings -> Value
toJSON SybaseSettings' {Maybe Int
Maybe Text
Maybe (Sensitive Text)
port :: Maybe Int
secretsManagerSecretId :: Maybe Text
databaseName :: Maybe Text
password :: Maybe (Sensitive Text)
username :: Maybe Text
secretsManagerAccessRoleArn :: Maybe Text
serverName :: Maybe Text
$sel:port:SybaseSettings' :: SybaseSettings -> Maybe Int
$sel:secretsManagerSecretId:SybaseSettings' :: SybaseSettings -> Maybe Text
$sel:databaseName:SybaseSettings' :: SybaseSettings -> Maybe Text
$sel:password:SybaseSettings' :: SybaseSettings -> Maybe (Sensitive Text)
$sel:username:SybaseSettings' :: SybaseSettings -> Maybe Text
$sel:secretsManagerAccessRoleArn:SybaseSettings' :: SybaseSettings -> Maybe Text
$sel:serverName:SybaseSettings' :: SybaseSettings -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ServerName" 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
serverName,
(Text
"SecretsManagerAccessRoleArn" 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
secretsManagerAccessRoleArn,
(Text
"Username" 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
username,
(Text
"Password" 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)
password,
(Text
"DatabaseName" 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
databaseName,
(Text
"SecretsManagerSecretId" 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
secretsManagerSecretId,
(Text
"Port" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
port
]
)