{-# 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.Glue.Types.RedshiftSource 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
data RedshiftSource = RedshiftSource'
{
RedshiftSource -> Maybe Text
redshiftTmpDir :: Prelude.Maybe Prelude.Text,
RedshiftSource -> Maybe Text
tmpDirIAMRole :: Prelude.Maybe Prelude.Text,
RedshiftSource -> Text
name :: Prelude.Text,
RedshiftSource -> Text
database :: Prelude.Text,
RedshiftSource -> Text
table :: Prelude.Text
}
deriving (RedshiftSource -> RedshiftSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedshiftSource -> RedshiftSource -> Bool
$c/= :: RedshiftSource -> RedshiftSource -> Bool
== :: RedshiftSource -> RedshiftSource -> Bool
$c== :: RedshiftSource -> RedshiftSource -> Bool
Prelude.Eq, ReadPrec [RedshiftSource]
ReadPrec RedshiftSource
Int -> ReadS RedshiftSource
ReadS [RedshiftSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RedshiftSource]
$creadListPrec :: ReadPrec [RedshiftSource]
readPrec :: ReadPrec RedshiftSource
$creadPrec :: ReadPrec RedshiftSource
readList :: ReadS [RedshiftSource]
$creadList :: ReadS [RedshiftSource]
readsPrec :: Int -> ReadS RedshiftSource
$creadsPrec :: Int -> ReadS RedshiftSource
Prelude.Read, Int -> RedshiftSource -> ShowS
[RedshiftSource] -> ShowS
RedshiftSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedshiftSource] -> ShowS
$cshowList :: [RedshiftSource] -> ShowS
show :: RedshiftSource -> String
$cshow :: RedshiftSource -> String
showsPrec :: Int -> RedshiftSource -> ShowS
$cshowsPrec :: Int -> RedshiftSource -> ShowS
Prelude.Show, forall x. Rep RedshiftSource x -> RedshiftSource
forall x. RedshiftSource -> Rep RedshiftSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RedshiftSource x -> RedshiftSource
$cfrom :: forall x. RedshiftSource -> Rep RedshiftSource x
Prelude.Generic)
newRedshiftSource ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
RedshiftSource
newRedshiftSource :: Text -> Text -> Text -> RedshiftSource
newRedshiftSource Text
pName_ Text
pDatabase_ Text
pTable_ =
RedshiftSource'
{ $sel:redshiftTmpDir:RedshiftSource' :: Maybe Text
redshiftTmpDir = forall a. Maybe a
Prelude.Nothing,
$sel:tmpDirIAMRole:RedshiftSource' :: Maybe Text
tmpDirIAMRole = forall a. Maybe a
Prelude.Nothing,
$sel:name:RedshiftSource' :: Text
name = Text
pName_,
$sel:database:RedshiftSource' :: Text
database = Text
pDatabase_,
$sel:table:RedshiftSource' :: Text
table = Text
pTable_
}
redshiftSource_redshiftTmpDir :: Lens.Lens' RedshiftSource (Prelude.Maybe Prelude.Text)
redshiftSource_redshiftTmpDir :: Lens' RedshiftSource (Maybe Text)
redshiftSource_redshiftTmpDir = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSource' {Maybe Text
redshiftTmpDir :: Maybe Text
$sel:redshiftTmpDir:RedshiftSource' :: RedshiftSource -> Maybe Text
redshiftTmpDir} -> Maybe Text
redshiftTmpDir) (\s :: RedshiftSource
s@RedshiftSource' {} Maybe Text
a -> RedshiftSource
s {$sel:redshiftTmpDir:RedshiftSource' :: Maybe Text
redshiftTmpDir = Maybe Text
a} :: RedshiftSource)
redshiftSource_tmpDirIAMRole :: Lens.Lens' RedshiftSource (Prelude.Maybe Prelude.Text)
redshiftSource_tmpDirIAMRole :: Lens' RedshiftSource (Maybe Text)
redshiftSource_tmpDirIAMRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSource' {Maybe Text
tmpDirIAMRole :: Maybe Text
$sel:tmpDirIAMRole:RedshiftSource' :: RedshiftSource -> Maybe Text
tmpDirIAMRole} -> Maybe Text
tmpDirIAMRole) (\s :: RedshiftSource
s@RedshiftSource' {} Maybe Text
a -> RedshiftSource
s {$sel:tmpDirIAMRole:RedshiftSource' :: Maybe Text
tmpDirIAMRole = Maybe Text
a} :: RedshiftSource)
redshiftSource_name :: Lens.Lens' RedshiftSource Prelude.Text
redshiftSource_name :: Lens' RedshiftSource Text
redshiftSource_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSource' {Text
name :: Text
$sel:name:RedshiftSource' :: RedshiftSource -> Text
name} -> Text
name) (\s :: RedshiftSource
s@RedshiftSource' {} Text
a -> RedshiftSource
s {$sel:name:RedshiftSource' :: Text
name = Text
a} :: RedshiftSource)
redshiftSource_database :: Lens.Lens' RedshiftSource Prelude.Text
redshiftSource_database :: Lens' RedshiftSource Text
redshiftSource_database = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSource' {Text
database :: Text
$sel:database:RedshiftSource' :: RedshiftSource -> Text
database} -> Text
database) (\s :: RedshiftSource
s@RedshiftSource' {} Text
a -> RedshiftSource
s {$sel:database:RedshiftSource' :: Text
database = Text
a} :: RedshiftSource)
redshiftSource_table :: Lens.Lens' RedshiftSource Prelude.Text
redshiftSource_table :: Lens' RedshiftSource Text
redshiftSource_table = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftSource' {Text
table :: Text
$sel:table:RedshiftSource' :: RedshiftSource -> Text
table} -> Text
table) (\s :: RedshiftSource
s@RedshiftSource' {} Text
a -> RedshiftSource
s {$sel:table:RedshiftSource' :: Text
table = Text
a} :: RedshiftSource)
instance Data.FromJSON RedshiftSource where
parseJSON :: Value -> Parser RedshiftSource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RedshiftSource"
( \Object
x ->
Maybe Text -> Maybe Text -> Text -> Text -> Text -> RedshiftSource
RedshiftSource'
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
"RedshiftTmpDir")
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
"TmpDirIAMRole")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Database")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Table")
)
instance Prelude.Hashable RedshiftSource where
hashWithSalt :: Int -> RedshiftSource -> Int
hashWithSalt Int
_salt RedshiftSource' {Maybe Text
Text
table :: Text
database :: Text
name :: Text
tmpDirIAMRole :: Maybe Text
redshiftTmpDir :: Maybe Text
$sel:table:RedshiftSource' :: RedshiftSource -> Text
$sel:database:RedshiftSource' :: RedshiftSource -> Text
$sel:name:RedshiftSource' :: RedshiftSource -> Text
$sel:tmpDirIAMRole:RedshiftSource' :: RedshiftSource -> Maybe Text
$sel:redshiftTmpDir:RedshiftSource' :: RedshiftSource -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
redshiftTmpDir
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tmpDirIAMRole
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
database
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
table
instance Prelude.NFData RedshiftSource where
rnf :: RedshiftSource -> ()
rnf RedshiftSource' {Maybe Text
Text
table :: Text
database :: Text
name :: Text
tmpDirIAMRole :: Maybe Text
redshiftTmpDir :: Maybe Text
$sel:table:RedshiftSource' :: RedshiftSource -> Text
$sel:database:RedshiftSource' :: RedshiftSource -> Text
$sel:name:RedshiftSource' :: RedshiftSource -> Text
$sel:tmpDirIAMRole:RedshiftSource' :: RedshiftSource -> Maybe Text
$sel:redshiftTmpDir:RedshiftSource' :: RedshiftSource -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
redshiftTmpDir
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tmpDirIAMRole
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
database
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
table
instance Data.ToJSON RedshiftSource where
toJSON :: RedshiftSource -> Value
toJSON RedshiftSource' {Maybe Text
Text
table :: Text
database :: Text
name :: Text
tmpDirIAMRole :: Maybe Text
redshiftTmpDir :: Maybe Text
$sel:table:RedshiftSource' :: RedshiftSource -> Text
$sel:database:RedshiftSource' :: RedshiftSource -> Text
$sel:name:RedshiftSource' :: RedshiftSource -> Text
$sel:tmpDirIAMRole:RedshiftSource' :: RedshiftSource -> Maybe Text
$sel:redshiftTmpDir:RedshiftSource' :: RedshiftSource -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"RedshiftTmpDir" 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
redshiftTmpDir,
(Key
"TmpDirIAMRole" 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
tmpDirIAMRole,
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"Database" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
database),
forall a. a -> Maybe a
Prelude.Just (Key
"Table" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
table)
]
)