{-# 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.QuickSight.Types.PhysicalTable where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.CustomSql
import Amazonka.QuickSight.Types.RelationalTable
import Amazonka.QuickSight.Types.S3Source
data PhysicalTable = PhysicalTable'
{
PhysicalTable -> Maybe CustomSql
customSql :: Prelude.Maybe CustomSql,
PhysicalTable -> Maybe RelationalTable
relationalTable :: Prelude.Maybe RelationalTable,
PhysicalTable -> Maybe S3Source
s3Source :: Prelude.Maybe S3Source
}
deriving (PhysicalTable -> PhysicalTable -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalTable -> PhysicalTable -> Bool
$c/= :: PhysicalTable -> PhysicalTable -> Bool
== :: PhysicalTable -> PhysicalTable -> Bool
$c== :: PhysicalTable -> PhysicalTable -> Bool
Prelude.Eq, ReadPrec [PhysicalTable]
ReadPrec PhysicalTable
Int -> ReadS PhysicalTable
ReadS [PhysicalTable]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PhysicalTable]
$creadListPrec :: ReadPrec [PhysicalTable]
readPrec :: ReadPrec PhysicalTable
$creadPrec :: ReadPrec PhysicalTable
readList :: ReadS [PhysicalTable]
$creadList :: ReadS [PhysicalTable]
readsPrec :: Int -> ReadS PhysicalTable
$creadsPrec :: Int -> ReadS PhysicalTable
Prelude.Read, Int -> PhysicalTable -> ShowS
[PhysicalTable] -> ShowS
PhysicalTable -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PhysicalTable] -> ShowS
$cshowList :: [PhysicalTable] -> ShowS
show :: PhysicalTable -> String
$cshow :: PhysicalTable -> String
showsPrec :: Int -> PhysicalTable -> ShowS
$cshowsPrec :: Int -> PhysicalTable -> ShowS
Prelude.Show, forall x. Rep PhysicalTable x -> PhysicalTable
forall x. PhysicalTable -> Rep PhysicalTable x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PhysicalTable x -> PhysicalTable
$cfrom :: forall x. PhysicalTable -> Rep PhysicalTable x
Prelude.Generic)
newPhysicalTable ::
PhysicalTable
newPhysicalTable :: PhysicalTable
newPhysicalTable =
PhysicalTable'
{ $sel:customSql:PhysicalTable' :: Maybe CustomSql
customSql = forall a. Maybe a
Prelude.Nothing,
$sel:relationalTable:PhysicalTable' :: Maybe RelationalTable
relationalTable = forall a. Maybe a
Prelude.Nothing,
$sel:s3Source:PhysicalTable' :: Maybe S3Source
s3Source = forall a. Maybe a
Prelude.Nothing
}
physicalTable_customSql :: Lens.Lens' PhysicalTable (Prelude.Maybe CustomSql)
physicalTable_customSql :: Lens' PhysicalTable (Maybe CustomSql)
physicalTable_customSql = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalTable' {Maybe CustomSql
customSql :: Maybe CustomSql
$sel:customSql:PhysicalTable' :: PhysicalTable -> Maybe CustomSql
customSql} -> Maybe CustomSql
customSql) (\s :: PhysicalTable
s@PhysicalTable' {} Maybe CustomSql
a -> PhysicalTable
s {$sel:customSql:PhysicalTable' :: Maybe CustomSql
customSql = Maybe CustomSql
a} :: PhysicalTable)
physicalTable_relationalTable :: Lens.Lens' PhysicalTable (Prelude.Maybe RelationalTable)
physicalTable_relationalTable :: Lens' PhysicalTable (Maybe RelationalTable)
physicalTable_relationalTable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalTable' {Maybe RelationalTable
relationalTable :: Maybe RelationalTable
$sel:relationalTable:PhysicalTable' :: PhysicalTable -> Maybe RelationalTable
relationalTable} -> Maybe RelationalTable
relationalTable) (\s :: PhysicalTable
s@PhysicalTable' {} Maybe RelationalTable
a -> PhysicalTable
s {$sel:relationalTable:PhysicalTable' :: Maybe RelationalTable
relationalTable = Maybe RelationalTable
a} :: PhysicalTable)
physicalTable_s3Source :: Lens.Lens' PhysicalTable (Prelude.Maybe S3Source)
physicalTable_s3Source :: Lens' PhysicalTable (Maybe S3Source)
physicalTable_s3Source = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalTable' {Maybe S3Source
s3Source :: Maybe S3Source
$sel:s3Source:PhysicalTable' :: PhysicalTable -> Maybe S3Source
s3Source} -> Maybe S3Source
s3Source) (\s :: PhysicalTable
s@PhysicalTable' {} Maybe S3Source
a -> PhysicalTable
s {$sel:s3Source:PhysicalTable' :: Maybe S3Source
s3Source = Maybe S3Source
a} :: PhysicalTable)
instance Data.FromJSON PhysicalTable where
parseJSON :: Value -> Parser PhysicalTable
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PhysicalTable"
( \Object
x ->
Maybe CustomSql
-> Maybe RelationalTable -> Maybe S3Source -> PhysicalTable
PhysicalTable'
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
"CustomSql")
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
"RelationalTable")
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
"S3Source")
)
instance Prelude.Hashable PhysicalTable where
hashWithSalt :: Int -> PhysicalTable -> Int
hashWithSalt Int
_salt PhysicalTable' {Maybe CustomSql
Maybe RelationalTable
Maybe S3Source
s3Source :: Maybe S3Source
relationalTable :: Maybe RelationalTable
customSql :: Maybe CustomSql
$sel:s3Source:PhysicalTable' :: PhysicalTable -> Maybe S3Source
$sel:relationalTable:PhysicalTable' :: PhysicalTable -> Maybe RelationalTable
$sel:customSql:PhysicalTable' :: PhysicalTable -> Maybe CustomSql
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CustomSql
customSql
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RelationalTable
relationalTable
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3Source
s3Source
instance Prelude.NFData PhysicalTable where
rnf :: PhysicalTable -> ()
rnf PhysicalTable' {Maybe CustomSql
Maybe RelationalTable
Maybe S3Source
s3Source :: Maybe S3Source
relationalTable :: Maybe RelationalTable
customSql :: Maybe CustomSql
$sel:s3Source:PhysicalTable' :: PhysicalTable -> Maybe S3Source
$sel:relationalTable:PhysicalTable' :: PhysicalTable -> Maybe RelationalTable
$sel:customSql:PhysicalTable' :: PhysicalTable -> Maybe CustomSql
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomSql
customSql
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RelationalTable
relationalTable
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe S3Source
s3Source
instance Data.ToJSON PhysicalTable where
toJSON :: PhysicalTable -> Value
toJSON PhysicalTable' {Maybe CustomSql
Maybe RelationalTable
Maybe S3Source
s3Source :: Maybe S3Source
relationalTable :: Maybe RelationalTable
customSql :: Maybe CustomSql
$sel:s3Source:PhysicalTable' :: PhysicalTable -> Maybe S3Source
$sel:relationalTable:PhysicalTable' :: PhysicalTable -> Maybe RelationalTable
$sel:customSql:PhysicalTable' :: PhysicalTable -> Maybe CustomSql
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CustomSql" 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 CustomSql
customSql,
(Key
"RelationalTable" 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 RelationalTable
relationalTable,
(Key
"S3Source" 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 S3Source
s3Source
]
)