{-# 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.JDBCConnectorTarget 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 qualified Amazonka.Prelude as Prelude
data JDBCConnectorTarget = JDBCConnectorTarget'
{
JDBCConnectorTarget -> Maybe (HashMap Text Text)
additionalOptions :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
JDBCConnectorTarget -> Maybe [GlueSchema]
outputSchemas :: Prelude.Maybe [GlueSchema],
JDBCConnectorTarget -> Text
name :: Prelude.Text,
JDBCConnectorTarget -> NonEmpty Text
inputs :: Prelude.NonEmpty Prelude.Text,
JDBCConnectorTarget -> Text
connectionName :: Prelude.Text,
JDBCConnectorTarget -> Text
connectionTable :: Prelude.Text,
JDBCConnectorTarget -> Text
connectorName :: Prelude.Text,
JDBCConnectorTarget -> Text
connectionType :: Prelude.Text
}
deriving (JDBCConnectorTarget -> JDBCConnectorTarget -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JDBCConnectorTarget -> JDBCConnectorTarget -> Bool
$c/= :: JDBCConnectorTarget -> JDBCConnectorTarget -> Bool
== :: JDBCConnectorTarget -> JDBCConnectorTarget -> Bool
$c== :: JDBCConnectorTarget -> JDBCConnectorTarget -> Bool
Prelude.Eq, ReadPrec [JDBCConnectorTarget]
ReadPrec JDBCConnectorTarget
Int -> ReadS JDBCConnectorTarget
ReadS [JDBCConnectorTarget]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JDBCConnectorTarget]
$creadListPrec :: ReadPrec [JDBCConnectorTarget]
readPrec :: ReadPrec JDBCConnectorTarget
$creadPrec :: ReadPrec JDBCConnectorTarget
readList :: ReadS [JDBCConnectorTarget]
$creadList :: ReadS [JDBCConnectorTarget]
readsPrec :: Int -> ReadS JDBCConnectorTarget
$creadsPrec :: Int -> ReadS JDBCConnectorTarget
Prelude.Read, Int -> JDBCConnectorTarget -> ShowS
[JDBCConnectorTarget] -> ShowS
JDBCConnectorTarget -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JDBCConnectorTarget] -> ShowS
$cshowList :: [JDBCConnectorTarget] -> ShowS
show :: JDBCConnectorTarget -> String
$cshow :: JDBCConnectorTarget -> String
showsPrec :: Int -> JDBCConnectorTarget -> ShowS
$cshowsPrec :: Int -> JDBCConnectorTarget -> ShowS
Prelude.Show, forall x. Rep JDBCConnectorTarget x -> JDBCConnectorTarget
forall x. JDBCConnectorTarget -> Rep JDBCConnectorTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JDBCConnectorTarget x -> JDBCConnectorTarget
$cfrom :: forall x. JDBCConnectorTarget -> Rep JDBCConnectorTarget x
Prelude.Generic)
newJDBCConnectorTarget ::
Prelude.Text ->
Prelude.NonEmpty Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
JDBCConnectorTarget
newJDBCConnectorTarget :: Text
-> NonEmpty Text
-> Text
-> Text
-> Text
-> Text
-> JDBCConnectorTarget
newJDBCConnectorTarget
Text
pName_
NonEmpty Text
pInputs_
Text
pConnectionName_
Text
pConnectionTable_
Text
pConnectorName_
Text
pConnectionType_ =
JDBCConnectorTarget'
{ $sel:additionalOptions:JDBCConnectorTarget' :: Maybe (HashMap Text Text)
additionalOptions =
forall a. Maybe a
Prelude.Nothing,
$sel:outputSchemas:JDBCConnectorTarget' :: Maybe [GlueSchema]
outputSchemas = forall a. Maybe a
Prelude.Nothing,
$sel:name:JDBCConnectorTarget' :: Text
name = Text
pName_,
$sel:inputs:JDBCConnectorTarget' :: NonEmpty Text
inputs = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pInputs_,
$sel:connectionName:JDBCConnectorTarget' :: Text
connectionName = Text
pConnectionName_,
$sel:connectionTable:JDBCConnectorTarget' :: Text
connectionTable = Text
pConnectionTable_,
$sel:connectorName:JDBCConnectorTarget' :: Text
connectorName = Text
pConnectorName_,
$sel:connectionType:JDBCConnectorTarget' :: Text
connectionType = Text
pConnectionType_
}
jDBCConnectorTarget_additionalOptions :: Lens.Lens' JDBCConnectorTarget (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
jDBCConnectorTarget_additionalOptions :: Lens' JDBCConnectorTarget (Maybe (HashMap Text Text))
jDBCConnectorTarget_additionalOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorTarget' {Maybe (HashMap Text Text)
additionalOptions :: Maybe (HashMap Text Text)
$sel:additionalOptions:JDBCConnectorTarget' :: JDBCConnectorTarget -> Maybe (HashMap Text Text)
additionalOptions} -> Maybe (HashMap Text Text)
additionalOptions) (\s :: JDBCConnectorTarget
s@JDBCConnectorTarget' {} Maybe (HashMap Text Text)
a -> JDBCConnectorTarget
s {$sel:additionalOptions:JDBCConnectorTarget' :: Maybe (HashMap Text Text)
additionalOptions = Maybe (HashMap Text Text)
a} :: JDBCConnectorTarget) 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
jDBCConnectorTarget_outputSchemas :: Lens.Lens' JDBCConnectorTarget (Prelude.Maybe [GlueSchema])
jDBCConnectorTarget_outputSchemas :: Lens' JDBCConnectorTarget (Maybe [GlueSchema])
jDBCConnectorTarget_outputSchemas = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorTarget' {Maybe [GlueSchema]
outputSchemas :: Maybe [GlueSchema]
$sel:outputSchemas:JDBCConnectorTarget' :: JDBCConnectorTarget -> Maybe [GlueSchema]
outputSchemas} -> Maybe [GlueSchema]
outputSchemas) (\s :: JDBCConnectorTarget
s@JDBCConnectorTarget' {} Maybe [GlueSchema]
a -> JDBCConnectorTarget
s {$sel:outputSchemas:JDBCConnectorTarget' :: Maybe [GlueSchema]
outputSchemas = Maybe [GlueSchema]
a} :: JDBCConnectorTarget) 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
jDBCConnectorTarget_name :: Lens.Lens' JDBCConnectorTarget Prelude.Text
jDBCConnectorTarget_name :: Lens' JDBCConnectorTarget Text
jDBCConnectorTarget_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorTarget' {Text
name :: Text
$sel:name:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
name} -> Text
name) (\s :: JDBCConnectorTarget
s@JDBCConnectorTarget' {} Text
a -> JDBCConnectorTarget
s {$sel:name:JDBCConnectorTarget' :: Text
name = Text
a} :: JDBCConnectorTarget)
jDBCConnectorTarget_inputs :: Lens.Lens' JDBCConnectorTarget (Prelude.NonEmpty Prelude.Text)
jDBCConnectorTarget_inputs :: Lens' JDBCConnectorTarget (NonEmpty Text)
jDBCConnectorTarget_inputs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorTarget' {NonEmpty Text
inputs :: NonEmpty Text
$sel:inputs:JDBCConnectorTarget' :: JDBCConnectorTarget -> NonEmpty Text
inputs} -> NonEmpty Text
inputs) (\s :: JDBCConnectorTarget
s@JDBCConnectorTarget' {} NonEmpty Text
a -> JDBCConnectorTarget
s {$sel:inputs:JDBCConnectorTarget' :: NonEmpty Text
inputs = NonEmpty Text
a} :: JDBCConnectorTarget) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
jDBCConnectorTarget_connectionName :: Lens.Lens' JDBCConnectorTarget Prelude.Text
jDBCConnectorTarget_connectionName :: Lens' JDBCConnectorTarget Text
jDBCConnectorTarget_connectionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorTarget' {Text
connectionName :: Text
$sel:connectionName:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
connectionName} -> Text
connectionName) (\s :: JDBCConnectorTarget
s@JDBCConnectorTarget' {} Text
a -> JDBCConnectorTarget
s {$sel:connectionName:JDBCConnectorTarget' :: Text
connectionName = Text
a} :: JDBCConnectorTarget)
jDBCConnectorTarget_connectionTable :: Lens.Lens' JDBCConnectorTarget Prelude.Text
jDBCConnectorTarget_connectionTable :: Lens' JDBCConnectorTarget Text
jDBCConnectorTarget_connectionTable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorTarget' {Text
connectionTable :: Text
$sel:connectionTable:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
connectionTable} -> Text
connectionTable) (\s :: JDBCConnectorTarget
s@JDBCConnectorTarget' {} Text
a -> JDBCConnectorTarget
s {$sel:connectionTable:JDBCConnectorTarget' :: Text
connectionTable = Text
a} :: JDBCConnectorTarget)
jDBCConnectorTarget_connectorName :: Lens.Lens' JDBCConnectorTarget Prelude.Text
jDBCConnectorTarget_connectorName :: Lens' JDBCConnectorTarget Text
jDBCConnectorTarget_connectorName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorTarget' {Text
connectorName :: Text
$sel:connectorName:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
connectorName} -> Text
connectorName) (\s :: JDBCConnectorTarget
s@JDBCConnectorTarget' {} Text
a -> JDBCConnectorTarget
s {$sel:connectorName:JDBCConnectorTarget' :: Text
connectorName = Text
a} :: JDBCConnectorTarget)
jDBCConnectorTarget_connectionType :: Lens.Lens' JDBCConnectorTarget Prelude.Text
jDBCConnectorTarget_connectionType :: Lens' JDBCConnectorTarget Text
jDBCConnectorTarget_connectionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JDBCConnectorTarget' {Text
connectionType :: Text
$sel:connectionType:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
connectionType} -> Text
connectionType) (\s :: JDBCConnectorTarget
s@JDBCConnectorTarget' {} Text
a -> JDBCConnectorTarget
s {$sel:connectionType:JDBCConnectorTarget' :: Text
connectionType = Text
a} :: JDBCConnectorTarget)
instance Data.FromJSON JDBCConnectorTarget where
parseJSON :: Value -> Parser JDBCConnectorTarget
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"JDBCConnectorTarget"
( \Object
x ->
Maybe (HashMap Text Text)
-> Maybe [GlueSchema]
-> Text
-> NonEmpty Text
-> Text
-> Text
-> Text
-> Text
-> JDBCConnectorTarget
JDBCConnectorTarget'
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 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
"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 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
"Inputs")
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
"ConnectionTable")
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 JDBCConnectorTarget where
hashWithSalt :: Int -> JDBCConnectorTarget -> Int
hashWithSalt Int
_salt JDBCConnectorTarget' {Maybe [GlueSchema]
Maybe (HashMap Text Text)
NonEmpty Text
Text
connectionType :: Text
connectorName :: Text
connectionTable :: Text
connectionName :: Text
inputs :: NonEmpty Text
name :: Text
outputSchemas :: Maybe [GlueSchema]
additionalOptions :: Maybe (HashMap Text Text)
$sel:connectionType:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:connectorName:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:connectionTable:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:connectionName:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:inputs:JDBCConnectorTarget' :: JDBCConnectorTarget -> NonEmpty Text
$sel:name:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:outputSchemas:JDBCConnectorTarget' :: JDBCConnectorTarget -> Maybe [GlueSchema]
$sel:additionalOptions:JDBCConnectorTarget' :: JDBCConnectorTarget -> Maybe (HashMap Text Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
additionalOptions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [GlueSchema]
outputSchemas
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
inputs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
connectionName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
connectionTable
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 JDBCConnectorTarget where
rnf :: JDBCConnectorTarget -> ()
rnf JDBCConnectorTarget' {Maybe [GlueSchema]
Maybe (HashMap Text Text)
NonEmpty Text
Text
connectionType :: Text
connectorName :: Text
connectionTable :: Text
connectionName :: Text
inputs :: NonEmpty Text
name :: Text
outputSchemas :: Maybe [GlueSchema]
additionalOptions :: Maybe (HashMap Text Text)
$sel:connectionType:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:connectorName:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:connectionTable:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:connectionName:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:inputs:JDBCConnectorTarget' :: JDBCConnectorTarget -> NonEmpty Text
$sel:name:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:outputSchemas:JDBCConnectorTarget' :: JDBCConnectorTarget -> Maybe [GlueSchema]
$sel:additionalOptions:JDBCConnectorTarget' :: JDBCConnectorTarget -> Maybe (HashMap Text Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
additionalOptions
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 Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
inputs
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
connectionTable
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 JDBCConnectorTarget where
toJSON :: JDBCConnectorTarget -> Value
toJSON JDBCConnectorTarget' {Maybe [GlueSchema]
Maybe (HashMap Text Text)
NonEmpty Text
Text
connectionType :: Text
connectorName :: Text
connectionTable :: Text
connectionName :: Text
inputs :: NonEmpty Text
name :: Text
outputSchemas :: Maybe [GlueSchema]
additionalOptions :: Maybe (HashMap Text Text)
$sel:connectionType:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:connectorName:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:connectionTable:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:connectionName:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:inputs:JDBCConnectorTarget' :: JDBCConnectorTarget -> NonEmpty Text
$sel:name:JDBCConnectorTarget' :: JDBCConnectorTarget -> Text
$sel:outputSchemas:JDBCConnectorTarget' :: JDBCConnectorTarget -> Maybe [GlueSchema]
$sel:additionalOptions:JDBCConnectorTarget' :: JDBCConnectorTarget -> Maybe (HashMap Text Text)
..} =
[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 (HashMap Text Text)
additionalOptions,
(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,
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
"Inputs" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
inputs),
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
"ConnectionTable" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
connectionTable),
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)
]
)