{-# 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.CatalogEntry where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CatalogEntry = CatalogEntry'
{
CatalogEntry -> Text
databaseName :: Prelude.Text,
CatalogEntry -> Text
tableName :: Prelude.Text
}
deriving (CatalogEntry -> CatalogEntry -> Bool
(CatalogEntry -> CatalogEntry -> Bool)
-> (CatalogEntry -> CatalogEntry -> Bool) -> Eq CatalogEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CatalogEntry -> CatalogEntry -> Bool
$c/= :: CatalogEntry -> CatalogEntry -> Bool
== :: CatalogEntry -> CatalogEntry -> Bool
$c== :: CatalogEntry -> CatalogEntry -> Bool
Prelude.Eq, ReadPrec [CatalogEntry]
ReadPrec CatalogEntry
Int -> ReadS CatalogEntry
ReadS [CatalogEntry]
(Int -> ReadS CatalogEntry)
-> ReadS [CatalogEntry]
-> ReadPrec CatalogEntry
-> ReadPrec [CatalogEntry]
-> Read CatalogEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CatalogEntry]
$creadListPrec :: ReadPrec [CatalogEntry]
readPrec :: ReadPrec CatalogEntry
$creadPrec :: ReadPrec CatalogEntry
readList :: ReadS [CatalogEntry]
$creadList :: ReadS [CatalogEntry]
readsPrec :: Int -> ReadS CatalogEntry
$creadsPrec :: Int -> ReadS CatalogEntry
Prelude.Read, Int -> CatalogEntry -> ShowS
[CatalogEntry] -> ShowS
CatalogEntry -> String
(Int -> CatalogEntry -> ShowS)
-> (CatalogEntry -> String)
-> ([CatalogEntry] -> ShowS)
-> Show CatalogEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CatalogEntry] -> ShowS
$cshowList :: [CatalogEntry] -> ShowS
show :: CatalogEntry -> String
$cshow :: CatalogEntry -> String
showsPrec :: Int -> CatalogEntry -> ShowS
$cshowsPrec :: Int -> CatalogEntry -> ShowS
Prelude.Show, (forall x. CatalogEntry -> Rep CatalogEntry x)
-> (forall x. Rep CatalogEntry x -> CatalogEntry)
-> Generic CatalogEntry
forall x. Rep CatalogEntry x -> CatalogEntry
forall x. CatalogEntry -> Rep CatalogEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CatalogEntry x -> CatalogEntry
$cfrom :: forall x. CatalogEntry -> Rep CatalogEntry x
Prelude.Generic)
newCatalogEntry ::
Prelude.Text ->
Prelude.Text ->
CatalogEntry
newCatalogEntry :: Text -> Text -> CatalogEntry
newCatalogEntry Text
pDatabaseName_ Text
pTableName_ =
CatalogEntry' :: Text -> Text -> CatalogEntry
CatalogEntry'
{ $sel:databaseName:CatalogEntry' :: Text
databaseName = Text
pDatabaseName_,
$sel:tableName:CatalogEntry' :: Text
tableName = Text
pTableName_
}
catalogEntry_databaseName :: Lens.Lens' CatalogEntry Prelude.Text
catalogEntry_databaseName :: (Text -> f Text) -> CatalogEntry -> f CatalogEntry
catalogEntry_databaseName = (CatalogEntry -> Text)
-> (CatalogEntry -> Text -> CatalogEntry)
-> Lens CatalogEntry CatalogEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CatalogEntry' {Text
databaseName :: Text
$sel:databaseName:CatalogEntry' :: CatalogEntry -> Text
databaseName} -> Text
databaseName) (\s :: CatalogEntry
s@CatalogEntry' {} Text
a -> CatalogEntry
s {$sel:databaseName:CatalogEntry' :: Text
databaseName = Text
a} :: CatalogEntry)
catalogEntry_tableName :: Lens.Lens' CatalogEntry Prelude.Text
catalogEntry_tableName :: (Text -> f Text) -> CatalogEntry -> f CatalogEntry
catalogEntry_tableName = (CatalogEntry -> Text)
-> (CatalogEntry -> Text -> CatalogEntry)
-> Lens CatalogEntry CatalogEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CatalogEntry' {Text
tableName :: Text
$sel:tableName:CatalogEntry' :: CatalogEntry -> Text
tableName} -> Text
tableName) (\s :: CatalogEntry
s@CatalogEntry' {} Text
a -> CatalogEntry
s {$sel:tableName:CatalogEntry' :: Text
tableName = Text
a} :: CatalogEntry)
instance Prelude.Hashable CatalogEntry
instance Prelude.NFData CatalogEntry
instance Core.ToJSON CatalogEntry where
toJSON :: CatalogEntry -> Value
toJSON CatalogEntry' {Text
tableName :: Text
databaseName :: Text
$sel:tableName:CatalogEntry' :: CatalogEntry -> Text
$sel:databaseName:CatalogEntry' :: CatalogEntry -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DatabaseName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
databaseName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TableName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
tableName)
]
)