{-# 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.RedshiftSourceConfig 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 RedshiftSourceConfig = RedshiftSourceConfig'
{
RedshiftSourceConfig -> Text
clusterIdentifier :: Prelude.Text,
RedshiftSourceConfig -> Text
databaseHost :: Prelude.Text,
RedshiftSourceConfig -> Natural
databasePort :: Prelude.Natural,
RedshiftSourceConfig -> Text
secretManagerArn :: Prelude.Text,
RedshiftSourceConfig -> Text
databaseName :: Prelude.Text,
RedshiftSourceConfig -> Text
tableName :: Prelude.Text,
RedshiftSourceConfig -> Text
roleArn :: Prelude.Text,
RedshiftSourceConfig -> VpcConfiguration
vpcConfiguration :: VpcConfiguration
}
deriving (RedshiftSourceConfig -> RedshiftSourceConfig -> Bool
(RedshiftSourceConfig -> RedshiftSourceConfig -> Bool)
-> (RedshiftSourceConfig -> RedshiftSourceConfig -> Bool)
-> Eq RedshiftSourceConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedshiftSourceConfig -> RedshiftSourceConfig -> Bool
$c/= :: RedshiftSourceConfig -> RedshiftSourceConfig -> Bool
== :: RedshiftSourceConfig -> RedshiftSourceConfig -> Bool
$c== :: RedshiftSourceConfig -> RedshiftSourceConfig -> Bool
Prelude.Eq, ReadPrec [RedshiftSourceConfig]
ReadPrec RedshiftSourceConfig
Int -> ReadS RedshiftSourceConfig
ReadS [RedshiftSourceConfig]
(Int -> ReadS RedshiftSourceConfig)
-> ReadS [RedshiftSourceConfig]
-> ReadPrec RedshiftSourceConfig
-> ReadPrec [RedshiftSourceConfig]
-> Read RedshiftSourceConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RedshiftSourceConfig]
$creadListPrec :: ReadPrec [RedshiftSourceConfig]
readPrec :: ReadPrec RedshiftSourceConfig
$creadPrec :: ReadPrec RedshiftSourceConfig
readList :: ReadS [RedshiftSourceConfig]
$creadList :: ReadS [RedshiftSourceConfig]
readsPrec :: Int -> ReadS RedshiftSourceConfig
$creadsPrec :: Int -> ReadS RedshiftSourceConfig
Prelude.Read, Int -> RedshiftSourceConfig -> ShowS
[RedshiftSourceConfig] -> ShowS
RedshiftSourceConfig -> String
(Int -> RedshiftSourceConfig -> ShowS)
-> (RedshiftSourceConfig -> String)
-> ([RedshiftSourceConfig] -> ShowS)
-> Show RedshiftSourceConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedshiftSourceConfig] -> ShowS
$cshowList :: [RedshiftSourceConfig] -> ShowS
show :: RedshiftSourceConfig -> String
$cshow :: RedshiftSourceConfig -> String
showsPrec :: Int -> RedshiftSourceConfig -> ShowS
$cshowsPrec :: Int -> RedshiftSourceConfig -> ShowS
Prelude.Show, (forall x. RedshiftSourceConfig -> Rep RedshiftSourceConfig x)
-> (forall x. Rep RedshiftSourceConfig x -> RedshiftSourceConfig)
-> Generic RedshiftSourceConfig
forall x. Rep RedshiftSourceConfig x -> RedshiftSourceConfig
forall x. RedshiftSourceConfig -> Rep RedshiftSourceConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RedshiftSourceConfig x -> RedshiftSourceConfig
$cfrom :: forall x. RedshiftSourceConfig -> Rep RedshiftSourceConfig x
Prelude.Generic)
newRedshiftSourceConfig ::
Prelude.Text ->
Prelude.Text ->
Prelude.Natural ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
VpcConfiguration ->
RedshiftSourceConfig
newRedshiftSourceConfig :: Text
-> Text
-> Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RedshiftSourceConfig
newRedshiftSourceConfig
Text
pClusterIdentifier_
Text
pDatabaseHost_
Natural
pDatabasePort_
Text
pSecretManagerArn_
Text
pDatabaseName_
Text
pTableName_
Text
pRoleArn_
VpcConfiguration
pVpcConfiguration_ =
RedshiftSourceConfig' :: Text
-> Text
-> Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RedshiftSourceConfig
RedshiftSourceConfig'
{ $sel:clusterIdentifier:RedshiftSourceConfig' :: Text
clusterIdentifier =
Text
pClusterIdentifier_,
$sel:databaseHost:RedshiftSourceConfig' :: Text
databaseHost = Text
pDatabaseHost_,
$sel:databasePort:RedshiftSourceConfig' :: Natural
databasePort = Natural
pDatabasePort_,
$sel:secretManagerArn:RedshiftSourceConfig' :: Text
secretManagerArn = Text
pSecretManagerArn_,
$sel:databaseName:RedshiftSourceConfig' :: Text
databaseName = Text
pDatabaseName_,
$sel:tableName:RedshiftSourceConfig' :: Text
tableName = Text
pTableName_,
$sel:roleArn:RedshiftSourceConfig' :: Text
roleArn = Text
pRoleArn_,
$sel:vpcConfiguration:RedshiftSourceConfig' :: VpcConfiguration
vpcConfiguration = VpcConfiguration
pVpcConfiguration_
}
redshiftSourceConfig_clusterIdentifier :: Lens.Lens' RedshiftSourceConfig Prelude.Text
redshiftSourceConfig_clusterIdentifier :: (Text -> f Text) -> RedshiftSourceConfig -> f RedshiftSourceConfig
redshiftSourceConfig_clusterIdentifier = (RedshiftSourceConfig -> Text)
-> (RedshiftSourceConfig -> Text -> RedshiftSourceConfig)
-> Lens RedshiftSourceConfig RedshiftSourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:RedshiftSourceConfig' :: RedshiftSourceConfig -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Text
a -> RedshiftSourceConfig
s {$sel:clusterIdentifier:RedshiftSourceConfig' :: Text
clusterIdentifier = Text
a} :: RedshiftSourceConfig)
redshiftSourceConfig_databaseHost :: Lens.Lens' RedshiftSourceConfig Prelude.Text
redshiftSourceConfig_databaseHost :: (Text -> f Text) -> RedshiftSourceConfig -> f RedshiftSourceConfig
redshiftSourceConfig_databaseHost = (RedshiftSourceConfig -> Text)
-> (RedshiftSourceConfig -> Text -> RedshiftSourceConfig)
-> Lens RedshiftSourceConfig RedshiftSourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Text
databaseHost :: Text
$sel:databaseHost:RedshiftSourceConfig' :: RedshiftSourceConfig -> Text
databaseHost} -> Text
databaseHost) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Text
a -> RedshiftSourceConfig
s {$sel:databaseHost:RedshiftSourceConfig' :: Text
databaseHost = Text
a} :: RedshiftSourceConfig)
redshiftSourceConfig_databasePort :: Lens.Lens' RedshiftSourceConfig Prelude.Natural
redshiftSourceConfig_databasePort :: (Natural -> f Natural)
-> RedshiftSourceConfig -> f RedshiftSourceConfig
redshiftSourceConfig_databasePort = (RedshiftSourceConfig -> Natural)
-> (RedshiftSourceConfig -> Natural -> RedshiftSourceConfig)
-> Lens RedshiftSourceConfig RedshiftSourceConfig Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Natural
databasePort :: Natural
$sel:databasePort:RedshiftSourceConfig' :: RedshiftSourceConfig -> Natural
databasePort} -> Natural
databasePort) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Natural
a -> RedshiftSourceConfig
s {$sel:databasePort:RedshiftSourceConfig' :: Natural
databasePort = Natural
a} :: RedshiftSourceConfig)
redshiftSourceConfig_secretManagerArn :: Lens.Lens' RedshiftSourceConfig Prelude.Text
redshiftSourceConfig_secretManagerArn :: (Text -> f Text) -> RedshiftSourceConfig -> f RedshiftSourceConfig
redshiftSourceConfig_secretManagerArn = (RedshiftSourceConfig -> Text)
-> (RedshiftSourceConfig -> Text -> RedshiftSourceConfig)
-> Lens RedshiftSourceConfig RedshiftSourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Text
secretManagerArn :: Text
$sel:secretManagerArn:RedshiftSourceConfig' :: RedshiftSourceConfig -> Text
secretManagerArn} -> Text
secretManagerArn) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Text
a -> RedshiftSourceConfig
s {$sel:secretManagerArn:RedshiftSourceConfig' :: Text
secretManagerArn = Text
a} :: RedshiftSourceConfig)
redshiftSourceConfig_databaseName :: Lens.Lens' RedshiftSourceConfig Prelude.Text
redshiftSourceConfig_databaseName :: (Text -> f Text) -> RedshiftSourceConfig -> f RedshiftSourceConfig
redshiftSourceConfig_databaseName = (RedshiftSourceConfig -> Text)
-> (RedshiftSourceConfig -> Text -> RedshiftSourceConfig)
-> Lens RedshiftSourceConfig RedshiftSourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Text
databaseName :: Text
$sel:databaseName:RedshiftSourceConfig' :: RedshiftSourceConfig -> Text
databaseName} -> Text
databaseName) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Text
a -> RedshiftSourceConfig
s {$sel:databaseName:RedshiftSourceConfig' :: Text
databaseName = Text
a} :: RedshiftSourceConfig)
redshiftSourceConfig_tableName :: Lens.Lens' RedshiftSourceConfig Prelude.Text
redshiftSourceConfig_tableName :: (Text -> f Text) -> RedshiftSourceConfig -> f RedshiftSourceConfig
redshiftSourceConfig_tableName = (RedshiftSourceConfig -> Text)
-> (RedshiftSourceConfig -> Text -> RedshiftSourceConfig)
-> Lens RedshiftSourceConfig RedshiftSourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Text
tableName :: Text
$sel:tableName:RedshiftSourceConfig' :: RedshiftSourceConfig -> Text
tableName} -> Text
tableName) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Text
a -> RedshiftSourceConfig
s {$sel:tableName:RedshiftSourceConfig' :: Text
tableName = Text
a} :: RedshiftSourceConfig)
redshiftSourceConfig_roleArn :: Lens.Lens' RedshiftSourceConfig Prelude.Text
redshiftSourceConfig_roleArn :: (Text -> f Text) -> RedshiftSourceConfig -> f RedshiftSourceConfig
redshiftSourceConfig_roleArn = (RedshiftSourceConfig -> Text)
-> (RedshiftSourceConfig -> Text -> RedshiftSourceConfig)
-> Lens RedshiftSourceConfig RedshiftSourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Text
roleArn :: Text
$sel:roleArn:RedshiftSourceConfig' :: RedshiftSourceConfig -> Text
roleArn} -> Text
roleArn) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Text
a -> RedshiftSourceConfig
s {$sel:roleArn:RedshiftSourceConfig' :: Text
roleArn = Text
a} :: RedshiftSourceConfig)
redshiftSourceConfig_vpcConfiguration :: Lens.Lens' RedshiftSourceConfig VpcConfiguration
redshiftSourceConfig_vpcConfiguration :: (VpcConfiguration -> f VpcConfiguration)
-> RedshiftSourceConfig -> f RedshiftSourceConfig
redshiftSourceConfig_vpcConfiguration = (RedshiftSourceConfig -> VpcConfiguration)
-> (RedshiftSourceConfig
-> VpcConfiguration -> RedshiftSourceConfig)
-> Lens
RedshiftSourceConfig
RedshiftSourceConfig
VpcConfiguration
VpcConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {VpcConfiguration
vpcConfiguration :: VpcConfiguration
$sel:vpcConfiguration:RedshiftSourceConfig' :: RedshiftSourceConfig -> VpcConfiguration
vpcConfiguration} -> VpcConfiguration
vpcConfiguration) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} VpcConfiguration
a -> RedshiftSourceConfig
s {$sel:vpcConfiguration:RedshiftSourceConfig' :: VpcConfiguration
vpcConfiguration = VpcConfiguration
a} :: RedshiftSourceConfig)
instance Core.FromJSON RedshiftSourceConfig where
parseJSON :: Value -> Parser RedshiftSourceConfig
parseJSON =
String
-> (Object -> Parser RedshiftSourceConfig)
-> Value
-> Parser RedshiftSourceConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RedshiftSourceConfig"
( \Object
x ->
Text
-> Text
-> Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RedshiftSourceConfig
RedshiftSourceConfig'
(Text
-> Text
-> Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RedshiftSourceConfig)
-> Parser Text
-> Parser
(Text
-> Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RedshiftSourceConfig)
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
"ClusterIdentifier")
Parser
(Text
-> Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RedshiftSourceConfig)
-> Parser Text
-> Parser
(Natural
-> Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RedshiftSourceConfig)
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
-> RedshiftSourceConfig)
-> Parser Natural
-> Parser
(Text
-> Text
-> Text
-> Text
-> VpcConfiguration
-> RedshiftSourceConfig)
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
-> RedshiftSourceConfig)
-> Parser Text
-> Parser
(Text -> Text -> Text -> VpcConfiguration -> RedshiftSourceConfig)
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 -> RedshiftSourceConfig)
-> Parser Text
-> Parser
(Text -> Text -> VpcConfiguration -> RedshiftSourceConfig)
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 -> RedshiftSourceConfig)
-> Parser Text
-> Parser (Text -> VpcConfiguration -> RedshiftSourceConfig)
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 -> RedshiftSourceConfig)
-> Parser Text -> Parser (VpcConfiguration -> RedshiftSourceConfig)
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 -> RedshiftSourceConfig)
-> Parser VpcConfiguration -> Parser RedshiftSourceConfig
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 RedshiftSourceConfig
instance Prelude.NFData RedshiftSourceConfig
instance Core.ToJSON RedshiftSourceConfig where
toJSON :: RedshiftSourceConfig -> Value
toJSON RedshiftSourceConfig' {Natural
Text
VpcConfiguration
vpcConfiguration :: VpcConfiguration
roleArn :: Text
tableName :: Text
databaseName :: Text
secretManagerArn :: Text
databasePort :: Natural
databaseHost :: Text
clusterIdentifier :: Text
$sel:vpcConfiguration:RedshiftSourceConfig' :: RedshiftSourceConfig -> VpcConfiguration
$sel:roleArn:RedshiftSourceConfig' :: RedshiftSourceConfig -> Text
$sel:tableName:RedshiftSourceConfig' :: RedshiftSourceConfig -> Text
$sel:databaseName:RedshiftSourceConfig' :: RedshiftSourceConfig -> Text
$sel:secretManagerArn:RedshiftSourceConfig' :: RedshiftSourceConfig -> Text
$sel:databasePort:RedshiftSourceConfig' :: RedshiftSourceConfig -> Natural
$sel:databaseHost:RedshiftSourceConfig' :: RedshiftSourceConfig -> Text
$sel:clusterIdentifier:RedshiftSourceConfig' :: RedshiftSourceConfig -> 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
"ClusterIdentifier" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clusterIdentifier),
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)
]
)