{-# 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.AppFlow.Types.GlueDataCatalogConfig 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 GlueDataCatalogConfig = GlueDataCatalogConfig'
{
GlueDataCatalogConfig -> Text
roleArn :: Prelude.Text,
GlueDataCatalogConfig -> Text
databaseName :: Prelude.Text,
GlueDataCatalogConfig -> Text
tablePrefix :: Prelude.Text
}
deriving (GlueDataCatalogConfig -> GlueDataCatalogConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GlueDataCatalogConfig -> GlueDataCatalogConfig -> Bool
$c/= :: GlueDataCatalogConfig -> GlueDataCatalogConfig -> Bool
== :: GlueDataCatalogConfig -> GlueDataCatalogConfig -> Bool
$c== :: GlueDataCatalogConfig -> GlueDataCatalogConfig -> Bool
Prelude.Eq, ReadPrec [GlueDataCatalogConfig]
ReadPrec GlueDataCatalogConfig
Int -> ReadS GlueDataCatalogConfig
ReadS [GlueDataCatalogConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GlueDataCatalogConfig]
$creadListPrec :: ReadPrec [GlueDataCatalogConfig]
readPrec :: ReadPrec GlueDataCatalogConfig
$creadPrec :: ReadPrec GlueDataCatalogConfig
readList :: ReadS [GlueDataCatalogConfig]
$creadList :: ReadS [GlueDataCatalogConfig]
readsPrec :: Int -> ReadS GlueDataCatalogConfig
$creadsPrec :: Int -> ReadS GlueDataCatalogConfig
Prelude.Read, Int -> GlueDataCatalogConfig -> ShowS
[GlueDataCatalogConfig] -> ShowS
GlueDataCatalogConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GlueDataCatalogConfig] -> ShowS
$cshowList :: [GlueDataCatalogConfig] -> ShowS
show :: GlueDataCatalogConfig -> String
$cshow :: GlueDataCatalogConfig -> String
showsPrec :: Int -> GlueDataCatalogConfig -> ShowS
$cshowsPrec :: Int -> GlueDataCatalogConfig -> ShowS
Prelude.Show, forall x. Rep GlueDataCatalogConfig x -> GlueDataCatalogConfig
forall x. GlueDataCatalogConfig -> Rep GlueDataCatalogConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GlueDataCatalogConfig x -> GlueDataCatalogConfig
$cfrom :: forall x. GlueDataCatalogConfig -> Rep GlueDataCatalogConfig x
Prelude.Generic)
newGlueDataCatalogConfig ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
GlueDataCatalogConfig
newGlueDataCatalogConfig :: Text -> Text -> Text -> GlueDataCatalogConfig
newGlueDataCatalogConfig
Text
pRoleArn_
Text
pDatabaseName_
Text
pTablePrefix_ =
GlueDataCatalogConfig'
{ $sel:roleArn:GlueDataCatalogConfig' :: Text
roleArn = Text
pRoleArn_,
$sel:databaseName:GlueDataCatalogConfig' :: Text
databaseName = Text
pDatabaseName_,
$sel:tablePrefix:GlueDataCatalogConfig' :: Text
tablePrefix = Text
pTablePrefix_
}
glueDataCatalogConfig_roleArn :: Lens.Lens' GlueDataCatalogConfig Prelude.Text
glueDataCatalogConfig_roleArn :: Lens' GlueDataCatalogConfig Text
glueDataCatalogConfig_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlueDataCatalogConfig' {Text
roleArn :: Text
$sel:roleArn:GlueDataCatalogConfig' :: GlueDataCatalogConfig -> Text
roleArn} -> Text
roleArn) (\s :: GlueDataCatalogConfig
s@GlueDataCatalogConfig' {} Text
a -> GlueDataCatalogConfig
s {$sel:roleArn:GlueDataCatalogConfig' :: Text
roleArn = Text
a} :: GlueDataCatalogConfig)
glueDataCatalogConfig_databaseName :: Lens.Lens' GlueDataCatalogConfig Prelude.Text
glueDataCatalogConfig_databaseName :: Lens' GlueDataCatalogConfig Text
glueDataCatalogConfig_databaseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlueDataCatalogConfig' {Text
databaseName :: Text
$sel:databaseName:GlueDataCatalogConfig' :: GlueDataCatalogConfig -> Text
databaseName} -> Text
databaseName) (\s :: GlueDataCatalogConfig
s@GlueDataCatalogConfig' {} Text
a -> GlueDataCatalogConfig
s {$sel:databaseName:GlueDataCatalogConfig' :: Text
databaseName = Text
a} :: GlueDataCatalogConfig)
glueDataCatalogConfig_tablePrefix :: Lens.Lens' GlueDataCatalogConfig Prelude.Text
glueDataCatalogConfig_tablePrefix :: Lens' GlueDataCatalogConfig Text
glueDataCatalogConfig_tablePrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlueDataCatalogConfig' {Text
tablePrefix :: Text
$sel:tablePrefix:GlueDataCatalogConfig' :: GlueDataCatalogConfig -> Text
tablePrefix} -> Text
tablePrefix) (\s :: GlueDataCatalogConfig
s@GlueDataCatalogConfig' {} Text
a -> GlueDataCatalogConfig
s {$sel:tablePrefix:GlueDataCatalogConfig' :: Text
tablePrefix = Text
a} :: GlueDataCatalogConfig)
instance Data.FromJSON GlueDataCatalogConfig where
parseJSON :: Value -> Parser GlueDataCatalogConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"GlueDataCatalogConfig"
( \Object
x ->
Text -> Text -> Text -> GlueDataCatalogConfig
GlueDataCatalogConfig'
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
"roleArn")
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
"databaseName")
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
"tablePrefix")
)
instance Prelude.Hashable GlueDataCatalogConfig where
hashWithSalt :: Int -> GlueDataCatalogConfig -> Int
hashWithSalt Int
_salt GlueDataCatalogConfig' {Text
tablePrefix :: Text
databaseName :: Text
roleArn :: Text
$sel:tablePrefix:GlueDataCatalogConfig' :: GlueDataCatalogConfig -> Text
$sel:databaseName:GlueDataCatalogConfig' :: GlueDataCatalogConfig -> Text
$sel:roleArn:GlueDataCatalogConfig' :: GlueDataCatalogConfig -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
databaseName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
tablePrefix
instance Prelude.NFData GlueDataCatalogConfig where
rnf :: GlueDataCatalogConfig -> ()
rnf GlueDataCatalogConfig' {Text
tablePrefix :: Text
databaseName :: Text
roleArn :: Text
$sel:tablePrefix:GlueDataCatalogConfig' :: GlueDataCatalogConfig -> Text
$sel:databaseName:GlueDataCatalogConfig' :: GlueDataCatalogConfig -> Text
$sel:roleArn:GlueDataCatalogConfig' :: GlueDataCatalogConfig -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
databaseName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
tablePrefix
instance Data.ToJSON GlueDataCatalogConfig where
toJSON :: GlueDataCatalogConfig -> Value
toJSON GlueDataCatalogConfig' {Text
tablePrefix :: Text
databaseName :: Text
roleArn :: Text
$sel:tablePrefix:GlueDataCatalogConfig' :: GlueDataCatalogConfig -> Text
$sel:databaseName:GlueDataCatalogConfig' :: GlueDataCatalogConfig -> Text
$sel:roleArn:GlueDataCatalogConfig' :: GlueDataCatalogConfig -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"roleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn),
forall a. a -> Maybe a
Prelude.Just (Key
"databaseName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
databaseName),
forall a. a -> Maybe a
Prelude.Just (Key
"tablePrefix" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
tablePrefix)
]
)