{-# 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.LakeFormation.Types.TableWithColumnsResource where
import qualified Amazonka.Core as Core
import Amazonka.LakeFormation.Types.ColumnWildcard
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TableWithColumnsResource = TableWithColumnsResource'
{
TableWithColumnsResource -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
TableWithColumnsResource -> Maybe ColumnWildcard
columnWildcard :: Prelude.Maybe ColumnWildcard,
TableWithColumnsResource -> Maybe [Text]
columnNames :: Prelude.Maybe [Prelude.Text],
TableWithColumnsResource -> Text
databaseName :: Prelude.Text,
TableWithColumnsResource -> Text
name :: Prelude.Text
}
deriving (TableWithColumnsResource -> TableWithColumnsResource -> Bool
(TableWithColumnsResource -> TableWithColumnsResource -> Bool)
-> (TableWithColumnsResource -> TableWithColumnsResource -> Bool)
-> Eq TableWithColumnsResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableWithColumnsResource -> TableWithColumnsResource -> Bool
$c/= :: TableWithColumnsResource -> TableWithColumnsResource -> Bool
== :: TableWithColumnsResource -> TableWithColumnsResource -> Bool
$c== :: TableWithColumnsResource -> TableWithColumnsResource -> Bool
Prelude.Eq, ReadPrec [TableWithColumnsResource]
ReadPrec TableWithColumnsResource
Int -> ReadS TableWithColumnsResource
ReadS [TableWithColumnsResource]
(Int -> ReadS TableWithColumnsResource)
-> ReadS [TableWithColumnsResource]
-> ReadPrec TableWithColumnsResource
-> ReadPrec [TableWithColumnsResource]
-> Read TableWithColumnsResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TableWithColumnsResource]
$creadListPrec :: ReadPrec [TableWithColumnsResource]
readPrec :: ReadPrec TableWithColumnsResource
$creadPrec :: ReadPrec TableWithColumnsResource
readList :: ReadS [TableWithColumnsResource]
$creadList :: ReadS [TableWithColumnsResource]
readsPrec :: Int -> ReadS TableWithColumnsResource
$creadsPrec :: Int -> ReadS TableWithColumnsResource
Prelude.Read, Int -> TableWithColumnsResource -> ShowS
[TableWithColumnsResource] -> ShowS
TableWithColumnsResource -> String
(Int -> TableWithColumnsResource -> ShowS)
-> (TableWithColumnsResource -> String)
-> ([TableWithColumnsResource] -> ShowS)
-> Show TableWithColumnsResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableWithColumnsResource] -> ShowS
$cshowList :: [TableWithColumnsResource] -> ShowS
show :: TableWithColumnsResource -> String
$cshow :: TableWithColumnsResource -> String
showsPrec :: Int -> TableWithColumnsResource -> ShowS
$cshowsPrec :: Int -> TableWithColumnsResource -> ShowS
Prelude.Show, (forall x.
TableWithColumnsResource -> Rep TableWithColumnsResource x)
-> (forall x.
Rep TableWithColumnsResource x -> TableWithColumnsResource)
-> Generic TableWithColumnsResource
forall x.
Rep TableWithColumnsResource x -> TableWithColumnsResource
forall x.
TableWithColumnsResource -> Rep TableWithColumnsResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TableWithColumnsResource x -> TableWithColumnsResource
$cfrom :: forall x.
TableWithColumnsResource -> Rep TableWithColumnsResource x
Prelude.Generic)
newTableWithColumnsResource ::
Prelude.Text ->
Prelude.Text ->
TableWithColumnsResource
newTableWithColumnsResource :: Text -> Text -> TableWithColumnsResource
newTableWithColumnsResource Text
pDatabaseName_ Text
pName_ =
TableWithColumnsResource' :: Maybe Text
-> Maybe ColumnWildcard
-> Maybe [Text]
-> Text
-> Text
-> TableWithColumnsResource
TableWithColumnsResource'
{ $sel:catalogId:TableWithColumnsResource' :: Maybe Text
catalogId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:columnWildcard:TableWithColumnsResource' :: Maybe ColumnWildcard
columnWildcard = Maybe ColumnWildcard
forall a. Maybe a
Prelude.Nothing,
$sel:columnNames:TableWithColumnsResource' :: Maybe [Text]
columnNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:databaseName:TableWithColumnsResource' :: Text
databaseName = Text
pDatabaseName_,
$sel:name:TableWithColumnsResource' :: Text
name = Text
pName_
}
tableWithColumnsResource_catalogId :: Lens.Lens' TableWithColumnsResource (Prelude.Maybe Prelude.Text)
tableWithColumnsResource_catalogId :: (Maybe Text -> f (Maybe Text))
-> TableWithColumnsResource -> f TableWithColumnsResource
tableWithColumnsResource_catalogId = (TableWithColumnsResource -> Maybe Text)
-> (TableWithColumnsResource
-> Maybe Text -> TableWithColumnsResource)
-> Lens
TableWithColumnsResource
TableWithColumnsResource
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableWithColumnsResource' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:TableWithColumnsResource' :: TableWithColumnsResource -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: TableWithColumnsResource
s@TableWithColumnsResource' {} Maybe Text
a -> TableWithColumnsResource
s {$sel:catalogId:TableWithColumnsResource' :: Maybe Text
catalogId = Maybe Text
a} :: TableWithColumnsResource)
tableWithColumnsResource_columnWildcard :: Lens.Lens' TableWithColumnsResource (Prelude.Maybe ColumnWildcard)
tableWithColumnsResource_columnWildcard :: (Maybe ColumnWildcard -> f (Maybe ColumnWildcard))
-> TableWithColumnsResource -> f TableWithColumnsResource
tableWithColumnsResource_columnWildcard = (TableWithColumnsResource -> Maybe ColumnWildcard)
-> (TableWithColumnsResource
-> Maybe ColumnWildcard -> TableWithColumnsResource)
-> Lens
TableWithColumnsResource
TableWithColumnsResource
(Maybe ColumnWildcard)
(Maybe ColumnWildcard)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableWithColumnsResource' {Maybe ColumnWildcard
columnWildcard :: Maybe ColumnWildcard
$sel:columnWildcard:TableWithColumnsResource' :: TableWithColumnsResource -> Maybe ColumnWildcard
columnWildcard} -> Maybe ColumnWildcard
columnWildcard) (\s :: TableWithColumnsResource
s@TableWithColumnsResource' {} Maybe ColumnWildcard
a -> TableWithColumnsResource
s {$sel:columnWildcard:TableWithColumnsResource' :: Maybe ColumnWildcard
columnWildcard = Maybe ColumnWildcard
a} :: TableWithColumnsResource)
tableWithColumnsResource_columnNames :: Lens.Lens' TableWithColumnsResource (Prelude.Maybe [Prelude.Text])
tableWithColumnsResource_columnNames :: (Maybe [Text] -> f (Maybe [Text]))
-> TableWithColumnsResource -> f TableWithColumnsResource
tableWithColumnsResource_columnNames = (TableWithColumnsResource -> Maybe [Text])
-> (TableWithColumnsResource
-> Maybe [Text] -> TableWithColumnsResource)
-> Lens
TableWithColumnsResource
TableWithColumnsResource
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableWithColumnsResource' {Maybe [Text]
columnNames :: Maybe [Text]
$sel:columnNames:TableWithColumnsResource' :: TableWithColumnsResource -> Maybe [Text]
columnNames} -> Maybe [Text]
columnNames) (\s :: TableWithColumnsResource
s@TableWithColumnsResource' {} Maybe [Text]
a -> TableWithColumnsResource
s {$sel:columnNames:TableWithColumnsResource' :: Maybe [Text]
columnNames = Maybe [Text]
a} :: TableWithColumnsResource) ((Maybe [Text] -> f (Maybe [Text]))
-> TableWithColumnsResource -> f TableWithColumnsResource)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> TableWithColumnsResource
-> f TableWithColumnsResource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
tableWithColumnsResource_databaseName :: Lens.Lens' TableWithColumnsResource Prelude.Text
tableWithColumnsResource_databaseName :: (Text -> f Text)
-> TableWithColumnsResource -> f TableWithColumnsResource
tableWithColumnsResource_databaseName = (TableWithColumnsResource -> Text)
-> (TableWithColumnsResource -> Text -> TableWithColumnsResource)
-> Lens TableWithColumnsResource TableWithColumnsResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableWithColumnsResource' {Text
databaseName :: Text
$sel:databaseName:TableWithColumnsResource' :: TableWithColumnsResource -> Text
databaseName} -> Text
databaseName) (\s :: TableWithColumnsResource
s@TableWithColumnsResource' {} Text
a -> TableWithColumnsResource
s {$sel:databaseName:TableWithColumnsResource' :: Text
databaseName = Text
a} :: TableWithColumnsResource)
tableWithColumnsResource_name :: Lens.Lens' TableWithColumnsResource Prelude.Text
tableWithColumnsResource_name :: (Text -> f Text)
-> TableWithColumnsResource -> f TableWithColumnsResource
tableWithColumnsResource_name = (TableWithColumnsResource -> Text)
-> (TableWithColumnsResource -> Text -> TableWithColumnsResource)
-> Lens TableWithColumnsResource TableWithColumnsResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableWithColumnsResource' {Text
name :: Text
$sel:name:TableWithColumnsResource' :: TableWithColumnsResource -> Text
name} -> Text
name) (\s :: TableWithColumnsResource
s@TableWithColumnsResource' {} Text
a -> TableWithColumnsResource
s {$sel:name:TableWithColumnsResource' :: Text
name = Text
a} :: TableWithColumnsResource)
instance Core.FromJSON TableWithColumnsResource where
parseJSON :: Value -> Parser TableWithColumnsResource
parseJSON =
String
-> (Object -> Parser TableWithColumnsResource)
-> Value
-> Parser TableWithColumnsResource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TableWithColumnsResource"
( \Object
x ->
Maybe Text
-> Maybe ColumnWildcard
-> Maybe [Text]
-> Text
-> Text
-> TableWithColumnsResource
TableWithColumnsResource'
(Maybe Text
-> Maybe ColumnWildcard
-> Maybe [Text]
-> Text
-> Text
-> TableWithColumnsResource)
-> Parser (Maybe Text)
-> Parser
(Maybe ColumnWildcard
-> Maybe [Text] -> Text -> Text -> TableWithColumnsResource)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CatalogId")
Parser
(Maybe ColumnWildcard
-> Maybe [Text] -> Text -> Text -> TableWithColumnsResource)
-> Parser (Maybe ColumnWildcard)
-> Parser
(Maybe [Text] -> Text -> Text -> TableWithColumnsResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ColumnWildcard)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ColumnWildcard")
Parser (Maybe [Text] -> Text -> Text -> TableWithColumnsResource)
-> Parser (Maybe [Text])
-> Parser (Text -> Text -> TableWithColumnsResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ColumnNames" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Text -> Text -> TableWithColumnsResource)
-> Parser Text -> Parser (Text -> TableWithColumnsResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DatabaseName")
Parser (Text -> TableWithColumnsResource)
-> Parser Text -> Parser TableWithColumnsResource
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
)
instance Prelude.Hashable TableWithColumnsResource
instance Prelude.NFData TableWithColumnsResource
instance Core.ToJSON TableWithColumnsResource where
toJSON :: TableWithColumnsResource -> Value
toJSON TableWithColumnsResource' {Maybe [Text]
Maybe Text
Maybe ColumnWildcard
Text
name :: Text
databaseName :: Text
columnNames :: Maybe [Text]
columnWildcard :: Maybe ColumnWildcard
catalogId :: Maybe Text
$sel:name:TableWithColumnsResource' :: TableWithColumnsResource -> Text
$sel:databaseName:TableWithColumnsResource' :: TableWithColumnsResource -> Text
$sel:columnNames:TableWithColumnsResource' :: TableWithColumnsResource -> Maybe [Text]
$sel:columnWildcard:TableWithColumnsResource' :: TableWithColumnsResource -> Maybe ColumnWildcard
$sel:catalogId:TableWithColumnsResource' :: TableWithColumnsResource -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CatalogId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
catalogId,
(Text
"ColumnWildcard" Text -> ColumnWildcard -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ColumnWildcard -> Pair) -> Maybe ColumnWildcard -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ColumnWildcard
columnWildcard,
(Text
"ColumnNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
columnNames,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DatabaseName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
databaseName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
]
)