{-# 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.UpdateTableObjects
(
UpdateTableObjects (..),
newUpdateTableObjects,
updateTableObjects_catalogId,
updateTableObjects_transactionId,
updateTableObjects_databaseName,
updateTableObjects_tableName,
updateTableObjects_writeOperations,
UpdateTableObjectsResponse (..),
newUpdateTableObjectsResponse,
updateTableObjectsResponse_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 UpdateTableObjects = UpdateTableObjects'
{
UpdateTableObjects -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
UpdateTableObjects -> Maybe Text
transactionId :: Prelude.Maybe Prelude.Text,
UpdateTableObjects -> Text
databaseName :: Prelude.Text,
UpdateTableObjects -> Text
tableName :: Prelude.Text,
UpdateTableObjects -> NonEmpty WriteOperation
writeOperations :: Prelude.NonEmpty WriteOperation
}
deriving (UpdateTableObjects -> UpdateTableObjects -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTableObjects -> UpdateTableObjects -> Bool
$c/= :: UpdateTableObjects -> UpdateTableObjects -> Bool
== :: UpdateTableObjects -> UpdateTableObjects -> Bool
$c== :: UpdateTableObjects -> UpdateTableObjects -> Bool
Prelude.Eq, ReadPrec [UpdateTableObjects]
ReadPrec UpdateTableObjects
Int -> ReadS UpdateTableObjects
ReadS [UpdateTableObjects]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTableObjects]
$creadListPrec :: ReadPrec [UpdateTableObjects]
readPrec :: ReadPrec UpdateTableObjects
$creadPrec :: ReadPrec UpdateTableObjects
readList :: ReadS [UpdateTableObjects]
$creadList :: ReadS [UpdateTableObjects]
readsPrec :: Int -> ReadS UpdateTableObjects
$creadsPrec :: Int -> ReadS UpdateTableObjects
Prelude.Read, Int -> UpdateTableObjects -> ShowS
[UpdateTableObjects] -> ShowS
UpdateTableObjects -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTableObjects] -> ShowS
$cshowList :: [UpdateTableObjects] -> ShowS
show :: UpdateTableObjects -> String
$cshow :: UpdateTableObjects -> String
showsPrec :: Int -> UpdateTableObjects -> ShowS
$cshowsPrec :: Int -> UpdateTableObjects -> ShowS
Prelude.Show, forall x. Rep UpdateTableObjects x -> UpdateTableObjects
forall x. UpdateTableObjects -> Rep UpdateTableObjects x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateTableObjects x -> UpdateTableObjects
$cfrom :: forall x. UpdateTableObjects -> Rep UpdateTableObjects x
Prelude.Generic)
newUpdateTableObjects ::
Prelude.Text ->
Prelude.Text ->
Prelude.NonEmpty WriteOperation ->
UpdateTableObjects
newUpdateTableObjects :: Text -> Text -> NonEmpty WriteOperation -> UpdateTableObjects
newUpdateTableObjects
Text
pDatabaseName_
Text
pTableName_
NonEmpty WriteOperation
pWriteOperations_ =
UpdateTableObjects'
{ $sel:catalogId:UpdateTableObjects' :: Maybe Text
catalogId = forall a. Maybe a
Prelude.Nothing,
$sel:transactionId:UpdateTableObjects' :: Maybe Text
transactionId = forall a. Maybe a
Prelude.Nothing,
$sel:databaseName:UpdateTableObjects' :: Text
databaseName = Text
pDatabaseName_,
$sel:tableName:UpdateTableObjects' :: Text
tableName = Text
pTableName_,
$sel:writeOperations:UpdateTableObjects' :: NonEmpty WriteOperation
writeOperations =
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty WriteOperation
pWriteOperations_
}
updateTableObjects_catalogId :: Lens.Lens' UpdateTableObjects (Prelude.Maybe Prelude.Text)
updateTableObjects_catalogId :: Lens' UpdateTableObjects (Maybe Text)
updateTableObjects_catalogId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTableObjects' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:UpdateTableObjects' :: UpdateTableObjects -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: UpdateTableObjects
s@UpdateTableObjects' {} Maybe Text
a -> UpdateTableObjects
s {$sel:catalogId:UpdateTableObjects' :: Maybe Text
catalogId = Maybe Text
a} :: UpdateTableObjects)
updateTableObjects_transactionId :: Lens.Lens' UpdateTableObjects (Prelude.Maybe Prelude.Text)
updateTableObjects_transactionId :: Lens' UpdateTableObjects (Maybe Text)
updateTableObjects_transactionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTableObjects' {Maybe Text
transactionId :: Maybe Text
$sel:transactionId:UpdateTableObjects' :: UpdateTableObjects -> Maybe Text
transactionId} -> Maybe Text
transactionId) (\s :: UpdateTableObjects
s@UpdateTableObjects' {} Maybe Text
a -> UpdateTableObjects
s {$sel:transactionId:UpdateTableObjects' :: Maybe Text
transactionId = Maybe Text
a} :: UpdateTableObjects)
updateTableObjects_databaseName :: Lens.Lens' UpdateTableObjects Prelude.Text
updateTableObjects_databaseName :: Lens' UpdateTableObjects Text
updateTableObjects_databaseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTableObjects' {Text
databaseName :: Text
$sel:databaseName:UpdateTableObjects' :: UpdateTableObjects -> Text
databaseName} -> Text
databaseName) (\s :: UpdateTableObjects
s@UpdateTableObjects' {} Text
a -> UpdateTableObjects
s {$sel:databaseName:UpdateTableObjects' :: Text
databaseName = Text
a} :: UpdateTableObjects)
updateTableObjects_tableName :: Lens.Lens' UpdateTableObjects Prelude.Text
updateTableObjects_tableName :: Lens' UpdateTableObjects Text
updateTableObjects_tableName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTableObjects' {Text
tableName :: Text
$sel:tableName:UpdateTableObjects' :: UpdateTableObjects -> Text
tableName} -> Text
tableName) (\s :: UpdateTableObjects
s@UpdateTableObjects' {} Text
a -> UpdateTableObjects
s {$sel:tableName:UpdateTableObjects' :: Text
tableName = Text
a} :: UpdateTableObjects)
updateTableObjects_writeOperations :: Lens.Lens' UpdateTableObjects (Prelude.NonEmpty WriteOperation)
updateTableObjects_writeOperations :: Lens' UpdateTableObjects (NonEmpty WriteOperation)
updateTableObjects_writeOperations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTableObjects' {NonEmpty WriteOperation
writeOperations :: NonEmpty WriteOperation
$sel:writeOperations:UpdateTableObjects' :: UpdateTableObjects -> NonEmpty WriteOperation
writeOperations} -> NonEmpty WriteOperation
writeOperations) (\s :: UpdateTableObjects
s@UpdateTableObjects' {} NonEmpty WriteOperation
a -> UpdateTableObjects
s {$sel:writeOperations:UpdateTableObjects' :: NonEmpty WriteOperation
writeOperations = NonEmpty WriteOperation
a} :: UpdateTableObjects) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest UpdateTableObjects where
type
AWSResponse UpdateTableObjects =
UpdateTableObjectsResponse
request :: (Service -> Service)
-> UpdateTableObjects -> Request UpdateTableObjects
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 UpdateTableObjects
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateTableObjects)))
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 -> UpdateTableObjectsResponse
UpdateTableObjectsResponse'
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 UpdateTableObjects where
hashWithSalt :: Int -> UpdateTableObjects -> Int
hashWithSalt Int
_salt UpdateTableObjects' {Maybe Text
NonEmpty WriteOperation
Text
writeOperations :: NonEmpty WriteOperation
tableName :: Text
databaseName :: Text
transactionId :: Maybe Text
catalogId :: Maybe Text
$sel:writeOperations:UpdateTableObjects' :: UpdateTableObjects -> NonEmpty WriteOperation
$sel:tableName:UpdateTableObjects' :: UpdateTableObjects -> Text
$sel:databaseName:UpdateTableObjects' :: UpdateTableObjects -> Text
$sel:transactionId:UpdateTableObjects' :: UpdateTableObjects -> Maybe Text
$sel:catalogId:UpdateTableObjects' :: UpdateTableObjects -> 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` Maybe Text
transactionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
databaseName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
tableName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty WriteOperation
writeOperations
instance Prelude.NFData UpdateTableObjects where
rnf :: UpdateTableObjects -> ()
rnf UpdateTableObjects' {Maybe Text
NonEmpty WriteOperation
Text
writeOperations :: NonEmpty WriteOperation
tableName :: Text
databaseName :: Text
transactionId :: Maybe Text
catalogId :: Maybe Text
$sel:writeOperations:UpdateTableObjects' :: UpdateTableObjects -> NonEmpty WriteOperation
$sel:tableName:UpdateTableObjects' :: UpdateTableObjects -> Text
$sel:databaseName:UpdateTableObjects' :: UpdateTableObjects -> Text
$sel:transactionId:UpdateTableObjects' :: UpdateTableObjects -> Maybe Text
$sel:catalogId:UpdateTableObjects' :: UpdateTableObjects -> 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 Maybe Text
transactionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
databaseName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
tableName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty WriteOperation
writeOperations
instance Data.ToHeaders UpdateTableObjects where
toHeaders :: UpdateTableObjects -> 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 UpdateTableObjects where
toJSON :: UpdateTableObjects -> Value
toJSON UpdateTableObjects' {Maybe Text
NonEmpty WriteOperation
Text
writeOperations :: NonEmpty WriteOperation
tableName :: Text
databaseName :: Text
transactionId :: Maybe Text
catalogId :: Maybe Text
$sel:writeOperations:UpdateTableObjects' :: UpdateTableObjects -> NonEmpty WriteOperation
$sel:tableName:UpdateTableObjects' :: UpdateTableObjects -> Text
$sel:databaseName:UpdateTableObjects' :: UpdateTableObjects -> Text
$sel:transactionId:UpdateTableObjects' :: UpdateTableObjects -> Maybe Text
$sel:catalogId:UpdateTableObjects' :: UpdateTableObjects -> 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,
(Key
"TransactionId" 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
transactionId,
forall a. a -> Maybe a
Prelude.Just (Key
"DatabaseName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
databaseName),
forall a. a -> Maybe a
Prelude.Just (Key
"TableName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
tableName),
forall a. a -> Maybe a
Prelude.Just
(Key
"WriteOperations" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty WriteOperation
writeOperations)
]
)
instance Data.ToPath UpdateTableObjects where
toPath :: UpdateTableObjects -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/UpdateTableObjects"
instance Data.ToQuery UpdateTableObjects where
toQuery :: UpdateTableObjects -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateTableObjectsResponse = UpdateTableObjectsResponse'
{
UpdateTableObjectsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateTableObjectsResponse -> UpdateTableObjectsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTableObjectsResponse -> UpdateTableObjectsResponse -> Bool
$c/= :: UpdateTableObjectsResponse -> UpdateTableObjectsResponse -> Bool
== :: UpdateTableObjectsResponse -> UpdateTableObjectsResponse -> Bool
$c== :: UpdateTableObjectsResponse -> UpdateTableObjectsResponse -> Bool
Prelude.Eq, ReadPrec [UpdateTableObjectsResponse]
ReadPrec UpdateTableObjectsResponse
Int -> ReadS UpdateTableObjectsResponse
ReadS [UpdateTableObjectsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTableObjectsResponse]
$creadListPrec :: ReadPrec [UpdateTableObjectsResponse]
readPrec :: ReadPrec UpdateTableObjectsResponse
$creadPrec :: ReadPrec UpdateTableObjectsResponse
readList :: ReadS [UpdateTableObjectsResponse]
$creadList :: ReadS [UpdateTableObjectsResponse]
readsPrec :: Int -> ReadS UpdateTableObjectsResponse
$creadsPrec :: Int -> ReadS UpdateTableObjectsResponse
Prelude.Read, Int -> UpdateTableObjectsResponse -> ShowS
[UpdateTableObjectsResponse] -> ShowS
UpdateTableObjectsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTableObjectsResponse] -> ShowS
$cshowList :: [UpdateTableObjectsResponse] -> ShowS
show :: UpdateTableObjectsResponse -> String
$cshow :: UpdateTableObjectsResponse -> String
showsPrec :: Int -> UpdateTableObjectsResponse -> ShowS
$cshowsPrec :: Int -> UpdateTableObjectsResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateTableObjectsResponse x -> UpdateTableObjectsResponse
forall x.
UpdateTableObjectsResponse -> Rep UpdateTableObjectsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateTableObjectsResponse x -> UpdateTableObjectsResponse
$cfrom :: forall x.
UpdateTableObjectsResponse -> Rep UpdateTableObjectsResponse x
Prelude.Generic)
newUpdateTableObjectsResponse ::
Prelude.Int ->
UpdateTableObjectsResponse
newUpdateTableObjectsResponse :: Int -> UpdateTableObjectsResponse
newUpdateTableObjectsResponse Int
pHttpStatus_ =
UpdateTableObjectsResponse'
{ $sel:httpStatus:UpdateTableObjectsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateTableObjectsResponse_httpStatus :: Lens.Lens' UpdateTableObjectsResponse Prelude.Int
updateTableObjectsResponse_httpStatus :: Lens' UpdateTableObjectsResponse Int
updateTableObjectsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTableObjectsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateTableObjectsResponse' :: UpdateTableObjectsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateTableObjectsResponse
s@UpdateTableObjectsResponse' {} Int
a -> UpdateTableObjectsResponse
s {$sel:httpStatus:UpdateTableObjectsResponse' :: Int
httpStatus = Int
a} :: UpdateTableObjectsResponse)
instance Prelude.NFData UpdateTableObjectsResponse where
rnf :: UpdateTableObjectsResponse -> ()
rnf UpdateTableObjectsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateTableObjectsResponse' :: UpdateTableObjectsResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus