{-# 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.AthenaSourceConfig 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.BackTestConfiguration
import qualified Amazonka.Prelude as Prelude
data AthenaSourceConfig = AthenaSourceConfig'
{
AthenaSourceConfig -> Maybe BackTestConfiguration
backTestConfiguration :: Prelude.Maybe BackTestConfiguration,
AthenaSourceConfig -> Maybe Text
dataCatalog :: Prelude.Maybe Prelude.Text,
AthenaSourceConfig -> Maybe Text
databaseName :: Prelude.Maybe Prelude.Text,
AthenaSourceConfig -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
AthenaSourceConfig -> Maybe Text
s3ResultsPath :: Prelude.Maybe Prelude.Text,
AthenaSourceConfig -> Maybe Text
tableName :: Prelude.Maybe Prelude.Text,
AthenaSourceConfig -> Maybe Text
workGroupName :: Prelude.Maybe Prelude.Text
}
deriving (AthenaSourceConfig -> AthenaSourceConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AthenaSourceConfig -> AthenaSourceConfig -> Bool
$c/= :: AthenaSourceConfig -> AthenaSourceConfig -> Bool
== :: AthenaSourceConfig -> AthenaSourceConfig -> Bool
$c== :: AthenaSourceConfig -> AthenaSourceConfig -> Bool
Prelude.Eq, ReadPrec [AthenaSourceConfig]
ReadPrec AthenaSourceConfig
Int -> ReadS AthenaSourceConfig
ReadS [AthenaSourceConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AthenaSourceConfig]
$creadListPrec :: ReadPrec [AthenaSourceConfig]
readPrec :: ReadPrec AthenaSourceConfig
$creadPrec :: ReadPrec AthenaSourceConfig
readList :: ReadS [AthenaSourceConfig]
$creadList :: ReadS [AthenaSourceConfig]
readsPrec :: Int -> ReadS AthenaSourceConfig
$creadsPrec :: Int -> ReadS AthenaSourceConfig
Prelude.Read, Int -> AthenaSourceConfig -> ShowS
[AthenaSourceConfig] -> ShowS
AthenaSourceConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AthenaSourceConfig] -> ShowS
$cshowList :: [AthenaSourceConfig] -> ShowS
show :: AthenaSourceConfig -> String
$cshow :: AthenaSourceConfig -> String
showsPrec :: Int -> AthenaSourceConfig -> ShowS
$cshowsPrec :: Int -> AthenaSourceConfig -> ShowS
Prelude.Show, forall x. Rep AthenaSourceConfig x -> AthenaSourceConfig
forall x. AthenaSourceConfig -> Rep AthenaSourceConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AthenaSourceConfig x -> AthenaSourceConfig
$cfrom :: forall x. AthenaSourceConfig -> Rep AthenaSourceConfig x
Prelude.Generic)
newAthenaSourceConfig ::
AthenaSourceConfig
newAthenaSourceConfig :: AthenaSourceConfig
newAthenaSourceConfig =
AthenaSourceConfig'
{ $sel:backTestConfiguration:AthenaSourceConfig' :: Maybe BackTestConfiguration
backTestConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:dataCatalog:AthenaSourceConfig' :: Maybe Text
dataCatalog = forall a. Maybe a
Prelude.Nothing,
$sel:databaseName:AthenaSourceConfig' :: Maybe Text
databaseName = forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:AthenaSourceConfig' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing,
$sel:s3ResultsPath:AthenaSourceConfig' :: Maybe Text
s3ResultsPath = forall a. Maybe a
Prelude.Nothing,
$sel:tableName:AthenaSourceConfig' :: Maybe Text
tableName = forall a. Maybe a
Prelude.Nothing,
$sel:workGroupName:AthenaSourceConfig' :: Maybe Text
workGroupName = forall a. Maybe a
Prelude.Nothing
}
athenaSourceConfig_backTestConfiguration :: Lens.Lens' AthenaSourceConfig (Prelude.Maybe BackTestConfiguration)
athenaSourceConfig_backTestConfiguration :: Lens' AthenaSourceConfig (Maybe BackTestConfiguration)
athenaSourceConfig_backTestConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaSourceConfig' {Maybe BackTestConfiguration
backTestConfiguration :: Maybe BackTestConfiguration
$sel:backTestConfiguration:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe BackTestConfiguration
backTestConfiguration} -> Maybe BackTestConfiguration
backTestConfiguration) (\s :: AthenaSourceConfig
s@AthenaSourceConfig' {} Maybe BackTestConfiguration
a -> AthenaSourceConfig
s {$sel:backTestConfiguration:AthenaSourceConfig' :: Maybe BackTestConfiguration
backTestConfiguration = Maybe BackTestConfiguration
a} :: AthenaSourceConfig)
athenaSourceConfig_dataCatalog :: Lens.Lens' AthenaSourceConfig (Prelude.Maybe Prelude.Text)
athenaSourceConfig_dataCatalog :: Lens' AthenaSourceConfig (Maybe Text)
athenaSourceConfig_dataCatalog = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaSourceConfig' {Maybe Text
dataCatalog :: Maybe Text
$sel:dataCatalog:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
dataCatalog} -> Maybe Text
dataCatalog) (\s :: AthenaSourceConfig
s@AthenaSourceConfig' {} Maybe Text
a -> AthenaSourceConfig
s {$sel:dataCatalog:AthenaSourceConfig' :: Maybe Text
dataCatalog = Maybe Text
a} :: AthenaSourceConfig)
athenaSourceConfig_databaseName :: Lens.Lens' AthenaSourceConfig (Prelude.Maybe Prelude.Text)
athenaSourceConfig_databaseName :: Lens' AthenaSourceConfig (Maybe Text)
athenaSourceConfig_databaseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaSourceConfig' {Maybe Text
databaseName :: Maybe Text
$sel:databaseName:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
databaseName} -> Maybe Text
databaseName) (\s :: AthenaSourceConfig
s@AthenaSourceConfig' {} Maybe Text
a -> AthenaSourceConfig
s {$sel:databaseName:AthenaSourceConfig' :: Maybe Text
databaseName = Maybe Text
a} :: AthenaSourceConfig)
athenaSourceConfig_roleArn :: Lens.Lens' AthenaSourceConfig (Prelude.Maybe Prelude.Text)
athenaSourceConfig_roleArn :: Lens' AthenaSourceConfig (Maybe Text)
athenaSourceConfig_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaSourceConfig' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: AthenaSourceConfig
s@AthenaSourceConfig' {} Maybe Text
a -> AthenaSourceConfig
s {$sel:roleArn:AthenaSourceConfig' :: Maybe Text
roleArn = Maybe Text
a} :: AthenaSourceConfig)
athenaSourceConfig_s3ResultsPath :: Lens.Lens' AthenaSourceConfig (Prelude.Maybe Prelude.Text)
athenaSourceConfig_s3ResultsPath :: Lens' AthenaSourceConfig (Maybe Text)
athenaSourceConfig_s3ResultsPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaSourceConfig' {Maybe Text
s3ResultsPath :: Maybe Text
$sel:s3ResultsPath:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
s3ResultsPath} -> Maybe Text
s3ResultsPath) (\s :: AthenaSourceConfig
s@AthenaSourceConfig' {} Maybe Text
a -> AthenaSourceConfig
s {$sel:s3ResultsPath:AthenaSourceConfig' :: Maybe Text
s3ResultsPath = Maybe Text
a} :: AthenaSourceConfig)
athenaSourceConfig_tableName :: Lens.Lens' AthenaSourceConfig (Prelude.Maybe Prelude.Text)
athenaSourceConfig_tableName :: Lens' AthenaSourceConfig (Maybe Text)
athenaSourceConfig_tableName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaSourceConfig' {Maybe Text
tableName :: Maybe Text
$sel:tableName:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
tableName} -> Maybe Text
tableName) (\s :: AthenaSourceConfig
s@AthenaSourceConfig' {} Maybe Text
a -> AthenaSourceConfig
s {$sel:tableName:AthenaSourceConfig' :: Maybe Text
tableName = Maybe Text
a} :: AthenaSourceConfig)
athenaSourceConfig_workGroupName :: Lens.Lens' AthenaSourceConfig (Prelude.Maybe Prelude.Text)
athenaSourceConfig_workGroupName :: Lens' AthenaSourceConfig (Maybe Text)
athenaSourceConfig_workGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaSourceConfig' {Maybe Text
workGroupName :: Maybe Text
$sel:workGroupName:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
workGroupName} -> Maybe Text
workGroupName) (\s :: AthenaSourceConfig
s@AthenaSourceConfig' {} Maybe Text
a -> AthenaSourceConfig
s {$sel:workGroupName:AthenaSourceConfig' :: Maybe Text
workGroupName = Maybe Text
a} :: AthenaSourceConfig)
instance Data.FromJSON AthenaSourceConfig where
parseJSON :: Value -> Parser AthenaSourceConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AthenaSourceConfig"
( \Object
x ->
Maybe BackTestConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AthenaSourceConfig
AthenaSourceConfig'
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
"BackTestConfiguration")
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
"DataCatalog")
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
"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
"S3ResultsPath")
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
"WorkGroupName")
)
instance Prelude.Hashable AthenaSourceConfig where
hashWithSalt :: Int -> AthenaSourceConfig -> Int
hashWithSalt Int
_salt AthenaSourceConfig' {Maybe Text
Maybe BackTestConfiguration
workGroupName :: Maybe Text
tableName :: Maybe Text
s3ResultsPath :: Maybe Text
roleArn :: Maybe Text
databaseName :: Maybe Text
dataCatalog :: Maybe Text
backTestConfiguration :: Maybe BackTestConfiguration
$sel:workGroupName:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:tableName:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:s3ResultsPath:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:roleArn:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:databaseName:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:dataCatalog:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:backTestConfiguration:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe BackTestConfiguration
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BackTestConfiguration
backTestConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dataCatalog
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
databaseName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3ResultsPath
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tableName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
workGroupName
instance Prelude.NFData AthenaSourceConfig where
rnf :: AthenaSourceConfig -> ()
rnf AthenaSourceConfig' {Maybe Text
Maybe BackTestConfiguration
workGroupName :: Maybe Text
tableName :: Maybe Text
s3ResultsPath :: Maybe Text
roleArn :: Maybe Text
databaseName :: Maybe Text
dataCatalog :: Maybe Text
backTestConfiguration :: Maybe BackTestConfiguration
$sel:workGroupName:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:tableName:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:s3ResultsPath:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:roleArn:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:databaseName:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:dataCatalog:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:backTestConfiguration:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe BackTestConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe BackTestConfiguration
backTestConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dataCatalog
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 Text
roleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3ResultsPath
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 Text
workGroupName
instance Data.ToJSON AthenaSourceConfig where
toJSON :: AthenaSourceConfig -> Value
toJSON AthenaSourceConfig' {Maybe Text
Maybe BackTestConfiguration
workGroupName :: Maybe Text
tableName :: Maybe Text
s3ResultsPath :: Maybe Text
roleArn :: Maybe Text
databaseName :: Maybe Text
dataCatalog :: Maybe Text
backTestConfiguration :: Maybe BackTestConfiguration
$sel:workGroupName:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:tableName:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:s3ResultsPath:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:roleArn:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:databaseName:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:dataCatalog:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe Text
$sel:backTestConfiguration:AthenaSourceConfig' :: AthenaSourceConfig -> Maybe BackTestConfiguration
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"BackTestConfiguration" 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 BackTestConfiguration
backTestConfiguration,
(Key
"DataCatalog" 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
dataCatalog,
(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
"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
"S3ResultsPath" 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
s3ResultsPath,
(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
"WorkGroupName" 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
workGroupName
]
)