{-# 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.DataLakePrincipal where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DataLakePrincipal = DataLakePrincipal'
{
DataLakePrincipal -> Maybe Text
dataLakePrincipalIdentifier :: Prelude.Maybe Prelude.Text
}
deriving (DataLakePrincipal -> DataLakePrincipal -> Bool
(DataLakePrincipal -> DataLakePrincipal -> Bool)
-> (DataLakePrincipal -> DataLakePrincipal -> Bool)
-> Eq DataLakePrincipal
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataLakePrincipal -> DataLakePrincipal -> Bool
$c/= :: DataLakePrincipal -> DataLakePrincipal -> Bool
== :: DataLakePrincipal -> DataLakePrincipal -> Bool
$c== :: DataLakePrincipal -> DataLakePrincipal -> Bool
Prelude.Eq, ReadPrec [DataLakePrincipal]
ReadPrec DataLakePrincipal
Int -> ReadS DataLakePrincipal
ReadS [DataLakePrincipal]
(Int -> ReadS DataLakePrincipal)
-> ReadS [DataLakePrincipal]
-> ReadPrec DataLakePrincipal
-> ReadPrec [DataLakePrincipal]
-> Read DataLakePrincipal
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataLakePrincipal]
$creadListPrec :: ReadPrec [DataLakePrincipal]
readPrec :: ReadPrec DataLakePrincipal
$creadPrec :: ReadPrec DataLakePrincipal
readList :: ReadS [DataLakePrincipal]
$creadList :: ReadS [DataLakePrincipal]
readsPrec :: Int -> ReadS DataLakePrincipal
$creadsPrec :: Int -> ReadS DataLakePrincipal
Prelude.Read, Int -> DataLakePrincipal -> ShowS
[DataLakePrincipal] -> ShowS
DataLakePrincipal -> String
(Int -> DataLakePrincipal -> ShowS)
-> (DataLakePrincipal -> String)
-> ([DataLakePrincipal] -> ShowS)
-> Show DataLakePrincipal
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataLakePrincipal] -> ShowS
$cshowList :: [DataLakePrincipal] -> ShowS
show :: DataLakePrincipal -> String
$cshow :: DataLakePrincipal -> String
showsPrec :: Int -> DataLakePrincipal -> ShowS
$cshowsPrec :: Int -> DataLakePrincipal -> ShowS
Prelude.Show, (forall x. DataLakePrincipal -> Rep DataLakePrincipal x)
-> (forall x. Rep DataLakePrincipal x -> DataLakePrincipal)
-> Generic DataLakePrincipal
forall x. Rep DataLakePrincipal x -> DataLakePrincipal
forall x. DataLakePrincipal -> Rep DataLakePrincipal x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataLakePrincipal x -> DataLakePrincipal
$cfrom :: forall x. DataLakePrincipal -> Rep DataLakePrincipal x
Prelude.Generic)
newDataLakePrincipal ::
DataLakePrincipal
newDataLakePrincipal :: DataLakePrincipal
newDataLakePrincipal =
DataLakePrincipal' :: Maybe Text -> DataLakePrincipal
DataLakePrincipal'
{ $sel:dataLakePrincipalIdentifier:DataLakePrincipal' :: Maybe Text
dataLakePrincipalIdentifier =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
dataLakePrincipal_dataLakePrincipalIdentifier :: Lens.Lens' DataLakePrincipal (Prelude.Maybe Prelude.Text)
dataLakePrincipal_dataLakePrincipalIdentifier :: (Maybe Text -> f (Maybe Text))
-> DataLakePrincipal -> f DataLakePrincipal
dataLakePrincipal_dataLakePrincipalIdentifier = (DataLakePrincipal -> Maybe Text)
-> (DataLakePrincipal -> Maybe Text -> DataLakePrincipal)
-> Lens
DataLakePrincipal DataLakePrincipal (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataLakePrincipal' {Maybe Text
dataLakePrincipalIdentifier :: Maybe Text
$sel:dataLakePrincipalIdentifier:DataLakePrincipal' :: DataLakePrincipal -> Maybe Text
dataLakePrincipalIdentifier} -> Maybe Text
dataLakePrincipalIdentifier) (\s :: DataLakePrincipal
s@DataLakePrincipal' {} Maybe Text
a -> DataLakePrincipal
s {$sel:dataLakePrincipalIdentifier:DataLakePrincipal' :: Maybe Text
dataLakePrincipalIdentifier = Maybe Text
a} :: DataLakePrincipal)
instance Core.FromJSON DataLakePrincipal where
parseJSON :: Value -> Parser DataLakePrincipal
parseJSON =
String
-> (Object -> Parser DataLakePrincipal)
-> Value
-> Parser DataLakePrincipal
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DataLakePrincipal"
( \Object
x ->
Maybe Text -> DataLakePrincipal
DataLakePrincipal'
(Maybe Text -> DataLakePrincipal)
-> Parser (Maybe Text) -> Parser DataLakePrincipal
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
"DataLakePrincipalIdentifier")
)
instance Prelude.Hashable DataLakePrincipal
instance Prelude.NFData DataLakePrincipal
instance Core.ToJSON DataLakePrincipal where
toJSON :: DataLakePrincipal -> Value
toJSON DataLakePrincipal' {Maybe Text
dataLakePrincipalIdentifier :: Maybe Text
$sel:dataLakePrincipalIdentifier:DataLakePrincipal' :: DataLakePrincipal -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DataLakePrincipalIdentifier" 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
dataLakePrincipalIdentifier
]
)