{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LakeFormation.Types
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
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]
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
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. 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'
{ $sel:catalogId:PutDataLakeSettings' :: Maybe Text
catalogId = forall a. Maybe a
Prelude.Nothing,
$sel:dataLakeSettings:PutDataLakeSettings' :: DataLakeSettings
dataLakeSettings = DataLakeSettings
pDataLakeSettings_
}
putDataLakeSettings_catalogId :: Lens.Lens' PutDataLakeSettings (Prelude.Maybe Prelude.Text)
putDataLakeSettings_catalogId :: Lens' PutDataLakeSettings (Maybe Text)
putDataLakeSettings_catalogId = 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 :: Lens' PutDataLakeSettings DataLakeSettings
putDataLakeSettings_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 :: (Service -> Service)
-> PutDataLakeSettings -> Request PutDataLakeSettings
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutDataLakeSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutDataLakeSettings)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutDataLakeSettingsResponse
PutDataLakeSettingsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable PutDataLakeSettings where
hashWithSalt :: Int -> PutDataLakeSettings -> Int
hashWithSalt Int
_salt PutDataLakeSettings' {Maybe Text
DataLakeSettings
dataLakeSettings :: DataLakeSettings
catalogId :: Maybe Text
$sel:dataLakeSettings:PutDataLakeSettings' :: PutDataLakeSettings -> DataLakeSettings
$sel:catalogId:PutDataLakeSettings' :: PutDataLakeSettings -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
catalogId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DataLakeSettings
dataLakeSettings
instance Prelude.NFData PutDataLakeSettings where
rnf :: PutDataLakeSettings -> ()
rnf PutDataLakeSettings' {Maybe Text
DataLakeSettings
dataLakeSettings :: DataLakeSettings
catalogId :: Maybe Text
$sel:dataLakeSettings:PutDataLakeSettings' :: PutDataLakeSettings -> DataLakeSettings
$sel:catalogId:PutDataLakeSettings' :: PutDataLakeSettings -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
catalogId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DataLakeSettings
dataLakeSettings
instance Data.ToHeaders PutDataLakeSettings where
toHeaders :: PutDataLakeSettings -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CatalogId" 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
catalogId,
forall a. a -> Maybe a
Prelude.Just
(Key
"DataLakeSettings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DataLakeSettings
dataLakeSettings)
]
)
instance Data.ToPath PutDataLakeSettings where
toPath :: PutDataLakeSettings -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/PutDataLakeSettings"
instance Data.ToQuery PutDataLakeSettings where
toQuery :: PutDataLakeSettings -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutDataLakeSettingsResponse = PutDataLakeSettingsResponse'
{
PutDataLakeSettingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutDataLakeSettingsResponse -> PutDataLakeSettingsResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:PutDataLakeSettingsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putDataLakeSettingsResponse_httpStatus :: Lens.Lens' PutDataLakeSettingsResponse Prelude.Int
putDataLakeSettingsResponse_httpStatus :: Lens' PutDataLakeSettingsResponse Int
putDataLakeSettingsResponse_httpStatus = 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 where
rnf :: PutDataLakeSettingsResponse -> ()
rnf PutDataLakeSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutDataLakeSettingsResponse' :: PutDataLakeSettingsResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus