{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LookoutMetrics.Types.VpcConfiguration
import qualified Amazonka.Prelude as Prelude
data RedshiftSourceConfig = RedshiftSourceConfig'
{
RedshiftSourceConfig -> Maybe Text
clusterIdentifier :: Prelude.Maybe Prelude.Text,
RedshiftSourceConfig -> Maybe Text
databaseHost :: Prelude.Maybe Prelude.Text,
RedshiftSourceConfig -> Maybe Text
databaseName :: Prelude.Maybe Prelude.Text,
RedshiftSourceConfig -> Maybe Natural
databasePort :: Prelude.Maybe Prelude.Natural,
RedshiftSourceConfig -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
RedshiftSourceConfig -> Maybe Text
secretManagerArn :: Prelude.Maybe Prelude.Text,
RedshiftSourceConfig -> Maybe Text
tableName :: Prelude.Maybe Prelude.Text,
RedshiftSourceConfig -> Maybe VpcConfiguration
vpcConfiguration :: Prelude.Maybe VpcConfiguration
}
deriving (RedshiftSourceConfig -> RedshiftSourceConfig -> Bool
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]
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
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. 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 ::
RedshiftSourceConfig
newRedshiftSourceConfig :: RedshiftSourceConfig
newRedshiftSourceConfig =
RedshiftSourceConfig'
{ $sel:clusterIdentifier:RedshiftSourceConfig' :: Maybe Text
clusterIdentifier =
forall a. Maybe a
Prelude.Nothing,
$sel:databaseHost:RedshiftSourceConfig' :: Maybe Text
databaseHost = forall a. Maybe a
Prelude.Nothing,
$sel:databaseName:RedshiftSourceConfig' :: Maybe Text
databaseName = forall a. Maybe a
Prelude.Nothing,
$sel:databasePort:RedshiftSourceConfig' :: Maybe Natural
databasePort = forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:RedshiftSourceConfig' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing,
$sel:secretManagerArn:RedshiftSourceConfig' :: Maybe Text
secretManagerArn = forall a. Maybe a
Prelude.Nothing,
$sel:tableName:RedshiftSourceConfig' :: Maybe Text
tableName = forall a. Maybe a
Prelude.Nothing,
$sel:vpcConfiguration:RedshiftSourceConfig' :: Maybe VpcConfiguration
vpcConfiguration = forall a. Maybe a
Prelude.Nothing
}
redshiftSourceConfig_clusterIdentifier :: Lens.Lens' RedshiftSourceConfig (Prelude.Maybe Prelude.Text)
redshiftSourceConfig_clusterIdentifier :: Lens' RedshiftSourceConfig (Maybe Text)
redshiftSourceConfig_clusterIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Maybe Text
clusterIdentifier :: Maybe Text
$sel:clusterIdentifier:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
clusterIdentifier} -> Maybe Text
clusterIdentifier) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Maybe Text
a -> RedshiftSourceConfig
s {$sel:clusterIdentifier:RedshiftSourceConfig' :: Maybe Text
clusterIdentifier = Maybe Text
a} :: RedshiftSourceConfig)
redshiftSourceConfig_databaseHost :: Lens.Lens' RedshiftSourceConfig (Prelude.Maybe Prelude.Text)
redshiftSourceConfig_databaseHost :: Lens' RedshiftSourceConfig (Maybe Text)
redshiftSourceConfig_databaseHost = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Maybe Text
databaseHost :: Maybe Text
$sel:databaseHost:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
databaseHost} -> Maybe Text
databaseHost) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Maybe Text
a -> RedshiftSourceConfig
s {$sel:databaseHost:RedshiftSourceConfig' :: Maybe Text
databaseHost = Maybe Text
a} :: RedshiftSourceConfig)
redshiftSourceConfig_databaseName :: Lens.Lens' RedshiftSourceConfig (Prelude.Maybe Prelude.Text)
redshiftSourceConfig_databaseName :: Lens' RedshiftSourceConfig (Maybe Text)
redshiftSourceConfig_databaseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Maybe Text
databaseName :: Maybe Text
$sel:databaseName:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
databaseName} -> Maybe Text
databaseName) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Maybe Text
a -> RedshiftSourceConfig
s {$sel:databaseName:RedshiftSourceConfig' :: Maybe Text
databaseName = Maybe Text
a} :: RedshiftSourceConfig)
redshiftSourceConfig_databasePort :: Lens.Lens' RedshiftSourceConfig (Prelude.Maybe Prelude.Natural)
redshiftSourceConfig_databasePort :: Lens' RedshiftSourceConfig (Maybe Natural)
redshiftSourceConfig_databasePort = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Maybe Natural
databasePort :: Maybe Natural
$sel:databasePort:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Natural
databasePort} -> Maybe Natural
databasePort) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Maybe Natural
a -> RedshiftSourceConfig
s {$sel:databasePort:RedshiftSourceConfig' :: Maybe Natural
databasePort = Maybe Natural
a} :: RedshiftSourceConfig)
redshiftSourceConfig_roleArn :: Lens.Lens' RedshiftSourceConfig (Prelude.Maybe Prelude.Text)
redshiftSourceConfig_roleArn :: Lens' RedshiftSourceConfig (Maybe Text)
redshiftSourceConfig_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Maybe Text
a -> RedshiftSourceConfig
s {$sel:roleArn:RedshiftSourceConfig' :: Maybe Text
roleArn = Maybe Text
a} :: RedshiftSourceConfig)
redshiftSourceConfig_secretManagerArn :: Lens.Lens' RedshiftSourceConfig (Prelude.Maybe Prelude.Text)
redshiftSourceConfig_secretManagerArn :: Lens' RedshiftSourceConfig (Maybe Text)
redshiftSourceConfig_secretManagerArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Maybe Text
secretManagerArn :: Maybe Text
$sel:secretManagerArn:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
secretManagerArn} -> Maybe Text
secretManagerArn) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Maybe Text
a -> RedshiftSourceConfig
s {$sel:secretManagerArn:RedshiftSourceConfig' :: Maybe Text
secretManagerArn = Maybe Text
a} :: RedshiftSourceConfig)
redshiftSourceConfig_tableName :: Lens.Lens' RedshiftSourceConfig (Prelude.Maybe Prelude.Text)
redshiftSourceConfig_tableName :: Lens' RedshiftSourceConfig (Maybe Text)
redshiftSourceConfig_tableName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Maybe Text
tableName :: Maybe Text
$sel:tableName:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
tableName} -> Maybe Text
tableName) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Maybe Text
a -> RedshiftSourceConfig
s {$sel:tableName:RedshiftSourceConfig' :: Maybe Text
tableName = Maybe Text
a} :: RedshiftSourceConfig)
redshiftSourceConfig_vpcConfiguration :: Lens.Lens' RedshiftSourceConfig (Prelude.Maybe VpcConfiguration)
redshiftSourceConfig_vpcConfiguration :: Lens' RedshiftSourceConfig (Maybe VpcConfiguration)
redshiftSourceConfig_vpcConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSourceConfig' {Maybe VpcConfiguration
vpcConfiguration :: Maybe VpcConfiguration
$sel:vpcConfiguration:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe VpcConfiguration
vpcConfiguration} -> Maybe VpcConfiguration
vpcConfiguration) (\s :: RedshiftSourceConfig
s@RedshiftSourceConfig' {} Maybe VpcConfiguration
a -> RedshiftSourceConfig
s {$sel:vpcConfiguration:RedshiftSourceConfig' :: Maybe VpcConfiguration
vpcConfiguration = Maybe VpcConfiguration
a} :: RedshiftSourceConfig)
instance Data.FromJSON RedshiftSourceConfig where
parseJSON :: Value -> Parser RedshiftSourceConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RedshiftSourceConfig"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe VpcConfiguration
-> RedshiftSourceConfig
RedshiftSourceConfig'
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
"ClusterIdentifier")
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
"DatabaseHost")
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
"DatabaseName")
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
"DatabasePort")
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
"RoleArn")
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
"SecretManagerArn")
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
"TableName")
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
"VpcConfiguration")
)
instance Prelude.Hashable RedshiftSourceConfig where
hashWithSalt :: Int -> RedshiftSourceConfig -> Int
hashWithSalt Int
_salt RedshiftSourceConfig' {Maybe Natural
Maybe Text
Maybe VpcConfiguration
vpcConfiguration :: Maybe VpcConfiguration
tableName :: Maybe Text
secretManagerArn :: Maybe Text
roleArn :: Maybe Text
databasePort :: Maybe Natural
databaseName :: Maybe Text
databaseHost :: Maybe Text
clusterIdentifier :: Maybe Text
$sel:vpcConfiguration:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe VpcConfiguration
$sel:tableName:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:secretManagerArn:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:roleArn:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:databasePort:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Natural
$sel:databaseName:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:databaseHost:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:clusterIdentifier:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clusterIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
databaseHost
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
databaseName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
databasePort
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
secretManagerArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tableName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VpcConfiguration
vpcConfiguration
instance Prelude.NFData RedshiftSourceConfig where
rnf :: RedshiftSourceConfig -> ()
rnf RedshiftSourceConfig' {Maybe Natural
Maybe Text
Maybe VpcConfiguration
vpcConfiguration :: Maybe VpcConfiguration
tableName :: Maybe Text
secretManagerArn :: Maybe Text
roleArn :: Maybe Text
databasePort :: Maybe Natural
databaseName :: Maybe Text
databaseHost :: Maybe Text
clusterIdentifier :: Maybe Text
$sel:vpcConfiguration:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe VpcConfiguration
$sel:tableName:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:secretManagerArn:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:roleArn:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:databasePort:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Natural
$sel:databaseName:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:databaseHost:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:clusterIdentifier:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clusterIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
databaseHost
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
databaseName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
databasePort
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
secretManagerArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tableName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VpcConfiguration
vpcConfiguration
instance Data.ToJSON RedshiftSourceConfig where
toJSON :: RedshiftSourceConfig -> Value
toJSON RedshiftSourceConfig' {Maybe Natural
Maybe Text
Maybe VpcConfiguration
vpcConfiguration :: Maybe VpcConfiguration
tableName :: Maybe Text
secretManagerArn :: Maybe Text
roleArn :: Maybe Text
databasePort :: Maybe Natural
databaseName :: Maybe Text
databaseHost :: Maybe Text
clusterIdentifier :: Maybe Text
$sel:vpcConfiguration:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe VpcConfiguration
$sel:tableName:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:secretManagerArn:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:roleArn:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:databasePort:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Natural
$sel:databaseName:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:databaseHost:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
$sel:clusterIdentifier:RedshiftSourceConfig' :: RedshiftSourceConfig -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ClusterIdentifier" 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
clusterIdentifier,
(Key
"DatabaseHost" 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
databaseHost,
(Key
"DatabaseName" 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
databaseName,
(Key
"DatabasePort" 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 Natural
databasePort,
(Key
"RoleArn" 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
roleArn,
(Key
"SecretManagerArn" 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
secretManagerArn,
(Key
"TableName" 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
tableName,
(Key
"VpcConfiguration" 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 VpcConfiguration
vpcConfiguration
]
)