{-# 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.PutDataLakeSettings
(
PutDataLakeSettings (..),
newPutDataLakeSettings,
putDataLakeSettings_catalogId,
putDataLakeSettings_dataLakeSettings,
PutDataLakeSettingsResponse (..),
newPutDataLakeSettingsResponse,
putDataLakeSettingsResponse_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 PutDataLakeSettings = PutDataLakeSettings'
{
PutDataLakeSettings -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
PutDataLakeSettings -> DataLakeSettings
dataLakeSettings :: DataLakeSettings
}
deriving (PutDataLakeSettings -> PutDataLakeSettings -> Bool
(PutDataLakeSettings -> PutDataLakeSettings -> Bool)
-> (PutDataLakeSettings -> PutDataLakeSettings -> Bool)
-> Eq PutDataLakeSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutDataLakeSettings -> PutDataLakeSettings -> Bool
$c/= :: PutDataLakeSettings -> PutDataLakeSettings -> Bool
== :: PutDataLakeSettings -> PutDataLakeSettings -> Bool
$c== :: PutDataLakeSettings -> PutDataLakeSettings -> Bool
Prelude.Eq, ReadPrec [PutDataLakeSettings]
ReadPrec PutDataLakeSettings
Int -> ReadS PutDataLakeSettings
ReadS [PutDataLakeSettings]
(Int -> ReadS PutDataLakeSettings)
-> ReadS [PutDataLakeSettings]
-> ReadPrec PutDataLakeSettings
-> ReadPrec [PutDataLakeSettings]
-> Read PutDataLakeSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutDataLakeSettings]
$creadListPrec :: ReadPrec [PutDataLakeSettings]
readPrec :: ReadPrec PutDataLakeSettings
$creadPrec :: ReadPrec PutDataLakeSettings
readList :: ReadS [PutDataLakeSettings]
$creadList :: ReadS [PutDataLakeSettings]
readsPrec :: Int -> ReadS PutDataLakeSettings
$creadsPrec :: Int -> ReadS PutDataLakeSettings
Prelude.Read, Int -> PutDataLakeSettings -> ShowS
[PutDataLakeSettings] -> ShowS
PutDataLakeSettings -> String
(Int -> PutDataLakeSettings -> ShowS)
-> (PutDataLakeSettings -> String)
-> ([PutDataLakeSettings] -> ShowS)
-> Show PutDataLakeSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutDataLakeSettings] -> ShowS
$cshowList :: [PutDataLakeSettings] -> ShowS
show :: PutDataLakeSettings -> String
$cshow :: PutDataLakeSettings -> String
showsPrec :: Int -> PutDataLakeSettings -> ShowS
$cshowsPrec :: Int -> PutDataLakeSettings -> ShowS
Prelude.Show, (forall x. PutDataLakeSettings -> Rep PutDataLakeSettings x)
-> (forall x. Rep PutDataLakeSettings x -> PutDataLakeSettings)
-> Generic PutDataLakeSettings
forall x. Rep PutDataLakeSettings x -> PutDataLakeSettings
forall x. PutDataLakeSettings -> Rep PutDataLakeSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutDataLakeSettings x -> PutDataLakeSettings
$cfrom :: forall x. PutDataLakeSettings -> Rep PutDataLakeSettings x
Prelude.Generic)
newPutDataLakeSettings ::
DataLakeSettings ->
PutDataLakeSettings
newPutDataLakeSettings :: DataLakeSettings -> PutDataLakeSettings
newPutDataLakeSettings DataLakeSettings
pDataLakeSettings_ =
PutDataLakeSettings' :: Maybe Text -> DataLakeSettings -> PutDataLakeSettings
PutDataLakeSettings'
{ $sel:catalogId:PutDataLakeSettings' :: Maybe Text
catalogId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dataLakeSettings:PutDataLakeSettings' :: DataLakeSettings
dataLakeSettings = DataLakeSettings
pDataLakeSettings_
}
putDataLakeSettings_catalogId :: Lens.Lens' PutDataLakeSettings (Prelude.Maybe Prelude.Text)
putDataLakeSettings_catalogId :: (Maybe Text -> f (Maybe Text))
-> PutDataLakeSettings -> f PutDataLakeSettings
putDataLakeSettings_catalogId = (PutDataLakeSettings -> Maybe Text)
-> (PutDataLakeSettings -> Maybe Text -> PutDataLakeSettings)
-> Lens
PutDataLakeSettings PutDataLakeSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDataLakeSettings' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:PutDataLakeSettings' :: PutDataLakeSettings -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: PutDataLakeSettings
s@PutDataLakeSettings' {} Maybe Text
a -> PutDataLakeSettings
s {$sel:catalogId:PutDataLakeSettings' :: Maybe Text
catalogId = Maybe Text
a} :: PutDataLakeSettings)
putDataLakeSettings_dataLakeSettings :: Lens.Lens' PutDataLakeSettings DataLakeSettings
putDataLakeSettings_dataLakeSettings :: (DataLakeSettings -> f DataLakeSettings)
-> PutDataLakeSettings -> f PutDataLakeSettings
putDataLakeSettings_dataLakeSettings = (PutDataLakeSettings -> DataLakeSettings)
-> (PutDataLakeSettings -> DataLakeSettings -> PutDataLakeSettings)
-> Lens
PutDataLakeSettings
PutDataLakeSettings
DataLakeSettings
DataLakeSettings
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDataLakeSettings' {DataLakeSettings
dataLakeSettings :: DataLakeSettings
$sel:dataLakeSettings:PutDataLakeSettings' :: PutDataLakeSettings -> DataLakeSettings
dataLakeSettings} -> DataLakeSettings
dataLakeSettings) (\s :: PutDataLakeSettings
s@PutDataLakeSettings' {} DataLakeSettings
a -> PutDataLakeSettings
s {$sel:dataLakeSettings:PutDataLakeSettings' :: DataLakeSettings
dataLakeSettings = DataLakeSettings
a} :: PutDataLakeSettings)
instance Core.AWSRequest PutDataLakeSettings where
type
AWSResponse PutDataLakeSettings =
PutDataLakeSettingsResponse
request :: PutDataLakeSettings -> Request PutDataLakeSettings
request = Service -> PutDataLakeSettings -> Request PutDataLakeSettings
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutDataLakeSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutDataLakeSettings)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutDataLakeSettings))
-> Logger
-> Service
-> Proxy PutDataLakeSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutDataLakeSettings)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutDataLakeSettingsResponse
PutDataLakeSettingsResponse'
(Int -> PutDataLakeSettingsResponse)
-> Either String Int -> Either String PutDataLakeSettingsResponse
forall (f :: * -> *) a b. Functor 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 PutDataLakeSettings
instance Prelude.NFData PutDataLakeSettings
instance Core.ToHeaders PutDataLakeSettings where
toHeaders :: PutDataLakeSettings -> ResponseHeaders
toHeaders =
ResponseHeaders -> PutDataLakeSettings -> 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.PutDataLakeSettings" ::
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 PutDataLakeSettings where
toJSON :: PutDataLakeSettings -> Value
toJSON PutDataLakeSettings' {Maybe Text
DataLakeSettings
dataLakeSettings :: DataLakeSettings
catalogId :: Maybe Text
$sel:dataLakeSettings:PutDataLakeSettings' :: PutDataLakeSettings -> DataLakeSettings
$sel:catalogId:PutDataLakeSettings' :: PutDataLakeSettings -> 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,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DataLakeSettings" Text -> DataLakeSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DataLakeSettings
dataLakeSettings)
]
)
instance Core.ToPath PutDataLakeSettings where
toPath :: PutDataLakeSettings -> ByteString
toPath = ByteString -> PutDataLakeSettings -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutDataLakeSettings where
toQuery :: PutDataLakeSettings -> QueryString
toQuery = QueryString -> PutDataLakeSettings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutDataLakeSettingsResponse = PutDataLakeSettingsResponse'
{
PutDataLakeSettingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutDataLakeSettingsResponse -> PutDataLakeSettingsResponse -> Bool
(PutDataLakeSettingsResponse
-> PutDataLakeSettingsResponse -> Bool)
-> (PutDataLakeSettingsResponse
-> PutDataLakeSettingsResponse -> Bool)
-> Eq PutDataLakeSettingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutDataLakeSettingsResponse -> PutDataLakeSettingsResponse -> Bool
$c/= :: PutDataLakeSettingsResponse -> PutDataLakeSettingsResponse -> Bool
== :: PutDataLakeSettingsResponse -> PutDataLakeSettingsResponse -> Bool
$c== :: PutDataLakeSettingsResponse -> PutDataLakeSettingsResponse -> Bool
Prelude.Eq, ReadPrec [PutDataLakeSettingsResponse]
ReadPrec PutDataLakeSettingsResponse
Int -> ReadS PutDataLakeSettingsResponse
ReadS [PutDataLakeSettingsResponse]
(Int -> ReadS PutDataLakeSettingsResponse)
-> ReadS [PutDataLakeSettingsResponse]
-> ReadPrec PutDataLakeSettingsResponse
-> ReadPrec [PutDataLakeSettingsResponse]
-> Read PutDataLakeSettingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutDataLakeSettingsResponse]
$creadListPrec :: ReadPrec [PutDataLakeSettingsResponse]
readPrec :: ReadPrec PutDataLakeSettingsResponse
$creadPrec :: ReadPrec PutDataLakeSettingsResponse
readList :: ReadS [PutDataLakeSettingsResponse]
$creadList :: ReadS [PutDataLakeSettingsResponse]
readsPrec :: Int -> ReadS PutDataLakeSettingsResponse
$creadsPrec :: Int -> ReadS PutDataLakeSettingsResponse
Prelude.Read, Int -> PutDataLakeSettingsResponse -> ShowS
[PutDataLakeSettingsResponse] -> ShowS
PutDataLakeSettingsResponse -> String
(Int -> PutDataLakeSettingsResponse -> ShowS)
-> (PutDataLakeSettingsResponse -> String)
-> ([PutDataLakeSettingsResponse] -> ShowS)
-> Show PutDataLakeSettingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutDataLakeSettingsResponse] -> ShowS
$cshowList :: [PutDataLakeSettingsResponse] -> ShowS
show :: PutDataLakeSettingsResponse -> String
$cshow :: PutDataLakeSettingsResponse -> String
showsPrec :: Int -> PutDataLakeSettingsResponse -> ShowS
$cshowsPrec :: Int -> PutDataLakeSettingsResponse -> ShowS
Prelude.Show, (forall x.
PutDataLakeSettingsResponse -> Rep PutDataLakeSettingsResponse x)
-> (forall x.
Rep PutDataLakeSettingsResponse x -> PutDataLakeSettingsResponse)
-> Generic PutDataLakeSettingsResponse
forall x.
Rep PutDataLakeSettingsResponse x -> PutDataLakeSettingsResponse
forall x.
PutDataLakeSettingsResponse -> Rep PutDataLakeSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutDataLakeSettingsResponse x -> PutDataLakeSettingsResponse
$cfrom :: forall x.
PutDataLakeSettingsResponse -> Rep PutDataLakeSettingsResponse x
Prelude.Generic)
newPutDataLakeSettingsResponse ::
Prelude.Int ->
PutDataLakeSettingsResponse
newPutDataLakeSettingsResponse :: Int -> PutDataLakeSettingsResponse
newPutDataLakeSettingsResponse Int
pHttpStatus_ =
PutDataLakeSettingsResponse' :: Int -> PutDataLakeSettingsResponse
PutDataLakeSettingsResponse'
{ $sel:httpStatus:PutDataLakeSettingsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putDataLakeSettingsResponse_httpStatus :: Lens.Lens' PutDataLakeSettingsResponse Prelude.Int
putDataLakeSettingsResponse_httpStatus :: (Int -> f Int)
-> PutDataLakeSettingsResponse -> f PutDataLakeSettingsResponse
putDataLakeSettingsResponse_httpStatus = (PutDataLakeSettingsResponse -> Int)
-> (PutDataLakeSettingsResponse
-> Int -> PutDataLakeSettingsResponse)
-> Lens
PutDataLakeSettingsResponse PutDataLakeSettingsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDataLakeSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutDataLakeSettingsResponse' :: PutDataLakeSettingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutDataLakeSettingsResponse
s@PutDataLakeSettingsResponse' {} Int
a -> PutDataLakeSettingsResponse
s {$sel:httpStatus:PutDataLakeSettingsResponse' :: Int
httpStatus = Int
a} :: PutDataLakeSettingsResponse)
instance Prelude.NFData PutDataLakeSettingsResponse