{-# 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.AthenaConnectorSource 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 AthenaConnectorSource = AthenaConnectorSource'
{
AthenaConnectorSource -> Maybe Text
connectionTable :: Prelude.Maybe Prelude.Text,
AthenaConnectorSource -> Maybe [GlueSchema]
outputSchemas :: Prelude.Maybe [GlueSchema],
AthenaConnectorSource -> Text
name :: Prelude.Text,
AthenaConnectorSource -> Text
connectionName :: Prelude.Text,
AthenaConnectorSource -> Text
connectorName :: Prelude.Text,
AthenaConnectorSource -> Text
connectionType :: Prelude.Text,
AthenaConnectorSource -> Text
schemaName :: Prelude.Text
}
deriving (AthenaConnectorSource -> AthenaConnectorSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AthenaConnectorSource -> AthenaConnectorSource -> Bool
$c/= :: AthenaConnectorSource -> AthenaConnectorSource -> Bool
== :: AthenaConnectorSource -> AthenaConnectorSource -> Bool
$c== :: AthenaConnectorSource -> AthenaConnectorSource -> Bool
Prelude.Eq, ReadPrec [AthenaConnectorSource]
ReadPrec AthenaConnectorSource
Int -> ReadS AthenaConnectorSource
ReadS [AthenaConnectorSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AthenaConnectorSource]
$creadListPrec :: ReadPrec [AthenaConnectorSource]
readPrec :: ReadPrec AthenaConnectorSource
$creadPrec :: ReadPrec AthenaConnectorSource
readList :: ReadS [AthenaConnectorSource]
$creadList :: ReadS [AthenaConnectorSource]
readsPrec :: Int -> ReadS AthenaConnectorSource
$creadsPrec :: Int -> ReadS AthenaConnectorSource
Prelude.Read, Int -> AthenaConnectorSource -> ShowS
[AthenaConnectorSource] -> ShowS
AthenaConnectorSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AthenaConnectorSource] -> ShowS
$cshowList :: [AthenaConnectorSource] -> ShowS
show :: AthenaConnectorSource -> String
$cshow :: AthenaConnectorSource -> String
showsPrec :: Int -> AthenaConnectorSource -> ShowS
$cshowsPrec :: Int -> AthenaConnectorSource -> ShowS
Prelude.Show, forall x. Rep AthenaConnectorSource x -> AthenaConnectorSource
forall x. AthenaConnectorSource -> Rep AthenaConnectorSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AthenaConnectorSource x -> AthenaConnectorSource
$cfrom :: forall x. AthenaConnectorSource -> Rep AthenaConnectorSource x
Prelude.Generic)
newAthenaConnectorSource ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
AthenaConnectorSource
newAthenaConnectorSource :: Text -> Text -> Text -> Text -> Text -> AthenaConnectorSource
newAthenaConnectorSource
Text
pName_
Text
pConnectionName_
Text
pConnectorName_
Text
pConnectionType_
Text
pSchemaName_ =
AthenaConnectorSource'
{ $sel:connectionTable:AthenaConnectorSource' :: Maybe Text
connectionTable =
forall a. Maybe a
Prelude.Nothing,
$sel:outputSchemas:AthenaConnectorSource' :: Maybe [GlueSchema]
outputSchemas = forall a. Maybe a
Prelude.Nothing,
$sel:name:AthenaConnectorSource' :: Text
name = Text
pName_,
$sel:connectionName:AthenaConnectorSource' :: Text
connectionName = Text
pConnectionName_,
$sel:connectorName:AthenaConnectorSource' :: Text
connectorName = Text
pConnectorName_,
$sel:connectionType:AthenaConnectorSource' :: Text
connectionType = Text
pConnectionType_,
$sel:schemaName:AthenaConnectorSource' :: Text
schemaName = Text
pSchemaName_
}
athenaConnectorSource_connectionTable :: Lens.Lens' AthenaConnectorSource (Prelude.Maybe Prelude.Text)
athenaConnectorSource_connectionTable :: Lens' AthenaConnectorSource (Maybe Text)
athenaConnectorSource_connectionTable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaConnectorSource' {Maybe Text
connectionTable :: Maybe Text
$sel:connectionTable:AthenaConnectorSource' :: AthenaConnectorSource -> Maybe Text
connectionTable} -> Maybe Text
connectionTable) (\s :: AthenaConnectorSource
s@AthenaConnectorSource' {} Maybe Text
a -> AthenaConnectorSource
s {$sel:connectionTable:AthenaConnectorSource' :: Maybe Text
connectionTable = Maybe Text
a} :: AthenaConnectorSource)
athenaConnectorSource_outputSchemas :: Lens.Lens' AthenaConnectorSource (Prelude.Maybe [GlueSchema])
athenaConnectorSource_outputSchemas :: Lens' AthenaConnectorSource (Maybe [GlueSchema])
athenaConnectorSource_outputSchemas = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaConnectorSource' {Maybe [GlueSchema]
outputSchemas :: Maybe [GlueSchema]
$sel:outputSchemas:AthenaConnectorSource' :: AthenaConnectorSource -> Maybe [GlueSchema]
outputSchemas} -> Maybe [GlueSchema]
outputSchemas) (\s :: AthenaConnectorSource
s@AthenaConnectorSource' {} Maybe [GlueSchema]
a -> AthenaConnectorSource
s {$sel:outputSchemas:AthenaConnectorSource' :: Maybe [GlueSchema]
outputSchemas = Maybe [GlueSchema]
a} :: AthenaConnectorSource) 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
athenaConnectorSource_name :: Lens.Lens' AthenaConnectorSource Prelude.Text
athenaConnectorSource_name :: Lens' AthenaConnectorSource Text
athenaConnectorSource_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaConnectorSource' {Text
name :: Text
$sel:name:AthenaConnectorSource' :: AthenaConnectorSource -> Text
name} -> Text
name) (\s :: AthenaConnectorSource
s@AthenaConnectorSource' {} Text
a -> AthenaConnectorSource
s {$sel:name:AthenaConnectorSource' :: Text
name = Text
a} :: AthenaConnectorSource)
athenaConnectorSource_connectionName :: Lens.Lens' AthenaConnectorSource Prelude.Text
athenaConnectorSource_connectionName :: Lens' AthenaConnectorSource Text
athenaConnectorSource_connectionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaConnectorSource' {Text
connectionName :: Text
$sel:connectionName:AthenaConnectorSource' :: AthenaConnectorSource -> Text
connectionName} -> Text
connectionName) (\s :: AthenaConnectorSource
s@AthenaConnectorSource' {} Text
a -> AthenaConnectorSource
s {$sel:connectionName:AthenaConnectorSource' :: Text
connectionName = Text
a} :: AthenaConnectorSource)
athenaConnectorSource_connectorName :: Lens.Lens' AthenaConnectorSource Prelude.Text
athenaConnectorSource_connectorName :: Lens' AthenaConnectorSource Text
athenaConnectorSource_connectorName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaConnectorSource' {Text
connectorName :: Text
$sel:connectorName:AthenaConnectorSource' :: AthenaConnectorSource -> Text
connectorName} -> Text
connectorName) (\s :: AthenaConnectorSource
s@AthenaConnectorSource' {} Text
a -> AthenaConnectorSource
s {$sel:connectorName:AthenaConnectorSource' :: Text
connectorName = Text
a} :: AthenaConnectorSource)
athenaConnectorSource_connectionType :: Lens.Lens' AthenaConnectorSource Prelude.Text
athenaConnectorSource_connectionType :: Lens' AthenaConnectorSource Text
athenaConnectorSource_connectionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaConnectorSource' {Text
connectionType :: Text
$sel:connectionType:AthenaConnectorSource' :: AthenaConnectorSource -> Text
connectionType} -> Text
connectionType) (\s :: AthenaConnectorSource
s@AthenaConnectorSource' {} Text
a -> AthenaConnectorSource
s {$sel:connectionType:AthenaConnectorSource' :: Text
connectionType = Text
a} :: AthenaConnectorSource)
athenaConnectorSource_schemaName :: Lens.Lens' AthenaConnectorSource Prelude.Text
athenaConnectorSource_schemaName :: Lens' AthenaConnectorSource Text
athenaConnectorSource_schemaName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaConnectorSource' {Text
schemaName :: Text
$sel:schemaName:AthenaConnectorSource' :: AthenaConnectorSource -> Text
schemaName} -> Text
schemaName) (\s :: AthenaConnectorSource
s@AthenaConnectorSource' {} Text
a -> AthenaConnectorSource
s {$sel:schemaName:AthenaConnectorSource' :: Text
schemaName = Text
a} :: AthenaConnectorSource)
instance Data.FromJSON AthenaConnectorSource where
parseJSON :: Value -> Parser AthenaConnectorSource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AthenaConnectorSource"
( \Object
x ->
Maybe Text
-> Maybe [GlueSchema]
-> Text
-> Text
-> Text
-> Text
-> Text
-> AthenaConnectorSource
AthenaConnectorSource'
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
"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 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")
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
"SchemaName")
)
instance Prelude.Hashable AthenaConnectorSource where
hashWithSalt :: Int -> AthenaConnectorSource -> Int
hashWithSalt Int
_salt AthenaConnectorSource' {Maybe [GlueSchema]
Maybe Text
Text
schemaName :: Text
connectionType :: Text
connectorName :: Text
connectionName :: Text
name :: Text
outputSchemas :: Maybe [GlueSchema]
connectionTable :: Maybe Text
$sel:schemaName:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:connectionType:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:connectorName:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:connectionName:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:name:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:outputSchemas:AthenaConnectorSource' :: AthenaConnectorSource -> Maybe [GlueSchema]
$sel:connectionTable:AthenaConnectorSource' :: AthenaConnectorSource -> Maybe Text
..} =
Int
_salt
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` 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
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
schemaName
instance Prelude.NFData AthenaConnectorSource where
rnf :: AthenaConnectorSource -> ()
rnf AthenaConnectorSource' {Maybe [GlueSchema]
Maybe Text
Text
schemaName :: Text
connectionType :: Text
connectorName :: Text
connectionName :: Text
name :: Text
outputSchemas :: Maybe [GlueSchema]
connectionTable :: Maybe Text
$sel:schemaName:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:connectionType:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:connectorName:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:connectionName:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:name:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:outputSchemas:AthenaConnectorSource' :: AthenaConnectorSource -> Maybe [GlueSchema]
$sel:connectionTable:AthenaConnectorSource' :: AthenaConnectorSource -> Maybe Text
..} =
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 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
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
schemaName
instance Data.ToJSON AthenaConnectorSource where
toJSON :: AthenaConnectorSource -> Value
toJSON AthenaConnectorSource' {Maybe [GlueSchema]
Maybe Text
Text
schemaName :: Text
connectionType :: Text
connectorName :: Text
connectionName :: Text
name :: Text
outputSchemas :: Maybe [GlueSchema]
connectionTable :: Maybe Text
$sel:schemaName:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:connectionType:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:connectorName:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:connectionName:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:name:AthenaConnectorSource' :: AthenaConnectorSource -> Text
$sel:outputSchemas:AthenaConnectorSource' :: AthenaConnectorSource -> Maybe [GlueSchema]
$sel:connectionTable:AthenaConnectorSource' :: AthenaConnectorSource -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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,
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),
forall a. a -> Maybe a
Prelude.Just (Key
"SchemaName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
schemaName)
]
)