{-# 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.MappingEntry 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 MappingEntry = MappingEntry'
{
MappingEntry -> Maybe Text
sourcePath :: Prelude.Maybe Prelude.Text,
MappingEntry -> Maybe Text
sourceTable :: Prelude.Maybe Prelude.Text,
MappingEntry -> Maybe Text
sourceType :: Prelude.Maybe Prelude.Text,
MappingEntry -> Maybe Text
targetPath :: Prelude.Maybe Prelude.Text,
MappingEntry -> Maybe Text
targetTable :: Prelude.Maybe Prelude.Text,
MappingEntry -> Maybe Text
targetType :: Prelude.Maybe Prelude.Text
}
deriving (MappingEntry -> MappingEntry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MappingEntry -> MappingEntry -> Bool
$c/= :: MappingEntry -> MappingEntry -> Bool
== :: MappingEntry -> MappingEntry -> Bool
$c== :: MappingEntry -> MappingEntry -> Bool
Prelude.Eq, ReadPrec [MappingEntry]
ReadPrec MappingEntry
Int -> ReadS MappingEntry
ReadS [MappingEntry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MappingEntry]
$creadListPrec :: ReadPrec [MappingEntry]
readPrec :: ReadPrec MappingEntry
$creadPrec :: ReadPrec MappingEntry
readList :: ReadS [MappingEntry]
$creadList :: ReadS [MappingEntry]
readsPrec :: Int -> ReadS MappingEntry
$creadsPrec :: Int -> ReadS MappingEntry
Prelude.Read, Int -> MappingEntry -> ShowS
[MappingEntry] -> ShowS
MappingEntry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MappingEntry] -> ShowS
$cshowList :: [MappingEntry] -> ShowS
show :: MappingEntry -> String
$cshow :: MappingEntry -> String
showsPrec :: Int -> MappingEntry -> ShowS
$cshowsPrec :: Int -> MappingEntry -> ShowS
Prelude.Show, forall x. Rep MappingEntry x -> MappingEntry
forall x. MappingEntry -> Rep MappingEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MappingEntry x -> MappingEntry
$cfrom :: forall x. MappingEntry -> Rep MappingEntry x
Prelude.Generic)
newMappingEntry ::
MappingEntry
newMappingEntry :: MappingEntry
newMappingEntry =
MappingEntry'
{ $sel:sourcePath:MappingEntry' :: Maybe Text
sourcePath = forall a. Maybe a
Prelude.Nothing,
$sel:sourceTable:MappingEntry' :: Maybe Text
sourceTable = forall a. Maybe a
Prelude.Nothing,
$sel:sourceType:MappingEntry' :: Maybe Text
sourceType = forall a. Maybe a
Prelude.Nothing,
$sel:targetPath:MappingEntry' :: Maybe Text
targetPath = forall a. Maybe a
Prelude.Nothing,
$sel:targetTable:MappingEntry' :: Maybe Text
targetTable = forall a. Maybe a
Prelude.Nothing,
$sel:targetType:MappingEntry' :: Maybe Text
targetType = forall a. Maybe a
Prelude.Nothing
}
mappingEntry_sourcePath :: Lens.Lens' MappingEntry (Prelude.Maybe Prelude.Text)
mappingEntry_sourcePath :: Lens' MappingEntry (Maybe Text)
mappingEntry_sourcePath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MappingEntry' {Maybe Text
sourcePath :: Maybe Text
$sel:sourcePath:MappingEntry' :: MappingEntry -> Maybe Text
sourcePath} -> Maybe Text
sourcePath) (\s :: MappingEntry
s@MappingEntry' {} Maybe Text
a -> MappingEntry
s {$sel:sourcePath:MappingEntry' :: Maybe Text
sourcePath = Maybe Text
a} :: MappingEntry)
mappingEntry_sourceTable :: Lens.Lens' MappingEntry (Prelude.Maybe Prelude.Text)
mappingEntry_sourceTable :: Lens' MappingEntry (Maybe Text)
mappingEntry_sourceTable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MappingEntry' {Maybe Text
sourceTable :: Maybe Text
$sel:sourceTable:MappingEntry' :: MappingEntry -> Maybe Text
sourceTable} -> Maybe Text
sourceTable) (\s :: MappingEntry
s@MappingEntry' {} Maybe Text
a -> MappingEntry
s {$sel:sourceTable:MappingEntry' :: Maybe Text
sourceTable = Maybe Text
a} :: MappingEntry)
mappingEntry_sourceType :: Lens.Lens' MappingEntry (Prelude.Maybe Prelude.Text)
mappingEntry_sourceType :: Lens' MappingEntry (Maybe Text)
mappingEntry_sourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MappingEntry' {Maybe Text
sourceType :: Maybe Text
$sel:sourceType:MappingEntry' :: MappingEntry -> Maybe Text
sourceType} -> Maybe Text
sourceType) (\s :: MappingEntry
s@MappingEntry' {} Maybe Text
a -> MappingEntry
s {$sel:sourceType:MappingEntry' :: Maybe Text
sourceType = Maybe Text
a} :: MappingEntry)
mappingEntry_targetPath :: Lens.Lens' MappingEntry (Prelude.Maybe Prelude.Text)
mappingEntry_targetPath :: Lens' MappingEntry (Maybe Text)
mappingEntry_targetPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MappingEntry' {Maybe Text
targetPath :: Maybe Text
$sel:targetPath:MappingEntry' :: MappingEntry -> Maybe Text
targetPath} -> Maybe Text
targetPath) (\s :: MappingEntry
s@MappingEntry' {} Maybe Text
a -> MappingEntry
s {$sel:targetPath:MappingEntry' :: Maybe Text
targetPath = Maybe Text
a} :: MappingEntry)
mappingEntry_targetTable :: Lens.Lens' MappingEntry (Prelude.Maybe Prelude.Text)
mappingEntry_targetTable :: Lens' MappingEntry (Maybe Text)
mappingEntry_targetTable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MappingEntry' {Maybe Text
targetTable :: Maybe Text
$sel:targetTable:MappingEntry' :: MappingEntry -> Maybe Text
targetTable} -> Maybe Text
targetTable) (\s :: MappingEntry
s@MappingEntry' {} Maybe Text
a -> MappingEntry
s {$sel:targetTable:MappingEntry' :: Maybe Text
targetTable = Maybe Text
a} :: MappingEntry)
mappingEntry_targetType :: Lens.Lens' MappingEntry (Prelude.Maybe Prelude.Text)
mappingEntry_targetType :: Lens' MappingEntry (Maybe Text)
mappingEntry_targetType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MappingEntry' {Maybe Text
targetType :: Maybe Text
$sel:targetType:MappingEntry' :: MappingEntry -> Maybe Text
targetType} -> Maybe Text
targetType) (\s :: MappingEntry
s@MappingEntry' {} Maybe Text
a -> MappingEntry
s {$sel:targetType:MappingEntry' :: Maybe Text
targetType = Maybe Text
a} :: MappingEntry)
instance Data.FromJSON MappingEntry where
parseJSON :: Value -> Parser MappingEntry
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"MappingEntry"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MappingEntry
MappingEntry'
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
"SourcePath")
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
"SourceTable")
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
"SourceType")
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
"TargetPath")
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
"TargetTable")
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
"TargetType")
)
instance Prelude.Hashable MappingEntry where
hashWithSalt :: Int -> MappingEntry -> Int
hashWithSalt Int
_salt MappingEntry' {Maybe Text
targetType :: Maybe Text
targetTable :: Maybe Text
targetPath :: Maybe Text
sourceType :: Maybe Text
sourceTable :: Maybe Text
sourcePath :: Maybe Text
$sel:targetType:MappingEntry' :: MappingEntry -> Maybe Text
$sel:targetTable:MappingEntry' :: MappingEntry -> Maybe Text
$sel:targetPath:MappingEntry' :: MappingEntry -> Maybe Text
$sel:sourceType:MappingEntry' :: MappingEntry -> Maybe Text
$sel:sourceTable:MappingEntry' :: MappingEntry -> Maybe Text
$sel:sourcePath:MappingEntry' :: MappingEntry -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourcePath
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceTable
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
targetPath
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
targetTable
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
targetType
instance Prelude.NFData MappingEntry where
rnf :: MappingEntry -> ()
rnf MappingEntry' {Maybe Text
targetType :: Maybe Text
targetTable :: Maybe Text
targetPath :: Maybe Text
sourceType :: Maybe Text
sourceTable :: Maybe Text
sourcePath :: Maybe Text
$sel:targetType:MappingEntry' :: MappingEntry -> Maybe Text
$sel:targetTable:MappingEntry' :: MappingEntry -> Maybe Text
$sel:targetPath:MappingEntry' :: MappingEntry -> Maybe Text
$sel:sourceType:MappingEntry' :: MappingEntry -> Maybe Text
$sel:sourceTable:MappingEntry' :: MappingEntry -> Maybe Text
$sel:sourcePath:MappingEntry' :: MappingEntry -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourcePath
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceTable
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetPath
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetTable
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetType
instance Data.ToJSON MappingEntry where
toJSON :: MappingEntry -> Value
toJSON MappingEntry' {Maybe Text
targetType :: Maybe Text
targetTable :: Maybe Text
targetPath :: Maybe Text
sourceType :: Maybe Text
sourceTable :: Maybe Text
sourcePath :: Maybe Text
$sel:targetType:MappingEntry' :: MappingEntry -> Maybe Text
$sel:targetTable:MappingEntry' :: MappingEntry -> Maybe Text
$sel:targetPath:MappingEntry' :: MappingEntry -> Maybe Text
$sel:sourceType:MappingEntry' :: MappingEntry -> Maybe Text
$sel:sourceTable:MappingEntry' :: MappingEntry -> Maybe Text
$sel:sourcePath:MappingEntry' :: MappingEntry -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"SourcePath" 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
sourcePath,
(Key
"SourceTable" 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
sourceTable,
(Key
"SourceType" 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
sourceType,
(Key
"TargetPath" 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
targetPath,
(Key
"TargetTable" 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
targetTable,
(Key
"TargetType" 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
targetType
]
)