{-# 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.LookoutMetrics.Types.RDSSourceConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LookoutMetrics.Types.VpcConfiguration
import qualified Amazonka.Prelude as Prelude
data RDSSourceConfig = RDSSourceConfig'
{
RDSSourceConfig -> Text
dbInstanceIdentifier :: Prelude.Text,
RDSSourceConfig -> Text
databaseHost :: Prelude.Text,
RDSSourceConfig -> Natural
databasePort :: Prelude.Natural,
RDSSourceConfig -> Text
secretManagerArn :: Prelude.Text,
RDSSourceConfig -> Text
databaseName :: Prelude.Text,
RDSSourceConfig -> Text
tableName :: Prelude.Text,
RDSSourceConfig -> Text
roleArn :: Prelude.Text,
RDSSourceConfig -> VpcConfiguration
vpcConfiguration :: VpcConfiguration
}
deriving (RDSSourceConfig -> RDSSourceConfig -> Bool
(RDSSourceConfig -> RDSSourceConfig -> Bool)
-> (RDSSourceConfig -> RDSSourceConfig -> Bool)
-> Eq RDSSourceConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RDSSourceConfig -> RDSSourceConfig -> Bool
$c/= :: RDSSourceConfig -> RDSSourceConfig -> Bool
== :: RDSSourceConfig -> RDSSourceConfig -> Bool
$c== :: RDSSourceConfig -> RDSSourceConfig -> Bool
Prelude.Eq, ReadPrec [RDSSourceConfig]
ReadPrec RDSSourceConfig
Int -> ReadS RDSSourceConfig
ReadS [RDSSourceConfig]
(Int -> ReadS RDSSourceConfig)
-> ReadS [RDSSourceConfig]
-> ReadPrec RDSSourceConfig
-> ReadPrec [RDSSourceConfig]
-> Read RDSSourceConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RDSSourceConfig]
$creadListPrec :: ReadPrec [RDSSourceConfig]
readPrec :: ReadPrec RDSSourceConfig
$creadPrec :: ReadPrec RDSSourceConfig
readList :: ReadS [RDSSourceConfig]
$creadList :: ReadS [RDSSourceConfig]
readsPrec :: Int -> ReadS RDSSourceConfig
$creadsPrec :: Int -> ReadS RDSSourceConfig
Prelude.Read, Int -> RDSSourceConfig -> ShowS
[RDSSourceConfig] -> ShowS
RDSSourceConfig -> String
(Int -> RDSSourceConfig -> ShowS)
-> (RDSSourceConfig -> String)
-> ([RDSSourceConfig] -> ShowS)
-> Show RDSSourceConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RDSSourceConfig] -> ShowS
$cshowList :: [RDSSourceConfig] -> ShowS
show :: RDSSourceConfig -> String
$cshow :: RDSSourceConfig -> String
showsPrec :: Int -> RDSSourceConfig -> ShowS
$cshowsPrec :: Int -> RDSSourceConfig -> ShowS
Prelude.Show, (forall x. RDSSourceConfig -> Rep RDSSourceConfig x)
-> (forall x. Rep RDSSourceConfig x -> RDSSourceConfig)
-> Generic RDSSourceConfig
forall x. Rep RDSSourceConfig x -> RDSSourceConfig
forall x. RDSSourceConfig -> Rep RDSSourceConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RDSSourceConfig x -> RDSSourceConfig
$cfrom :: forall x. RDSSourceConfig -> Rep RDSSourceConfig x
Prelude.Generic)
newRDSSourceConfig ::
Prelude.Text ->
Prelude.Text ->
Prelude.Natural ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
VpcConfiguration ->
RDSSourceConfig
newRDSSourceConfig :: Text
-> Text
-> Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RDSSourceConfig
newRDSSourceConfig
Text
pDBInstanceIdentifier_
Text
pDatabaseHost_
Natural
pDatabasePort_
Text
pSecretManagerArn_
Text
pDatabaseName_
Text
pTableName_
Text
pRoleArn_
VpcConfiguration
pVpcConfiguration_ =
RDSSourceConfig' :: Text
-> Text
-> Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RDSSourceConfig
RDSSourceConfig'
{ $sel:dbInstanceIdentifier:RDSSourceConfig' :: Text
dbInstanceIdentifier =
Text
pDBInstanceIdentifier_,
$sel:databaseHost:RDSSourceConfig' :: Text
databaseHost = Text
pDatabaseHost_,
$sel:databasePort:RDSSourceConfig' :: Natural
databasePort = Natural
pDatabasePort_,
$sel:secretManagerArn:RDSSourceConfig' :: Text
secretManagerArn = Text
pSecretManagerArn_,
$sel:databaseName:RDSSourceConfig' :: Text
databaseName = Text
pDatabaseName_,
$sel:tableName:RDSSourceConfig' :: Text
tableName = Text
pTableName_,
$sel:roleArn:RDSSourceConfig' :: Text
roleArn = Text
pRoleArn_,
$sel:vpcConfiguration:RDSSourceConfig' :: VpcConfiguration
vpcConfiguration = VpcConfiguration
pVpcConfiguration_
}
rDSSourceConfig_dbInstanceIdentifier :: Lens.Lens' RDSSourceConfig Prelude.Text
rDSSourceConfig_dbInstanceIdentifier :: (Text -> f Text) -> RDSSourceConfig -> f RDSSourceConfig
rDSSourceConfig_dbInstanceIdentifier = (RDSSourceConfig -> Text)
-> (RDSSourceConfig -> Text -> RDSSourceConfig)
-> Lens RDSSourceConfig RDSSourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RDSSourceConfig' {Text
dbInstanceIdentifier :: Text
$sel:dbInstanceIdentifier:RDSSourceConfig' :: RDSSourceConfig -> Text
dbInstanceIdentifier} -> Text
dbInstanceIdentifier) (\s :: RDSSourceConfig
s@RDSSourceConfig' {} Text
a -> RDSSourceConfig
s {$sel:dbInstanceIdentifier:RDSSourceConfig' :: Text
dbInstanceIdentifier = Text
a} :: RDSSourceConfig)
rDSSourceConfig_databaseHost :: Lens.Lens' RDSSourceConfig Prelude.Text
rDSSourceConfig_databaseHost :: (Text -> f Text) -> RDSSourceConfig -> f RDSSourceConfig
rDSSourceConfig_databaseHost = (RDSSourceConfig -> Text)
-> (RDSSourceConfig -> Text -> RDSSourceConfig)
-> Lens RDSSourceConfig RDSSourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RDSSourceConfig' {Text
databaseHost :: Text
$sel:databaseHost:RDSSourceConfig' :: RDSSourceConfig -> Text
databaseHost} -> Text
databaseHost) (\s :: RDSSourceConfig
s@RDSSourceConfig' {} Text
a -> RDSSourceConfig
s {$sel:databaseHost:RDSSourceConfig' :: Text
databaseHost = Text
a} :: RDSSourceConfig)
rDSSourceConfig_databasePort :: Lens.Lens' RDSSourceConfig Prelude.Natural
rDSSourceConfig_databasePort :: (Natural -> f Natural) -> RDSSourceConfig -> f RDSSourceConfig
rDSSourceConfig_databasePort = (RDSSourceConfig -> Natural)
-> (RDSSourceConfig -> Natural -> RDSSourceConfig)
-> Lens RDSSourceConfig RDSSourceConfig Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RDSSourceConfig' {Natural
databasePort :: Natural
$sel:databasePort:RDSSourceConfig' :: RDSSourceConfig -> Natural
databasePort} -> Natural
databasePort) (\s :: RDSSourceConfig
s@RDSSourceConfig' {} Natural
a -> RDSSourceConfig
s {$sel:databasePort:RDSSourceConfig' :: Natural
databasePort = Natural
a} :: RDSSourceConfig)
rDSSourceConfig_secretManagerArn :: Lens.Lens' RDSSourceConfig Prelude.Text
rDSSourceConfig_secretManagerArn :: (Text -> f Text) -> RDSSourceConfig -> f RDSSourceConfig
rDSSourceConfig_secretManagerArn = (RDSSourceConfig -> Text)
-> (RDSSourceConfig -> Text -> RDSSourceConfig)
-> Lens RDSSourceConfig RDSSourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RDSSourceConfig' {Text
secretManagerArn :: Text
$sel:secretManagerArn:RDSSourceConfig' :: RDSSourceConfig -> Text
secretManagerArn} -> Text
secretManagerArn) (\s :: RDSSourceConfig
s@RDSSourceConfig' {} Text
a -> RDSSourceConfig
s {$sel:secretManagerArn:RDSSourceConfig' :: Text
secretManagerArn = Text
a} :: RDSSourceConfig)
rDSSourceConfig_databaseName :: Lens.Lens' RDSSourceConfig Prelude.Text
rDSSourceConfig_databaseName :: (Text -> f Text) -> RDSSourceConfig -> f RDSSourceConfig
rDSSourceConfig_databaseName = (RDSSourceConfig -> Text)
-> (RDSSourceConfig -> Text -> RDSSourceConfig)
-> Lens RDSSourceConfig RDSSourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RDSSourceConfig' {Text
databaseName :: Text
$sel:databaseName:RDSSourceConfig' :: RDSSourceConfig -> Text
databaseName} -> Text
databaseName) (\s :: RDSSourceConfig
s@RDSSourceConfig' {} Text
a -> RDSSourceConfig
s {$sel:databaseName:RDSSourceConfig' :: Text
databaseName = Text
a} :: RDSSourceConfig)
rDSSourceConfig_tableName :: Lens.Lens' RDSSourceConfig Prelude.Text
rDSSourceConfig_tableName :: (Text -> f Text) -> RDSSourceConfig -> f RDSSourceConfig
rDSSourceConfig_tableName = (RDSSourceConfig -> Text)
-> (RDSSourceConfig -> Text -> RDSSourceConfig)
-> Lens RDSSourceConfig RDSSourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RDSSourceConfig' {Text
tableName :: Text
$sel:tableName:RDSSourceConfig' :: RDSSourceConfig -> Text
tableName} -> Text
tableName) (\s :: RDSSourceConfig
s@RDSSourceConfig' {} Text
a -> RDSSourceConfig
s {$sel:tableName:RDSSourceConfig' :: Text
tableName = Text
a} :: RDSSourceConfig)
rDSSourceConfig_roleArn :: Lens.Lens' RDSSourceConfig Prelude.Text
rDSSourceConfig_roleArn :: (Text -> f Text) -> RDSSourceConfig -> f RDSSourceConfig
rDSSourceConfig_roleArn = (RDSSourceConfig -> Text)
-> (RDSSourceConfig -> Text -> RDSSourceConfig)
-> Lens RDSSourceConfig RDSSourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RDSSourceConfig' {Text
roleArn :: Text
$sel:roleArn:RDSSourceConfig' :: RDSSourceConfig -> Text
roleArn} -> Text
roleArn) (\s :: RDSSourceConfig
s@RDSSourceConfig' {} Text
a -> RDSSourceConfig
s {$sel:roleArn:RDSSourceConfig' :: Text
roleArn = Text
a} :: RDSSourceConfig)
rDSSourceConfig_vpcConfiguration :: Lens.Lens' RDSSourceConfig VpcConfiguration
rDSSourceConfig_vpcConfiguration :: (VpcConfiguration -> f VpcConfiguration)
-> RDSSourceConfig -> f RDSSourceConfig
rDSSourceConfig_vpcConfiguration = (RDSSourceConfig -> VpcConfiguration)
-> (RDSSourceConfig -> VpcConfiguration -> RDSSourceConfig)
-> Lens
RDSSourceConfig RDSSourceConfig VpcConfiguration VpcConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RDSSourceConfig' {VpcConfiguration
vpcConfiguration :: VpcConfiguration
$sel:vpcConfiguration:RDSSourceConfig' :: RDSSourceConfig -> VpcConfiguration
vpcConfiguration} -> VpcConfiguration
vpcConfiguration) (\s :: RDSSourceConfig
s@RDSSourceConfig' {} VpcConfiguration
a -> RDSSourceConfig
s {$sel:vpcConfiguration:RDSSourceConfig' :: VpcConfiguration
vpcConfiguration = VpcConfiguration
a} :: RDSSourceConfig)
instance Core.FromJSON RDSSourceConfig where
parseJSON :: Value -> Parser RDSSourceConfig
parseJSON =
String
-> (Object -> Parser RDSSourceConfig)
-> Value
-> Parser RDSSourceConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RDSSourceConfig"
( \Object
x ->
Text
-> Text
-> Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RDSSourceConfig
RDSSourceConfig'
(Text
-> Text
-> Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RDSSourceConfig)
-> Parser Text
-> Parser
(Text
-> Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RDSSourceConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DBInstanceIdentifier")
Parser
(Text
-> Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RDSSourceConfig)
-> Parser Text
-> Parser
(Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RDSSourceConfig)
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
"DatabaseHost")
Parser
(Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RDSSourceConfig)
-> Parser Natural
-> Parser
(Text
-> Text -> Text -> Text -> VpcConfiguration -> RDSSourceConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DatabasePort")
Parser
(Text
-> Text -> Text -> Text -> VpcConfiguration -> RDSSourceConfig)
-> Parser Text
-> Parser
(Text -> Text -> Text -> VpcConfiguration -> RDSSourceConfig)
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
"SecretManagerArn")
Parser
(Text -> Text -> Text -> VpcConfiguration -> RDSSourceConfig)
-> Parser Text
-> Parser (Text -> Text -> VpcConfiguration -> RDSSourceConfig)
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
"DatabaseName")
Parser (Text -> Text -> VpcConfiguration -> RDSSourceConfig)
-> Parser Text
-> Parser (Text -> VpcConfiguration -> RDSSourceConfig)
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
"TableName")
Parser (Text -> VpcConfiguration -> RDSSourceConfig)
-> Parser Text -> Parser (VpcConfiguration -> RDSSourceConfig)
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
"RoleArn")
Parser (VpcConfiguration -> RDSSourceConfig)
-> Parser VpcConfiguration -> Parser RDSSourceConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser VpcConfiguration
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"VpcConfiguration")
)
instance Prelude.Hashable RDSSourceConfig
instance Prelude.NFData RDSSourceConfig
instance Core.ToJSON RDSSourceConfig where
toJSON :: RDSSourceConfig -> Value
toJSON RDSSourceConfig' {Natural
Text
VpcConfiguration
vpcConfiguration :: VpcConfiguration
roleArn :: Text
tableName :: Text
databaseName :: Text
secretManagerArn :: Text
databasePort :: Natural
databaseHost :: Text
dbInstanceIdentifier :: Text
$sel:vpcConfiguration:RDSSourceConfig' :: RDSSourceConfig -> VpcConfiguration
$sel:roleArn:RDSSourceConfig' :: RDSSourceConfig -> Text
$sel:tableName:RDSSourceConfig' :: RDSSourceConfig -> Text
$sel:databaseName:RDSSourceConfig' :: RDSSourceConfig -> Text
$sel:secretManagerArn:RDSSourceConfig' :: RDSSourceConfig -> Text
$sel:databasePort:RDSSourceConfig' :: RDSSourceConfig -> Natural
$sel:databaseHost:RDSSourceConfig' :: RDSSourceConfig -> Text
$sel:dbInstanceIdentifier:RDSSourceConfig' :: RDSSourceConfig -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"DBInstanceIdentifier"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dbInstanceIdentifier
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DatabaseHost" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
databaseHost),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DatabasePort" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
databasePort),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"SecretManagerArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
secretManagerArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DatabaseName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
databaseName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TableName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
tableName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"VpcConfiguration" Text -> VpcConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= VpcConfiguration
vpcConfiguration)
]
)