{-# 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.MySQLCatalogSource 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 MySQLCatalogSource = MySQLCatalogSource'
{
MySQLCatalogSource -> Text
name :: Prelude.Text,
MySQLCatalogSource -> Text
database :: Prelude.Text,
MySQLCatalogSource -> Text
table :: Prelude.Text
}
deriving (MySQLCatalogSource -> MySQLCatalogSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MySQLCatalogSource -> MySQLCatalogSource -> Bool
$c/= :: MySQLCatalogSource -> MySQLCatalogSource -> Bool
== :: MySQLCatalogSource -> MySQLCatalogSource -> Bool
$c== :: MySQLCatalogSource -> MySQLCatalogSource -> Bool
Prelude.Eq, ReadPrec [MySQLCatalogSource]
ReadPrec MySQLCatalogSource
Int -> ReadS MySQLCatalogSource
ReadS [MySQLCatalogSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MySQLCatalogSource]
$creadListPrec :: ReadPrec [MySQLCatalogSource]
readPrec :: ReadPrec MySQLCatalogSource
$creadPrec :: ReadPrec MySQLCatalogSource
readList :: ReadS [MySQLCatalogSource]
$creadList :: ReadS [MySQLCatalogSource]
readsPrec :: Int -> ReadS MySQLCatalogSource
$creadsPrec :: Int -> ReadS MySQLCatalogSource
Prelude.Read, Int -> MySQLCatalogSource -> ShowS
[MySQLCatalogSource] -> ShowS
MySQLCatalogSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MySQLCatalogSource] -> ShowS
$cshowList :: [MySQLCatalogSource] -> ShowS
show :: MySQLCatalogSource -> String
$cshow :: MySQLCatalogSource -> String
showsPrec :: Int -> MySQLCatalogSource -> ShowS
$cshowsPrec :: Int -> MySQLCatalogSource -> ShowS
Prelude.Show, forall x. Rep MySQLCatalogSource x -> MySQLCatalogSource
forall x. MySQLCatalogSource -> Rep MySQLCatalogSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MySQLCatalogSource x -> MySQLCatalogSource
$cfrom :: forall x. MySQLCatalogSource -> Rep MySQLCatalogSource x
Prelude.Generic)
newMySQLCatalogSource ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
MySQLCatalogSource
newMySQLCatalogSource :: Text -> Text -> Text -> MySQLCatalogSource
newMySQLCatalogSource Text
pName_ Text
pDatabase_ Text
pTable_ =
MySQLCatalogSource'
{ $sel:name:MySQLCatalogSource' :: Text
name = Text
pName_,
$sel:database:MySQLCatalogSource' :: Text
database = Text
pDatabase_,
$sel:table:MySQLCatalogSource' :: Text
table = Text
pTable_
}
mySQLCatalogSource_name :: Lens.Lens' MySQLCatalogSource Prelude.Text
mySQLCatalogSource_name :: Lens' MySQLCatalogSource Text
mySQLCatalogSource_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MySQLCatalogSource' {Text
name :: Text
$sel:name:MySQLCatalogSource' :: MySQLCatalogSource -> Text
name} -> Text
name) (\s :: MySQLCatalogSource
s@MySQLCatalogSource' {} Text
a -> MySQLCatalogSource
s {$sel:name:MySQLCatalogSource' :: Text
name = Text
a} :: MySQLCatalogSource)
mySQLCatalogSource_database :: Lens.Lens' MySQLCatalogSource Prelude.Text
mySQLCatalogSource_database :: Lens' MySQLCatalogSource Text
mySQLCatalogSource_database = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MySQLCatalogSource' {Text
database :: Text
$sel:database:MySQLCatalogSource' :: MySQLCatalogSource -> Text
database} -> Text
database) (\s :: MySQLCatalogSource
s@MySQLCatalogSource' {} Text
a -> MySQLCatalogSource
s {$sel:database:MySQLCatalogSource' :: Text
database = Text
a} :: MySQLCatalogSource)
mySQLCatalogSource_table :: Lens.Lens' MySQLCatalogSource Prelude.Text
mySQLCatalogSource_table :: Lens' MySQLCatalogSource Text
mySQLCatalogSource_table = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MySQLCatalogSource' {Text
table :: Text
$sel:table:MySQLCatalogSource' :: MySQLCatalogSource -> Text
table} -> Text
table) (\s :: MySQLCatalogSource
s@MySQLCatalogSource' {} Text
a -> MySQLCatalogSource
s {$sel:table:MySQLCatalogSource' :: Text
table = Text
a} :: MySQLCatalogSource)
instance Data.FromJSON MySQLCatalogSource where
parseJSON :: Value -> Parser MySQLCatalogSource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"MySQLCatalogSource"
( \Object
x ->
Text -> Text -> Text -> MySQLCatalogSource
MySQLCatalogSource'
forall (f :: * -> *) a b. Functor 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 MySQLCatalogSource where
hashWithSalt :: Int -> MySQLCatalogSource -> Int
hashWithSalt Int
_salt MySQLCatalogSource' {Text
table :: Text
database :: Text
name :: Text
$sel:table:MySQLCatalogSource' :: MySQLCatalogSource -> Text
$sel:database:MySQLCatalogSource' :: MySQLCatalogSource -> Text
$sel:name:MySQLCatalogSource' :: MySQLCatalogSource -> Text
..} =
Int
_salt
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 MySQLCatalogSource where
rnf :: MySQLCatalogSource -> ()
rnf MySQLCatalogSource' {Text
table :: Text
database :: Text
name :: Text
$sel:table:MySQLCatalogSource' :: MySQLCatalogSource -> Text
$sel:database:MySQLCatalogSource' :: MySQLCatalogSource -> Text
$sel:name:MySQLCatalogSource' :: MySQLCatalogSource -> Text
..} =
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 MySQLCatalogSource where
toJSON :: MySQLCatalogSource -> Value
toJSON MySQLCatalogSource' {Text
table :: Text
database :: Text
name :: Text
$sel:table:MySQLCatalogSource' :: MySQLCatalogSource -> Text
$sel:database:MySQLCatalogSource' :: MySQLCatalogSource -> Text
$sel:name:MySQLCatalogSource' :: MySQLCatalogSource -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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)
]
)