{-# 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.GovernedCatalogSource 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.S3SourceAdditionalOptions
import qualified Amazonka.Prelude as Prelude
data GovernedCatalogSource = GovernedCatalogSource'
{
GovernedCatalogSource -> Maybe S3SourceAdditionalOptions
additionalOptions :: Prelude.Maybe S3SourceAdditionalOptions,
GovernedCatalogSource -> Maybe Text
partitionPredicate :: Prelude.Maybe Prelude.Text,
GovernedCatalogSource -> Text
name :: Prelude.Text,
GovernedCatalogSource -> Text
database :: Prelude.Text,
GovernedCatalogSource -> Text
table :: Prelude.Text
}
deriving (GovernedCatalogSource -> GovernedCatalogSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GovernedCatalogSource -> GovernedCatalogSource -> Bool
$c/= :: GovernedCatalogSource -> GovernedCatalogSource -> Bool
== :: GovernedCatalogSource -> GovernedCatalogSource -> Bool
$c== :: GovernedCatalogSource -> GovernedCatalogSource -> Bool
Prelude.Eq, ReadPrec [GovernedCatalogSource]
ReadPrec GovernedCatalogSource
Int -> ReadS GovernedCatalogSource
ReadS [GovernedCatalogSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GovernedCatalogSource]
$creadListPrec :: ReadPrec [GovernedCatalogSource]
readPrec :: ReadPrec GovernedCatalogSource
$creadPrec :: ReadPrec GovernedCatalogSource
readList :: ReadS [GovernedCatalogSource]
$creadList :: ReadS [GovernedCatalogSource]
readsPrec :: Int -> ReadS GovernedCatalogSource
$creadsPrec :: Int -> ReadS GovernedCatalogSource
Prelude.Read, Int -> GovernedCatalogSource -> ShowS
[GovernedCatalogSource] -> ShowS
GovernedCatalogSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GovernedCatalogSource] -> ShowS
$cshowList :: [GovernedCatalogSource] -> ShowS
show :: GovernedCatalogSource -> String
$cshow :: GovernedCatalogSource -> String
showsPrec :: Int -> GovernedCatalogSource -> ShowS
$cshowsPrec :: Int -> GovernedCatalogSource -> ShowS
Prelude.Show, forall x. Rep GovernedCatalogSource x -> GovernedCatalogSource
forall x. GovernedCatalogSource -> Rep GovernedCatalogSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GovernedCatalogSource x -> GovernedCatalogSource
$cfrom :: forall x. GovernedCatalogSource -> Rep GovernedCatalogSource x
Prelude.Generic)
newGovernedCatalogSource ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
GovernedCatalogSource
newGovernedCatalogSource :: Text -> Text -> Text -> GovernedCatalogSource
newGovernedCatalogSource Text
pName_ Text
pDatabase_ Text
pTable_ =
GovernedCatalogSource'
{ $sel:additionalOptions:GovernedCatalogSource' :: Maybe S3SourceAdditionalOptions
additionalOptions =
forall a. Maybe a
Prelude.Nothing,
$sel:partitionPredicate:GovernedCatalogSource' :: Maybe Text
partitionPredicate = forall a. Maybe a
Prelude.Nothing,
$sel:name:GovernedCatalogSource' :: Text
name = Text
pName_,
$sel:database:GovernedCatalogSource' :: Text
database = Text
pDatabase_,
$sel:table:GovernedCatalogSource' :: Text
table = Text
pTable_
}
governedCatalogSource_additionalOptions :: Lens.Lens' GovernedCatalogSource (Prelude.Maybe S3SourceAdditionalOptions)
governedCatalogSource_additionalOptions :: Lens' GovernedCatalogSource (Maybe S3SourceAdditionalOptions)
governedCatalogSource_additionalOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GovernedCatalogSource' {Maybe S3SourceAdditionalOptions
additionalOptions :: Maybe S3SourceAdditionalOptions
$sel:additionalOptions:GovernedCatalogSource' :: GovernedCatalogSource -> Maybe S3SourceAdditionalOptions
additionalOptions} -> Maybe S3SourceAdditionalOptions
additionalOptions) (\s :: GovernedCatalogSource
s@GovernedCatalogSource' {} Maybe S3SourceAdditionalOptions
a -> GovernedCatalogSource
s {$sel:additionalOptions:GovernedCatalogSource' :: Maybe S3SourceAdditionalOptions
additionalOptions = Maybe S3SourceAdditionalOptions
a} :: GovernedCatalogSource)
governedCatalogSource_partitionPredicate :: Lens.Lens' GovernedCatalogSource (Prelude.Maybe Prelude.Text)
governedCatalogSource_partitionPredicate :: Lens' GovernedCatalogSource (Maybe Text)
governedCatalogSource_partitionPredicate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GovernedCatalogSource' {Maybe Text
partitionPredicate :: Maybe Text
$sel:partitionPredicate:GovernedCatalogSource' :: GovernedCatalogSource -> Maybe Text
partitionPredicate} -> Maybe Text
partitionPredicate) (\s :: GovernedCatalogSource
s@GovernedCatalogSource' {} Maybe Text
a -> GovernedCatalogSource
s {$sel:partitionPredicate:GovernedCatalogSource' :: Maybe Text
partitionPredicate = Maybe Text
a} :: GovernedCatalogSource)
governedCatalogSource_name :: Lens.Lens' GovernedCatalogSource Prelude.Text
governedCatalogSource_name :: Lens' GovernedCatalogSource Text
governedCatalogSource_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GovernedCatalogSource' {Text
name :: Text
$sel:name:GovernedCatalogSource' :: GovernedCatalogSource -> Text
name} -> Text
name) (\s :: GovernedCatalogSource
s@GovernedCatalogSource' {} Text
a -> GovernedCatalogSource
s {$sel:name:GovernedCatalogSource' :: Text
name = Text
a} :: GovernedCatalogSource)
governedCatalogSource_database :: Lens.Lens' GovernedCatalogSource Prelude.Text
governedCatalogSource_database :: Lens' GovernedCatalogSource Text
governedCatalogSource_database = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GovernedCatalogSource' {Text
database :: Text
$sel:database:GovernedCatalogSource' :: GovernedCatalogSource -> Text
database} -> Text
database) (\s :: GovernedCatalogSource
s@GovernedCatalogSource' {} Text
a -> GovernedCatalogSource
s {$sel:database:GovernedCatalogSource' :: Text
database = Text
a} :: GovernedCatalogSource)
governedCatalogSource_table :: Lens.Lens' GovernedCatalogSource Prelude.Text
governedCatalogSource_table :: Lens' GovernedCatalogSource Text
governedCatalogSource_table = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GovernedCatalogSource' {Text
table :: Text
$sel:table:GovernedCatalogSource' :: GovernedCatalogSource -> Text
table} -> Text
table) (\s :: GovernedCatalogSource
s@GovernedCatalogSource' {} Text
a -> GovernedCatalogSource
s {$sel:table:GovernedCatalogSource' :: Text
table = Text
a} :: GovernedCatalogSource)
instance Data.FromJSON GovernedCatalogSource where
parseJSON :: Value -> Parser GovernedCatalogSource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"GovernedCatalogSource"
( \Object
x ->
Maybe S3SourceAdditionalOptions
-> Maybe Text -> Text -> Text -> Text -> GovernedCatalogSource
GovernedCatalogSource'
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
"PartitionPredicate")
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
"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 GovernedCatalogSource where
hashWithSalt :: Int -> GovernedCatalogSource -> Int
hashWithSalt Int
_salt GovernedCatalogSource' {Maybe Text
Maybe S3SourceAdditionalOptions
Text
table :: Text
database :: Text
name :: Text
partitionPredicate :: Maybe Text
additionalOptions :: Maybe S3SourceAdditionalOptions
$sel:table:GovernedCatalogSource' :: GovernedCatalogSource -> Text
$sel:database:GovernedCatalogSource' :: GovernedCatalogSource -> Text
$sel:name:GovernedCatalogSource' :: GovernedCatalogSource -> Text
$sel:partitionPredicate:GovernedCatalogSource' :: GovernedCatalogSource -> Maybe Text
$sel:additionalOptions:GovernedCatalogSource' :: GovernedCatalogSource -> Maybe S3SourceAdditionalOptions
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3SourceAdditionalOptions
additionalOptions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
partitionPredicate
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 GovernedCatalogSource where
rnf :: GovernedCatalogSource -> ()
rnf GovernedCatalogSource' {Maybe Text
Maybe S3SourceAdditionalOptions
Text
table :: Text
database :: Text
name :: Text
partitionPredicate :: Maybe Text
additionalOptions :: Maybe S3SourceAdditionalOptions
$sel:table:GovernedCatalogSource' :: GovernedCatalogSource -> Text
$sel:database:GovernedCatalogSource' :: GovernedCatalogSource -> Text
$sel:name:GovernedCatalogSource' :: GovernedCatalogSource -> Text
$sel:partitionPredicate:GovernedCatalogSource' :: GovernedCatalogSource -> Maybe Text
$sel:additionalOptions:GovernedCatalogSource' :: GovernedCatalogSource -> Maybe S3SourceAdditionalOptions
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe S3SourceAdditionalOptions
additionalOptions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
partitionPredicate
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
database
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
table
instance Data.ToJSON GovernedCatalogSource where
toJSON :: GovernedCatalogSource -> Value
toJSON GovernedCatalogSource' {Maybe Text
Maybe S3SourceAdditionalOptions
Text
table :: Text
database :: Text
name :: Text
partitionPredicate :: Maybe Text
additionalOptions :: Maybe S3SourceAdditionalOptions
$sel:table:GovernedCatalogSource' :: GovernedCatalogSource -> Text
$sel:database:GovernedCatalogSource' :: GovernedCatalogSource -> Text
$sel:name:GovernedCatalogSource' :: GovernedCatalogSource -> Text
$sel:partitionPredicate:GovernedCatalogSource' :: GovernedCatalogSource -> Maybe Text
$sel:additionalOptions:GovernedCatalogSource' :: GovernedCatalogSource -> Maybe S3SourceAdditionalOptions
..} =
[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 S3SourceAdditionalOptions
additionalOptions,
(Key
"PartitionPredicate" 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
partitionPredicate,
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)
]
)