{-# 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.Glue.PutDataCatalogEncryptionSettings
(
PutDataCatalogEncryptionSettings (..),
newPutDataCatalogEncryptionSettings,
putDataCatalogEncryptionSettings_catalogId,
putDataCatalogEncryptionSettings_dataCatalogEncryptionSettings,
PutDataCatalogEncryptionSettingsResponse (..),
newPutDataCatalogEncryptionSettingsResponse,
putDataCatalogEncryptionSettingsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Glue.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 PutDataCatalogEncryptionSettings = PutDataCatalogEncryptionSettings'
{
PutDataCatalogEncryptionSettings -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
PutDataCatalogEncryptionSettings -> DataCatalogEncryptionSettings
dataCatalogEncryptionSettings :: DataCatalogEncryptionSettings
}
deriving (PutDataCatalogEncryptionSettings
-> PutDataCatalogEncryptionSettings -> Bool
(PutDataCatalogEncryptionSettings
-> PutDataCatalogEncryptionSettings -> Bool)
-> (PutDataCatalogEncryptionSettings
-> PutDataCatalogEncryptionSettings -> Bool)
-> Eq PutDataCatalogEncryptionSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutDataCatalogEncryptionSettings
-> PutDataCatalogEncryptionSettings -> Bool
$c/= :: PutDataCatalogEncryptionSettings
-> PutDataCatalogEncryptionSettings -> Bool
== :: PutDataCatalogEncryptionSettings
-> PutDataCatalogEncryptionSettings -> Bool
$c== :: PutDataCatalogEncryptionSettings
-> PutDataCatalogEncryptionSettings -> Bool
Prelude.Eq, ReadPrec [PutDataCatalogEncryptionSettings]
ReadPrec PutDataCatalogEncryptionSettings
Int -> ReadS PutDataCatalogEncryptionSettings
ReadS [PutDataCatalogEncryptionSettings]
(Int -> ReadS PutDataCatalogEncryptionSettings)
-> ReadS [PutDataCatalogEncryptionSettings]
-> ReadPrec PutDataCatalogEncryptionSettings
-> ReadPrec [PutDataCatalogEncryptionSettings]
-> Read PutDataCatalogEncryptionSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutDataCatalogEncryptionSettings]
$creadListPrec :: ReadPrec [PutDataCatalogEncryptionSettings]
readPrec :: ReadPrec PutDataCatalogEncryptionSettings
$creadPrec :: ReadPrec PutDataCatalogEncryptionSettings
readList :: ReadS [PutDataCatalogEncryptionSettings]
$creadList :: ReadS [PutDataCatalogEncryptionSettings]
readsPrec :: Int -> ReadS PutDataCatalogEncryptionSettings
$creadsPrec :: Int -> ReadS PutDataCatalogEncryptionSettings
Prelude.Read, Int -> PutDataCatalogEncryptionSettings -> ShowS
[PutDataCatalogEncryptionSettings] -> ShowS
PutDataCatalogEncryptionSettings -> String
(Int -> PutDataCatalogEncryptionSettings -> ShowS)
-> (PutDataCatalogEncryptionSettings -> String)
-> ([PutDataCatalogEncryptionSettings] -> ShowS)
-> Show PutDataCatalogEncryptionSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutDataCatalogEncryptionSettings] -> ShowS
$cshowList :: [PutDataCatalogEncryptionSettings] -> ShowS
show :: PutDataCatalogEncryptionSettings -> String
$cshow :: PutDataCatalogEncryptionSettings -> String
showsPrec :: Int -> PutDataCatalogEncryptionSettings -> ShowS
$cshowsPrec :: Int -> PutDataCatalogEncryptionSettings -> ShowS
Prelude.Show, (forall x.
PutDataCatalogEncryptionSettings
-> Rep PutDataCatalogEncryptionSettings x)
-> (forall x.
Rep PutDataCatalogEncryptionSettings x
-> PutDataCatalogEncryptionSettings)
-> Generic PutDataCatalogEncryptionSettings
forall x.
Rep PutDataCatalogEncryptionSettings x
-> PutDataCatalogEncryptionSettings
forall x.
PutDataCatalogEncryptionSettings
-> Rep PutDataCatalogEncryptionSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutDataCatalogEncryptionSettings x
-> PutDataCatalogEncryptionSettings
$cfrom :: forall x.
PutDataCatalogEncryptionSettings
-> Rep PutDataCatalogEncryptionSettings x
Prelude.Generic)
newPutDataCatalogEncryptionSettings ::
DataCatalogEncryptionSettings ->
PutDataCatalogEncryptionSettings
newPutDataCatalogEncryptionSettings :: DataCatalogEncryptionSettings -> PutDataCatalogEncryptionSettings
newPutDataCatalogEncryptionSettings
DataCatalogEncryptionSettings
pDataCatalogEncryptionSettings_ =
PutDataCatalogEncryptionSettings' :: Maybe Text
-> DataCatalogEncryptionSettings
-> PutDataCatalogEncryptionSettings
PutDataCatalogEncryptionSettings'
{ $sel:catalogId:PutDataCatalogEncryptionSettings' :: Maybe Text
catalogId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dataCatalogEncryptionSettings:PutDataCatalogEncryptionSettings' :: DataCatalogEncryptionSettings
dataCatalogEncryptionSettings =
DataCatalogEncryptionSettings
pDataCatalogEncryptionSettings_
}
putDataCatalogEncryptionSettings_catalogId :: Lens.Lens' PutDataCatalogEncryptionSettings (Prelude.Maybe Prelude.Text)
putDataCatalogEncryptionSettings_catalogId :: (Maybe Text -> f (Maybe Text))
-> PutDataCatalogEncryptionSettings
-> f PutDataCatalogEncryptionSettings
putDataCatalogEncryptionSettings_catalogId = (PutDataCatalogEncryptionSettings -> Maybe Text)
-> (PutDataCatalogEncryptionSettings
-> Maybe Text -> PutDataCatalogEncryptionSettings)
-> Lens
PutDataCatalogEncryptionSettings
PutDataCatalogEncryptionSettings
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDataCatalogEncryptionSettings' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:PutDataCatalogEncryptionSettings' :: PutDataCatalogEncryptionSettings -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: PutDataCatalogEncryptionSettings
s@PutDataCatalogEncryptionSettings' {} Maybe Text
a -> PutDataCatalogEncryptionSettings
s {$sel:catalogId:PutDataCatalogEncryptionSettings' :: Maybe Text
catalogId = Maybe Text
a} :: PutDataCatalogEncryptionSettings)
putDataCatalogEncryptionSettings_dataCatalogEncryptionSettings :: Lens.Lens' PutDataCatalogEncryptionSettings DataCatalogEncryptionSettings
putDataCatalogEncryptionSettings_dataCatalogEncryptionSettings :: (DataCatalogEncryptionSettings -> f DataCatalogEncryptionSettings)
-> PutDataCatalogEncryptionSettings
-> f PutDataCatalogEncryptionSettings
putDataCatalogEncryptionSettings_dataCatalogEncryptionSettings = (PutDataCatalogEncryptionSettings -> DataCatalogEncryptionSettings)
-> (PutDataCatalogEncryptionSettings
-> DataCatalogEncryptionSettings
-> PutDataCatalogEncryptionSettings)
-> Lens
PutDataCatalogEncryptionSettings
PutDataCatalogEncryptionSettings
DataCatalogEncryptionSettings
DataCatalogEncryptionSettings
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDataCatalogEncryptionSettings' {DataCatalogEncryptionSettings
dataCatalogEncryptionSettings :: DataCatalogEncryptionSettings
$sel:dataCatalogEncryptionSettings:PutDataCatalogEncryptionSettings' :: PutDataCatalogEncryptionSettings -> DataCatalogEncryptionSettings
dataCatalogEncryptionSettings} -> DataCatalogEncryptionSettings
dataCatalogEncryptionSettings) (\s :: PutDataCatalogEncryptionSettings
s@PutDataCatalogEncryptionSettings' {} DataCatalogEncryptionSettings
a -> PutDataCatalogEncryptionSettings
s {$sel:dataCatalogEncryptionSettings:PutDataCatalogEncryptionSettings' :: DataCatalogEncryptionSettings
dataCatalogEncryptionSettings = DataCatalogEncryptionSettings
a} :: PutDataCatalogEncryptionSettings)
instance
Core.AWSRequest
PutDataCatalogEncryptionSettings
where
type
AWSResponse PutDataCatalogEncryptionSettings =
PutDataCatalogEncryptionSettingsResponse
request :: PutDataCatalogEncryptionSettings
-> Request PutDataCatalogEncryptionSettings
request = Service
-> PutDataCatalogEncryptionSettings
-> Request PutDataCatalogEncryptionSettings
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutDataCatalogEncryptionSettings
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutDataCatalogEncryptionSettings)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutDataCatalogEncryptionSettings))
-> Logger
-> Service
-> Proxy PutDataCatalogEncryptionSettings
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutDataCatalogEncryptionSettings)))
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 -> PutDataCatalogEncryptionSettingsResponse
PutDataCatalogEncryptionSettingsResponse'
(Int -> PutDataCatalogEncryptionSettingsResponse)
-> Either String Int
-> Either String PutDataCatalogEncryptionSettingsResponse
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
PutDataCatalogEncryptionSettings
instance
Prelude.NFData
PutDataCatalogEncryptionSettings
instance
Core.ToHeaders
PutDataCatalogEncryptionSettings
where
toHeaders :: PutDataCatalogEncryptionSettings -> ResponseHeaders
toHeaders =
ResponseHeaders
-> PutDataCatalogEncryptionSettings -> 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
"AWSGlue.PutDataCatalogEncryptionSettings" ::
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 PutDataCatalogEncryptionSettings where
toJSON :: PutDataCatalogEncryptionSettings -> Value
toJSON PutDataCatalogEncryptionSettings' {Maybe Text
DataCatalogEncryptionSettings
dataCatalogEncryptionSettings :: DataCatalogEncryptionSettings
catalogId :: Maybe Text
$sel:dataCatalogEncryptionSettings:PutDataCatalogEncryptionSettings' :: PutDataCatalogEncryptionSettings -> DataCatalogEncryptionSettings
$sel:catalogId:PutDataCatalogEncryptionSettings' :: PutDataCatalogEncryptionSettings -> 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
"DataCatalogEncryptionSettings"
Text -> DataCatalogEncryptionSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DataCatalogEncryptionSettings
dataCatalogEncryptionSettings
)
]
)
instance Core.ToPath PutDataCatalogEncryptionSettings where
toPath :: PutDataCatalogEncryptionSettings -> ByteString
toPath = ByteString -> PutDataCatalogEncryptionSettings -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
PutDataCatalogEncryptionSettings
where
toQuery :: PutDataCatalogEncryptionSettings -> QueryString
toQuery = QueryString -> PutDataCatalogEncryptionSettings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutDataCatalogEncryptionSettingsResponse = PutDataCatalogEncryptionSettingsResponse'
{
PutDataCatalogEncryptionSettingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutDataCatalogEncryptionSettingsResponse
-> PutDataCatalogEncryptionSettingsResponse -> Bool
(PutDataCatalogEncryptionSettingsResponse
-> PutDataCatalogEncryptionSettingsResponse -> Bool)
-> (PutDataCatalogEncryptionSettingsResponse
-> PutDataCatalogEncryptionSettingsResponse -> Bool)
-> Eq PutDataCatalogEncryptionSettingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutDataCatalogEncryptionSettingsResponse
-> PutDataCatalogEncryptionSettingsResponse -> Bool
$c/= :: PutDataCatalogEncryptionSettingsResponse
-> PutDataCatalogEncryptionSettingsResponse -> Bool
== :: PutDataCatalogEncryptionSettingsResponse
-> PutDataCatalogEncryptionSettingsResponse -> Bool
$c== :: PutDataCatalogEncryptionSettingsResponse
-> PutDataCatalogEncryptionSettingsResponse -> Bool
Prelude.Eq, ReadPrec [PutDataCatalogEncryptionSettingsResponse]
ReadPrec PutDataCatalogEncryptionSettingsResponse
Int -> ReadS PutDataCatalogEncryptionSettingsResponse
ReadS [PutDataCatalogEncryptionSettingsResponse]
(Int -> ReadS PutDataCatalogEncryptionSettingsResponse)
-> ReadS [PutDataCatalogEncryptionSettingsResponse]
-> ReadPrec PutDataCatalogEncryptionSettingsResponse
-> ReadPrec [PutDataCatalogEncryptionSettingsResponse]
-> Read PutDataCatalogEncryptionSettingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutDataCatalogEncryptionSettingsResponse]
$creadListPrec :: ReadPrec [PutDataCatalogEncryptionSettingsResponse]
readPrec :: ReadPrec PutDataCatalogEncryptionSettingsResponse
$creadPrec :: ReadPrec PutDataCatalogEncryptionSettingsResponse
readList :: ReadS [PutDataCatalogEncryptionSettingsResponse]
$creadList :: ReadS [PutDataCatalogEncryptionSettingsResponse]
readsPrec :: Int -> ReadS PutDataCatalogEncryptionSettingsResponse
$creadsPrec :: Int -> ReadS PutDataCatalogEncryptionSettingsResponse
Prelude.Read, Int -> PutDataCatalogEncryptionSettingsResponse -> ShowS
[PutDataCatalogEncryptionSettingsResponse] -> ShowS
PutDataCatalogEncryptionSettingsResponse -> String
(Int -> PutDataCatalogEncryptionSettingsResponse -> ShowS)
-> (PutDataCatalogEncryptionSettingsResponse -> String)
-> ([PutDataCatalogEncryptionSettingsResponse] -> ShowS)
-> Show PutDataCatalogEncryptionSettingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutDataCatalogEncryptionSettingsResponse] -> ShowS
$cshowList :: [PutDataCatalogEncryptionSettingsResponse] -> ShowS
show :: PutDataCatalogEncryptionSettingsResponse -> String
$cshow :: PutDataCatalogEncryptionSettingsResponse -> String
showsPrec :: Int -> PutDataCatalogEncryptionSettingsResponse -> ShowS
$cshowsPrec :: Int -> PutDataCatalogEncryptionSettingsResponse -> ShowS
Prelude.Show, (forall x.
PutDataCatalogEncryptionSettingsResponse
-> Rep PutDataCatalogEncryptionSettingsResponse x)
-> (forall x.
Rep PutDataCatalogEncryptionSettingsResponse x
-> PutDataCatalogEncryptionSettingsResponse)
-> Generic PutDataCatalogEncryptionSettingsResponse
forall x.
Rep PutDataCatalogEncryptionSettingsResponse x
-> PutDataCatalogEncryptionSettingsResponse
forall x.
PutDataCatalogEncryptionSettingsResponse
-> Rep PutDataCatalogEncryptionSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutDataCatalogEncryptionSettingsResponse x
-> PutDataCatalogEncryptionSettingsResponse
$cfrom :: forall x.
PutDataCatalogEncryptionSettingsResponse
-> Rep PutDataCatalogEncryptionSettingsResponse x
Prelude.Generic)
newPutDataCatalogEncryptionSettingsResponse ::
Prelude.Int ->
PutDataCatalogEncryptionSettingsResponse
newPutDataCatalogEncryptionSettingsResponse :: Int -> PutDataCatalogEncryptionSettingsResponse
newPutDataCatalogEncryptionSettingsResponse
Int
pHttpStatus_ =
PutDataCatalogEncryptionSettingsResponse' :: Int -> PutDataCatalogEncryptionSettingsResponse
PutDataCatalogEncryptionSettingsResponse'
{ $sel:httpStatus:PutDataCatalogEncryptionSettingsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putDataCatalogEncryptionSettingsResponse_httpStatus :: Lens.Lens' PutDataCatalogEncryptionSettingsResponse Prelude.Int
putDataCatalogEncryptionSettingsResponse_httpStatus :: (Int -> f Int)
-> PutDataCatalogEncryptionSettingsResponse
-> f PutDataCatalogEncryptionSettingsResponse
putDataCatalogEncryptionSettingsResponse_httpStatus = (PutDataCatalogEncryptionSettingsResponse -> Int)
-> (PutDataCatalogEncryptionSettingsResponse
-> Int -> PutDataCatalogEncryptionSettingsResponse)
-> Lens
PutDataCatalogEncryptionSettingsResponse
PutDataCatalogEncryptionSettingsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDataCatalogEncryptionSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutDataCatalogEncryptionSettingsResponse' :: PutDataCatalogEncryptionSettingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutDataCatalogEncryptionSettingsResponse
s@PutDataCatalogEncryptionSettingsResponse' {} Int
a -> PutDataCatalogEncryptionSettingsResponse
s {$sel:httpStatus:PutDataCatalogEncryptionSettingsResponse' :: Int
httpStatus = Int
a} :: PutDataCatalogEncryptionSettingsResponse)
instance
Prelude.NFData
PutDataCatalogEncryptionSettingsResponse