{-# 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.JDBCConnectorSource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types.GlueSchema
import Amazonka.Glue.Types.JDBCConnectorOptions
import qualified Amazonka.Prelude as Prelude
data JDBCConnectorSource = JDBCConnectorSource'
{
JDBCConnectorSource -> Maybe JDBCConnectorOptions
additionalOptions :: Prelude.Maybe JDBCConnectorOptions,
JDBCConnectorSource -> Maybe Text
connectionTable :: Prelude.Maybe Prelude.Text,
JDBCConnectorSource -> Maybe [GlueSchema]
outputSchemas :: Prelude.Maybe [GlueSchema],
JDBCConnectorSource -> Maybe Text
query :: Prelude.Maybe Prelude.Text,
JDBCConnectorSource -> Text
name :: Prelude.Text,
JDBCConnectorSource -> Text
connectionName :: Prelude.Text,
JDBCConnectorSource -> Text
connectorName :: Prelude.Text,
JDBCConnectorSource -> Text
connectionType :: Prelude.Text
}
deriving (JDBCConnectorSource -> JDBCConnectorSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JDBCConnectorSource -> JDBCConnectorSource -> Bool
$c/= :: JDBCConnectorSource -> JDBCConnectorSource -> Bool
== :: JDBCConnectorSource -> JDBCConnectorSource -> Bool
$c== :: JDBCConnectorSource -> JDBCConnectorSource -> Bool
Prelude.Eq, ReadPrec [JDBCConnectorSource]
ReadPrec JDBCConnectorSource
Int -> ReadS JDBCConnectorSource
ReadS [JDBCConnectorSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JDBCConnectorSource]
$creadListPrec :: ReadPrec [JDBCConnectorSource]
readPrec :: ReadPrec JDBCConnectorSource
$creadPrec :: ReadPrec JDBCConnectorSource
readList :: ReadS [JDBCConnectorSource]
$creadList :: ReadS [JDBCConnectorSource]
readsPrec :: Int -> ReadS JDBCConnectorSource
$creadsPrec :: Int -> ReadS JDBCConnectorSource
Prelude.Read, Int -> JDBCConnectorSource -> ShowS
[JDBCConnectorSource] -> ShowS
JDBCConnectorSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JDBCConnectorSource] -> ShowS
$cshowList :: [JDBCConnectorSource] -> ShowS
show :: JDBCConnectorSource -> String
$cshow :: JDBCConnectorSource -> String
showsPrec :: Int -> JDBCConnectorSource -> ShowS
$cshowsPrec :: Int -> JDBCConnectorSource -> ShowS
Prelude.Show, forall x. Rep JDBCConnectorSource x -> JDBCConnectorSource
forall x. JDBCConnectorSource -> Rep JDBCConnectorSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JDBCConnectorSource x -> JDBCConnectorSource
$cfrom :: forall x. JDBCConnectorSource -> Rep JDBCConnectorSource x
Prelude.Generic)
newJDBCConnectorSource ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
JDBCConnectorSource
newJDBCConnectorSource :: Text -> Text -> Text -> Text -> JDBCConnectorSource
newJDBCConnectorSource
Text
pName_
Text
pConnectionName_
Text
pConnectorName_
Text
pConnectionType_ =
JDBCConnectorSource'
{ $sel:additionalOptions:JDBCConnectorSource' :: Maybe JDBCConnectorOptions
additionalOptions =
forall a. Maybe a
Prelude.Nothing,
$sel:connectionTable:JDBCConnectorSource' :: Maybe Text
connectionTable = forall a. Maybe a
Prelude.Nothing,
$sel:outputSchemas:JDBCConnectorSource' :: Maybe [GlueSchema]
outputSchemas = forall a. Maybe a
Prelude.Nothing,
$sel:query:JDBCConnectorSource' :: Maybe Text
query = forall a. Maybe a
Prelude.Nothing,
$sel:name:JDBCConnectorSource' :: Text
name = Text
pName_,
$sel:connectionName:JDBCConnectorSource' :: Text
connectionName = Text
pConnectionName_,
$sel:connectorName:JDBCConnectorSource' :: Text
connectorName = Text
pConnectorName_,
$sel:connectionType:JDBCConnectorSource' :: Text
connectionType = Text
pConnectionType_
}
jDBCConnectorSource_additionalOptions :: Lens.Lens' JDBCConnectorSource (Prelude.Maybe JDBCConnectorOptions)
jDBCConnectorSource_additionalOptions :: Lens' JDBCConnectorSource (Maybe JDBCConnectorOptions)
jDBCConnectorSource_additionalOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorSource' {Maybe JDBCConnectorOptions
additionalOptions :: Maybe JDBCConnectorOptions
$sel:additionalOptions:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe JDBCConnectorOptions
additionalOptions} -> Maybe JDBCConnectorOptions
additionalOptions) (\s :: JDBCConnectorSource
s@JDBCConnectorSource' {} Maybe JDBCConnectorOptions
a -> JDBCConnectorSource
s {$sel:additionalOptions:JDBCConnectorSource' :: Maybe JDBCConnectorOptions
additionalOptions = Maybe JDBCConnectorOptions
a} :: JDBCConnectorSource)
jDBCConnectorSource_connectionTable :: Lens.Lens' JDBCConnectorSource (Prelude.Maybe Prelude.Text)
jDBCConnectorSource_connectionTable :: Lens' JDBCConnectorSource (Maybe Text)
jDBCConnectorSource_connectionTable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorSource' {Maybe Text
connectionTable :: Maybe Text
$sel:connectionTable:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe Text
connectionTable} -> Maybe Text
connectionTable) (\s :: JDBCConnectorSource
s@JDBCConnectorSource' {} Maybe Text
a -> JDBCConnectorSource
s {$sel:connectionTable:JDBCConnectorSource' :: Maybe Text
connectionTable = Maybe Text
a} :: JDBCConnectorSource)
jDBCConnectorSource_outputSchemas :: Lens.Lens' JDBCConnectorSource (Prelude.Maybe [GlueSchema])
jDBCConnectorSource_outputSchemas :: Lens' JDBCConnectorSource (Maybe [GlueSchema])
jDBCConnectorSource_outputSchemas = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorSource' {Maybe [GlueSchema]
outputSchemas :: Maybe [GlueSchema]
$sel:outputSchemas:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe [GlueSchema]
outputSchemas} -> Maybe [GlueSchema]
outputSchemas) (\s :: JDBCConnectorSource
s@JDBCConnectorSource' {} Maybe [GlueSchema]
a -> JDBCConnectorSource
s {$sel:outputSchemas:JDBCConnectorSource' :: Maybe [GlueSchema]
outputSchemas = Maybe [GlueSchema]
a} :: JDBCConnectorSource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
jDBCConnectorSource_query :: Lens.Lens' JDBCConnectorSource (Prelude.Maybe Prelude.Text)
jDBCConnectorSource_query :: Lens' JDBCConnectorSource (Maybe Text)
jDBCConnectorSource_query = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorSource' {Maybe Text
query :: Maybe Text
$sel:query:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe Text
query} -> Maybe Text
query) (\s :: JDBCConnectorSource
s@JDBCConnectorSource' {} Maybe Text
a -> JDBCConnectorSource
s {$sel:query:JDBCConnectorSource' :: Maybe Text
query = Maybe Text
a} :: JDBCConnectorSource)
jDBCConnectorSource_name :: Lens.Lens' JDBCConnectorSource Prelude.Text
jDBCConnectorSource_name :: Lens' JDBCConnectorSource Text
jDBCConnectorSource_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorSource' {Text
name :: Text
$sel:name:JDBCConnectorSource' :: JDBCConnectorSource -> Text
name} -> Text
name) (\s :: JDBCConnectorSource
s@JDBCConnectorSource' {} Text
a -> JDBCConnectorSource
s {$sel:name:JDBCConnectorSource' :: Text
name = Text
a} :: JDBCConnectorSource)
jDBCConnectorSource_connectionName :: Lens.Lens' JDBCConnectorSource Prelude.Text
jDBCConnectorSource_connectionName :: Lens' JDBCConnectorSource Text
jDBCConnectorSource_connectionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorSource' {Text
connectionName :: Text
$sel:connectionName:JDBCConnectorSource' :: JDBCConnectorSource -> Text
connectionName} -> Text
connectionName) (\s :: JDBCConnectorSource
s@JDBCConnectorSource' {} Text
a -> JDBCConnectorSource
s {$sel:connectionName:JDBCConnectorSource' :: Text
connectionName = Text
a} :: JDBCConnectorSource)
jDBCConnectorSource_connectorName :: Lens.Lens' JDBCConnectorSource Prelude.Text
jDBCConnectorSource_connectorName :: Lens' JDBCConnectorSource Text
jDBCConnectorSource_connectorName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorSource' {Text
connectorName :: Text
$sel:connectorName:JDBCConnectorSource' :: JDBCConnectorSource -> Text
connectorName} -> Text
connectorName) (\s :: JDBCConnectorSource
s@JDBCConnectorSource' {} Text
a -> JDBCConnectorSource
s {$sel:connectorName:JDBCConnectorSource' :: Text
connectorName = Text
a} :: JDBCConnectorSource)
jDBCConnectorSource_connectionType :: Lens.Lens' JDBCConnectorSource Prelude.Text
jDBCConnectorSource_connectionType :: Lens' JDBCConnectorSource Text
jDBCConnectorSource_connectionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorSource' {Text
connectionType :: Text
$sel:connectionType:JDBCConnectorSource' :: JDBCConnectorSource -> Text
connectionType} -> Text
connectionType) (\s :: JDBCConnectorSource
s@JDBCConnectorSource' {} Text
a -> JDBCConnectorSource
s {$sel:connectionType:JDBCConnectorSource' :: Text
connectionType = Text
a} :: JDBCConnectorSource)
instance Data.FromJSON JDBCConnectorSource where
parseJSON :: Value -> Parser JDBCConnectorSource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"JDBCConnectorSource"
( \Object
x ->
Maybe JDBCConnectorOptions
-> Maybe Text
-> Maybe [GlueSchema]
-> Maybe Text
-> Text
-> Text
-> Text
-> Text
-> JDBCConnectorSource
JDBCConnectorSource'
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
"AdditionalOptions")
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
"ConnectionTable")
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
"OutputSchemas" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"Query")
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
"ConnectionName")
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
"ConnectorName")
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
"ConnectionType")
)
instance Prelude.Hashable JDBCConnectorSource where
hashWithSalt :: Int -> JDBCConnectorSource -> Int
hashWithSalt Int
_salt JDBCConnectorSource' {Maybe [GlueSchema]
Maybe Text
Maybe JDBCConnectorOptions
Text
connectionType :: Text
connectorName :: Text
connectionName :: Text
name :: Text
query :: Maybe Text
outputSchemas :: Maybe [GlueSchema]
connectionTable :: Maybe Text
additionalOptions :: Maybe JDBCConnectorOptions
$sel:connectionType:JDBCConnectorSource' :: JDBCConnectorSource -> Text
$sel:connectorName:JDBCConnectorSource' :: JDBCConnectorSource -> Text
$sel:connectionName:JDBCConnectorSource' :: JDBCConnectorSource -> Text
$sel:name:JDBCConnectorSource' :: JDBCConnectorSource -> Text
$sel:query:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe Text
$sel:outputSchemas:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe [GlueSchema]
$sel:connectionTable:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe Text
$sel:additionalOptions:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe JDBCConnectorOptions
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe JDBCConnectorOptions
additionalOptions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectionTable
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [GlueSchema]
outputSchemas
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
query
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
connectionName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
connectorName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
connectionType
instance Prelude.NFData JDBCConnectorSource where
rnf :: JDBCConnectorSource -> ()
rnf JDBCConnectorSource' {Maybe [GlueSchema]
Maybe Text
Maybe JDBCConnectorOptions
Text
connectionType :: Text
connectorName :: Text
connectionName :: Text
name :: Text
query :: Maybe Text
outputSchemas :: Maybe [GlueSchema]
connectionTable :: Maybe Text
additionalOptions :: Maybe JDBCConnectorOptions
$sel:connectionType:JDBCConnectorSource' :: JDBCConnectorSource -> Text
$sel:connectorName:JDBCConnectorSource' :: JDBCConnectorSource -> Text
$sel:connectionName:JDBCConnectorSource' :: JDBCConnectorSource -> Text
$sel:name:JDBCConnectorSource' :: JDBCConnectorSource -> Text
$sel:query:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe Text
$sel:outputSchemas:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe [GlueSchema]
$sel:connectionTable:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe Text
$sel:additionalOptions:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe JDBCConnectorOptions
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe JDBCConnectorOptions
additionalOptions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectionTable
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [GlueSchema]
outputSchemas
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
query
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
connectionName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
connectorName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
connectionType
instance Data.ToJSON JDBCConnectorSource where
toJSON :: JDBCConnectorSource -> Value
toJSON JDBCConnectorSource' {Maybe [GlueSchema]
Maybe Text
Maybe JDBCConnectorOptions
Text
connectionType :: Text
connectorName :: Text
connectionName :: Text
name :: Text
query :: Maybe Text
outputSchemas :: Maybe [GlueSchema]
connectionTable :: Maybe Text
additionalOptions :: Maybe JDBCConnectorOptions
$sel:connectionType:JDBCConnectorSource' :: JDBCConnectorSource -> Text
$sel:connectorName:JDBCConnectorSource' :: JDBCConnectorSource -> Text
$sel:connectionName:JDBCConnectorSource' :: JDBCConnectorSource -> Text
$sel:name:JDBCConnectorSource' :: JDBCConnectorSource -> Text
$sel:query:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe Text
$sel:outputSchemas:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe [GlueSchema]
$sel:connectionTable:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe Text
$sel:additionalOptions:JDBCConnectorSource' :: JDBCConnectorSource -> Maybe JDBCConnectorOptions
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AdditionalOptions" 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 JDBCConnectorOptions
additionalOptions,
(Key
"ConnectionTable" 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
connectionTable,
(Key
"OutputSchemas" 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 [GlueSchema]
outputSchemas,
(Key
"Query" 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
query,
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
"ConnectionName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
connectionName),
forall a. a -> Maybe a
Prelude.Just (Key
"ConnectorName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
connectorName),
forall a. a -> Maybe a
Prelude.Just
(Key
"ConnectionType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
connectionType)
]
)