{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.LakeFormation.GetDataLakeSettings
(
GetDataLakeSettings (..),
newGetDataLakeSettings,
getDataLakeSettings_catalogId,
GetDataLakeSettingsResponse (..),
newGetDataLakeSettingsResponse,
getDataLakeSettingsResponse_dataLakeSettings,
getDataLakeSettingsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.LakeFormation.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetDataLakeSettings = GetDataLakeSettings'
{
GetDataLakeSettings -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text
}
deriving (GetDataLakeSettings -> GetDataLakeSettings -> Bool
(GetDataLakeSettings -> GetDataLakeSettings -> Bool)
-> (GetDataLakeSettings -> GetDataLakeSettings -> Bool)
-> Eq GetDataLakeSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDataLakeSettings -> GetDataLakeSettings -> Bool
$c/= :: GetDataLakeSettings -> GetDataLakeSettings -> Bool
== :: GetDataLakeSettings -> GetDataLakeSettings -> Bool
$c== :: GetDataLakeSettings -> GetDataLakeSettings -> Bool
Prelude.Eq, ReadPrec [GetDataLakeSettings]
ReadPrec GetDataLakeSettings
Int -> ReadS GetDataLakeSettings
ReadS [GetDataLakeSettings]
(Int -> ReadS GetDataLakeSettings)
-> ReadS [GetDataLakeSettings]
-> ReadPrec GetDataLakeSettings
-> ReadPrec [GetDataLakeSettings]
-> Read GetDataLakeSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDataLakeSettings]
$creadListPrec :: ReadPrec [GetDataLakeSettings]
readPrec :: ReadPrec GetDataLakeSettings
$creadPrec :: ReadPrec GetDataLakeSettings
readList :: ReadS [GetDataLakeSettings]
$creadList :: ReadS [GetDataLakeSettings]
readsPrec :: Int -> ReadS GetDataLakeSettings
$creadsPrec :: Int -> ReadS GetDataLakeSettings
Prelude.Read, Int -> GetDataLakeSettings -> ShowS
[GetDataLakeSettings] -> ShowS
GetDataLakeSettings -> String
(Int -> GetDataLakeSettings -> ShowS)
-> (GetDataLakeSettings -> String)
-> ([GetDataLakeSettings] -> ShowS)
-> Show GetDataLakeSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDataLakeSettings] -> ShowS
$cshowList :: [GetDataLakeSettings] -> ShowS
show :: GetDataLakeSettings -> String
$cshow :: GetDataLakeSettings -> String
showsPrec :: Int -> GetDataLakeSettings -> ShowS
$cshowsPrec :: Int -> GetDataLakeSettings -> ShowS
Prelude.Show, (forall x. GetDataLakeSettings -> Rep GetDataLakeSettings x)
-> (forall x. Rep GetDataLakeSettings x -> GetDataLakeSettings)
-> Generic GetDataLakeSettings
forall x. Rep GetDataLakeSettings x -> GetDataLakeSettings
forall x. GetDataLakeSettings -> Rep GetDataLakeSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDataLakeSettings x -> GetDataLakeSettings
$cfrom :: forall x. GetDataLakeSettings -> Rep GetDataLakeSettings x
Prelude.Generic)
newGetDataLakeSettings ::
GetDataLakeSettings
newGetDataLakeSettings :: GetDataLakeSettings
newGetDataLakeSettings =
GetDataLakeSettings' :: Maybe Text -> GetDataLakeSettings
GetDataLakeSettings' {$sel:catalogId:GetDataLakeSettings' :: Maybe Text
catalogId = Maybe Text
forall a. Maybe a
Prelude.Nothing}
getDataLakeSettings_catalogId :: Lens.Lens' GetDataLakeSettings (Prelude.Maybe Prelude.Text)
getDataLakeSettings_catalogId :: (Maybe Text -> f (Maybe Text))
-> GetDataLakeSettings -> f GetDataLakeSettings
getDataLakeSettings_catalogId = (GetDataLakeSettings -> Maybe Text)
-> (GetDataLakeSettings -> Maybe Text -> GetDataLakeSettings)
-> Lens
GetDataLakeSettings GetDataLakeSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDataLakeSettings' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:GetDataLakeSettings' :: GetDataLakeSettings -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: GetDataLakeSettings
s@GetDataLakeSettings' {} Maybe Text
a -> GetDataLakeSettings
s {$sel:catalogId:GetDataLakeSettings' :: Maybe Text
catalogId = Maybe Text
a} :: GetDataLakeSettings)
instance Core.AWSRequest GetDataLakeSettings where
type
AWSResponse GetDataLakeSettings =
GetDataLakeSettingsResponse
request :: GetDataLakeSettings -> Request GetDataLakeSettings
request = Service -> GetDataLakeSettings -> Request GetDataLakeSettings
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetDataLakeSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetDataLakeSettings)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetDataLakeSettings))
-> Logger
-> Service
-> Proxy GetDataLakeSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetDataLakeSettings)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe DataLakeSettings -> Int -> GetDataLakeSettingsResponse
GetDataLakeSettingsResponse'
(Maybe DataLakeSettings -> Int -> GetDataLakeSettingsResponse)
-> Either String (Maybe DataLakeSettings)
-> Either String (Int -> GetDataLakeSettingsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DataLakeSettings)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DataLakeSettings")
Either String (Int -> GetDataLakeSettingsResponse)
-> Either String Int -> Either String GetDataLakeSettingsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetDataLakeSettings
instance Prelude.NFData GetDataLakeSettings
instance Core.ToHeaders GetDataLakeSettings where
toHeaders :: GetDataLakeSettings -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetDataLakeSettings -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSLakeFormation.GetDataLakeSettings" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON GetDataLakeSettings where
toJSON :: GetDataLakeSettings -> Value
toJSON GetDataLakeSettings' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:GetDataLakeSettings' :: GetDataLakeSettings -> 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]
)
instance Core.ToPath GetDataLakeSettings where
toPath :: GetDataLakeSettings -> ByteString
toPath = ByteString -> GetDataLakeSettings -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetDataLakeSettings where
toQuery :: GetDataLakeSettings -> QueryString
toQuery = QueryString -> GetDataLakeSettings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetDataLakeSettingsResponse = GetDataLakeSettingsResponse'
{
GetDataLakeSettingsResponse -> Maybe DataLakeSettings
dataLakeSettings :: Prelude.Maybe DataLakeSettings,
GetDataLakeSettingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetDataLakeSettingsResponse -> GetDataLakeSettingsResponse -> Bool
(GetDataLakeSettingsResponse
-> GetDataLakeSettingsResponse -> Bool)
-> (GetDataLakeSettingsResponse
-> GetDataLakeSettingsResponse -> Bool)
-> Eq GetDataLakeSettingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDataLakeSettingsResponse -> GetDataLakeSettingsResponse -> Bool
$c/= :: GetDataLakeSettingsResponse -> GetDataLakeSettingsResponse -> Bool
== :: GetDataLakeSettingsResponse -> GetDataLakeSettingsResponse -> Bool
$c== :: GetDataLakeSettingsResponse -> GetDataLakeSettingsResponse -> Bool
Prelude.Eq, ReadPrec [GetDataLakeSettingsResponse]
ReadPrec GetDataLakeSettingsResponse
Int -> ReadS GetDataLakeSettingsResponse
ReadS [GetDataLakeSettingsResponse]
(Int -> ReadS GetDataLakeSettingsResponse)
-> ReadS [GetDataLakeSettingsResponse]
-> ReadPrec GetDataLakeSettingsResponse
-> ReadPrec [GetDataLakeSettingsResponse]
-> Read GetDataLakeSettingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDataLakeSettingsResponse]
$creadListPrec :: ReadPrec [GetDataLakeSettingsResponse]
readPrec :: ReadPrec GetDataLakeSettingsResponse
$creadPrec :: ReadPrec GetDataLakeSettingsResponse
readList :: ReadS [GetDataLakeSettingsResponse]
$creadList :: ReadS [GetDataLakeSettingsResponse]
readsPrec :: Int -> ReadS GetDataLakeSettingsResponse
$creadsPrec :: Int -> ReadS GetDataLakeSettingsResponse
Prelude.Read, Int -> GetDataLakeSettingsResponse -> ShowS
[GetDataLakeSettingsResponse] -> ShowS
GetDataLakeSettingsResponse -> String
(Int -> GetDataLakeSettingsResponse -> ShowS)
-> (GetDataLakeSettingsResponse -> String)
-> ([GetDataLakeSettingsResponse] -> ShowS)
-> Show GetDataLakeSettingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDataLakeSettingsResponse] -> ShowS
$cshowList :: [GetDataLakeSettingsResponse] -> ShowS
show :: GetDataLakeSettingsResponse -> String
$cshow :: GetDataLakeSettingsResponse -> String
showsPrec :: Int -> GetDataLakeSettingsResponse -> ShowS
$cshowsPrec :: Int -> GetDataLakeSettingsResponse -> ShowS
Prelude.Show, (forall x.
GetDataLakeSettingsResponse -> Rep GetDataLakeSettingsResponse x)
-> (forall x.
Rep GetDataLakeSettingsResponse x -> GetDataLakeSettingsResponse)
-> Generic GetDataLakeSettingsResponse
forall x.
Rep GetDataLakeSettingsResponse x -> GetDataLakeSettingsResponse
forall x.
GetDataLakeSettingsResponse -> Rep GetDataLakeSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDataLakeSettingsResponse x -> GetDataLakeSettingsResponse
$cfrom :: forall x.
GetDataLakeSettingsResponse -> Rep GetDataLakeSettingsResponse x
Prelude.Generic)
newGetDataLakeSettingsResponse ::
Prelude.Int ->
GetDataLakeSettingsResponse
newGetDataLakeSettingsResponse :: Int -> GetDataLakeSettingsResponse
newGetDataLakeSettingsResponse Int
pHttpStatus_ =
GetDataLakeSettingsResponse' :: Maybe DataLakeSettings -> Int -> GetDataLakeSettingsResponse
GetDataLakeSettingsResponse'
{ $sel:dataLakeSettings:GetDataLakeSettingsResponse' :: Maybe DataLakeSettings
dataLakeSettings =
Maybe DataLakeSettings
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetDataLakeSettingsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getDataLakeSettingsResponse_dataLakeSettings :: Lens.Lens' GetDataLakeSettingsResponse (Prelude.Maybe DataLakeSettings)
getDataLakeSettingsResponse_dataLakeSettings :: (Maybe DataLakeSettings -> f (Maybe DataLakeSettings))
-> GetDataLakeSettingsResponse -> f GetDataLakeSettingsResponse
getDataLakeSettingsResponse_dataLakeSettings = (GetDataLakeSettingsResponse -> Maybe DataLakeSettings)
-> (GetDataLakeSettingsResponse
-> Maybe DataLakeSettings -> GetDataLakeSettingsResponse)
-> Lens
GetDataLakeSettingsResponse
GetDataLakeSettingsResponse
(Maybe DataLakeSettings)
(Maybe DataLakeSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDataLakeSettingsResponse' {Maybe DataLakeSettings
dataLakeSettings :: Maybe DataLakeSettings
$sel:dataLakeSettings:GetDataLakeSettingsResponse' :: GetDataLakeSettingsResponse -> Maybe DataLakeSettings
dataLakeSettings} -> Maybe DataLakeSettings
dataLakeSettings) (\s :: GetDataLakeSettingsResponse
s@GetDataLakeSettingsResponse' {} Maybe DataLakeSettings
a -> GetDataLakeSettingsResponse
s {$sel:dataLakeSettings:GetDataLakeSettingsResponse' :: Maybe DataLakeSettings
dataLakeSettings = Maybe DataLakeSettings
a} :: GetDataLakeSettingsResponse)
getDataLakeSettingsResponse_httpStatus :: Lens.Lens' GetDataLakeSettingsResponse Prelude.Int
getDataLakeSettingsResponse_httpStatus :: (Int -> f Int)
-> GetDataLakeSettingsResponse -> f GetDataLakeSettingsResponse
getDataLakeSettingsResponse_httpStatus = (GetDataLakeSettingsResponse -> Int)
-> (GetDataLakeSettingsResponse
-> Int -> GetDataLakeSettingsResponse)
-> Lens
GetDataLakeSettingsResponse GetDataLakeSettingsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDataLakeSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDataLakeSettingsResponse' :: GetDataLakeSettingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDataLakeSettingsResponse
s@GetDataLakeSettingsResponse' {} Int
a -> GetDataLakeSettingsResponse
s {$sel:httpStatus:GetDataLakeSettingsResponse' :: Int
httpStatus = Int
a} :: GetDataLakeSettingsResponse)
instance Prelude.NFData GetDataLakeSettingsResponse