{-# 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.LakeFormationConfiguration 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 LakeFormationConfiguration = LakeFormationConfiguration'
{
LakeFormationConfiguration -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
LakeFormationConfiguration -> Maybe Bool
useLakeFormationCredentials :: Prelude.Maybe Prelude.Bool
}
deriving (LakeFormationConfiguration -> LakeFormationConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LakeFormationConfiguration -> LakeFormationConfiguration -> Bool
$c/= :: LakeFormationConfiguration -> LakeFormationConfiguration -> Bool
== :: LakeFormationConfiguration -> LakeFormationConfiguration -> Bool
$c== :: LakeFormationConfiguration -> LakeFormationConfiguration -> Bool
Prelude.Eq, ReadPrec [LakeFormationConfiguration]
ReadPrec LakeFormationConfiguration
Int -> ReadS LakeFormationConfiguration
ReadS [LakeFormationConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LakeFormationConfiguration]
$creadListPrec :: ReadPrec [LakeFormationConfiguration]
readPrec :: ReadPrec LakeFormationConfiguration
$creadPrec :: ReadPrec LakeFormationConfiguration
readList :: ReadS [LakeFormationConfiguration]
$creadList :: ReadS [LakeFormationConfiguration]
readsPrec :: Int -> ReadS LakeFormationConfiguration
$creadsPrec :: Int -> ReadS LakeFormationConfiguration
Prelude.Read, Int -> LakeFormationConfiguration -> ShowS
[LakeFormationConfiguration] -> ShowS
LakeFormationConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LakeFormationConfiguration] -> ShowS
$cshowList :: [LakeFormationConfiguration] -> ShowS
show :: LakeFormationConfiguration -> String
$cshow :: LakeFormationConfiguration -> String
showsPrec :: Int -> LakeFormationConfiguration -> ShowS
$cshowsPrec :: Int -> LakeFormationConfiguration -> ShowS
Prelude.Show, forall x.
Rep LakeFormationConfiguration x -> LakeFormationConfiguration
forall x.
LakeFormationConfiguration -> Rep LakeFormationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LakeFormationConfiguration x -> LakeFormationConfiguration
$cfrom :: forall x.
LakeFormationConfiguration -> Rep LakeFormationConfiguration x
Prelude.Generic)
newLakeFormationConfiguration ::
LakeFormationConfiguration
newLakeFormationConfiguration :: LakeFormationConfiguration
newLakeFormationConfiguration =
LakeFormationConfiguration'
{ $sel:accountId:LakeFormationConfiguration' :: Maybe Text
accountId =
forall a. Maybe a
Prelude.Nothing,
$sel:useLakeFormationCredentials:LakeFormationConfiguration' :: Maybe Bool
useLakeFormationCredentials = forall a. Maybe a
Prelude.Nothing
}
lakeFormationConfiguration_accountId :: Lens.Lens' LakeFormationConfiguration (Prelude.Maybe Prelude.Text)
lakeFormationConfiguration_accountId :: Lens' LakeFormationConfiguration (Maybe Text)
lakeFormationConfiguration_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LakeFormationConfiguration' {Maybe Text
accountId :: Maybe Text
$sel:accountId:LakeFormationConfiguration' :: LakeFormationConfiguration -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: LakeFormationConfiguration
s@LakeFormationConfiguration' {} Maybe Text
a -> LakeFormationConfiguration
s {$sel:accountId:LakeFormationConfiguration' :: Maybe Text
accountId = Maybe Text
a} :: LakeFormationConfiguration)
lakeFormationConfiguration_useLakeFormationCredentials :: Lens.Lens' LakeFormationConfiguration (Prelude.Maybe Prelude.Bool)
lakeFormationConfiguration_useLakeFormationCredentials :: Lens' LakeFormationConfiguration (Maybe Bool)
lakeFormationConfiguration_useLakeFormationCredentials = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LakeFormationConfiguration' {Maybe Bool
useLakeFormationCredentials :: Maybe Bool
$sel:useLakeFormationCredentials:LakeFormationConfiguration' :: LakeFormationConfiguration -> Maybe Bool
useLakeFormationCredentials} -> Maybe Bool
useLakeFormationCredentials) (\s :: LakeFormationConfiguration
s@LakeFormationConfiguration' {} Maybe Bool
a -> LakeFormationConfiguration
s {$sel:useLakeFormationCredentials:LakeFormationConfiguration' :: Maybe Bool
useLakeFormationCredentials = Maybe Bool
a} :: LakeFormationConfiguration)
instance Data.FromJSON LakeFormationConfiguration where
parseJSON :: Value -> Parser LakeFormationConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"LakeFormationConfiguration"
( \Object
x ->
Maybe Text -> Maybe Bool -> LakeFormationConfiguration
LakeFormationConfiguration'
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
"AccountId")
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
"UseLakeFormationCredentials")
)
instance Prelude.Hashable LakeFormationConfiguration where
hashWithSalt :: Int -> LakeFormationConfiguration -> Int
hashWithSalt Int
_salt LakeFormationConfiguration' {Maybe Bool
Maybe Text
useLakeFormationCredentials :: Maybe Bool
accountId :: Maybe Text
$sel:useLakeFormationCredentials:LakeFormationConfiguration' :: LakeFormationConfiguration -> Maybe Bool
$sel:accountId:LakeFormationConfiguration' :: LakeFormationConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accountId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
useLakeFormationCredentials
instance Prelude.NFData LakeFormationConfiguration where
rnf :: LakeFormationConfiguration -> ()
rnf LakeFormationConfiguration' {Maybe Bool
Maybe Text
useLakeFormationCredentials :: Maybe Bool
accountId :: Maybe Text
$sel:useLakeFormationCredentials:LakeFormationConfiguration' :: LakeFormationConfiguration -> Maybe Bool
$sel:accountId:LakeFormationConfiguration' :: LakeFormationConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accountId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
useLakeFormationCredentials
instance Data.ToJSON LakeFormationConfiguration where
toJSON :: LakeFormationConfiguration -> Value
toJSON LakeFormationConfiguration' {Maybe Bool
Maybe Text
useLakeFormationCredentials :: Maybe Bool
accountId :: Maybe Text
$sel:useLakeFormationCredentials:LakeFormationConfiguration' :: LakeFormationConfiguration -> Maybe Bool
$sel:accountId:LakeFormationConfiguration' :: LakeFormationConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AccountId" 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
accountId,
(Key
"UseLakeFormationCredentials" 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 Bool
useLakeFormationCredentials
]
)