{-# 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.DeleteTableVersion
(
DeleteTableVersion (..),
newDeleteTableVersion,
deleteTableVersion_catalogId,
deleteTableVersion_databaseName,
deleteTableVersion_tableName,
deleteTableVersion_versionId,
DeleteTableVersionResponse (..),
newDeleteTableVersionResponse,
deleteTableVersionResponse_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 DeleteTableVersion = DeleteTableVersion'
{
DeleteTableVersion -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
DeleteTableVersion -> Text
databaseName :: Prelude.Text,
DeleteTableVersion -> Text
tableName :: Prelude.Text,
DeleteTableVersion -> Text
versionId :: Prelude.Text
}
deriving (DeleteTableVersion -> DeleteTableVersion -> Bool
(DeleteTableVersion -> DeleteTableVersion -> Bool)
-> (DeleteTableVersion -> DeleteTableVersion -> Bool)
-> Eq DeleteTableVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTableVersion -> DeleteTableVersion -> Bool
$c/= :: DeleteTableVersion -> DeleteTableVersion -> Bool
== :: DeleteTableVersion -> DeleteTableVersion -> Bool
$c== :: DeleteTableVersion -> DeleteTableVersion -> Bool
Prelude.Eq, ReadPrec [DeleteTableVersion]
ReadPrec DeleteTableVersion
Int -> ReadS DeleteTableVersion
ReadS [DeleteTableVersion]
(Int -> ReadS DeleteTableVersion)
-> ReadS [DeleteTableVersion]
-> ReadPrec DeleteTableVersion
-> ReadPrec [DeleteTableVersion]
-> Read DeleteTableVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTableVersion]
$creadListPrec :: ReadPrec [DeleteTableVersion]
readPrec :: ReadPrec DeleteTableVersion
$creadPrec :: ReadPrec DeleteTableVersion
readList :: ReadS [DeleteTableVersion]
$creadList :: ReadS [DeleteTableVersion]
readsPrec :: Int -> ReadS DeleteTableVersion
$creadsPrec :: Int -> ReadS DeleteTableVersion
Prelude.Read, Int -> DeleteTableVersion -> ShowS
[DeleteTableVersion] -> ShowS
DeleteTableVersion -> String
(Int -> DeleteTableVersion -> ShowS)
-> (DeleteTableVersion -> String)
-> ([DeleteTableVersion] -> ShowS)
-> Show DeleteTableVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTableVersion] -> ShowS
$cshowList :: [DeleteTableVersion] -> ShowS
show :: DeleteTableVersion -> String
$cshow :: DeleteTableVersion -> String
showsPrec :: Int -> DeleteTableVersion -> ShowS
$cshowsPrec :: Int -> DeleteTableVersion -> ShowS
Prelude.Show, (forall x. DeleteTableVersion -> Rep DeleteTableVersion x)
-> (forall x. Rep DeleteTableVersion x -> DeleteTableVersion)
-> Generic DeleteTableVersion
forall x. Rep DeleteTableVersion x -> DeleteTableVersion
forall x. DeleteTableVersion -> Rep DeleteTableVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTableVersion x -> DeleteTableVersion
$cfrom :: forall x. DeleteTableVersion -> Rep DeleteTableVersion x
Prelude.Generic)
newDeleteTableVersion ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DeleteTableVersion
newDeleteTableVersion :: Text -> Text -> Text -> DeleteTableVersion
newDeleteTableVersion
Text
pDatabaseName_
Text
pTableName_
Text
pVersionId_ =
DeleteTableVersion' :: Maybe Text -> Text -> Text -> Text -> DeleteTableVersion
DeleteTableVersion'
{ $sel:catalogId:DeleteTableVersion' :: Maybe Text
catalogId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:databaseName:DeleteTableVersion' :: Text
databaseName = Text
pDatabaseName_,
$sel:tableName:DeleteTableVersion' :: Text
tableName = Text
pTableName_,
$sel:versionId:DeleteTableVersion' :: Text
versionId = Text
pVersionId_
}
deleteTableVersion_catalogId :: Lens.Lens' DeleteTableVersion (Prelude.Maybe Prelude.Text)
deleteTableVersion_catalogId :: (Maybe Text -> f (Maybe Text))
-> DeleteTableVersion -> f DeleteTableVersion
deleteTableVersion_catalogId = (DeleteTableVersion -> Maybe Text)
-> (DeleteTableVersion -> Maybe Text -> DeleteTableVersion)
-> Lens
DeleteTableVersion DeleteTableVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTableVersion' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:DeleteTableVersion' :: DeleteTableVersion -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: DeleteTableVersion
s@DeleteTableVersion' {} Maybe Text
a -> DeleteTableVersion
s {$sel:catalogId:DeleteTableVersion' :: Maybe Text
catalogId = Maybe Text
a} :: DeleteTableVersion)
deleteTableVersion_databaseName :: Lens.Lens' DeleteTableVersion Prelude.Text
deleteTableVersion_databaseName :: (Text -> f Text) -> DeleteTableVersion -> f DeleteTableVersion
deleteTableVersion_databaseName = (DeleteTableVersion -> Text)
-> (DeleteTableVersion -> Text -> DeleteTableVersion)
-> Lens DeleteTableVersion DeleteTableVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTableVersion' {Text
databaseName :: Text
$sel:databaseName:DeleteTableVersion' :: DeleteTableVersion -> Text
databaseName} -> Text
databaseName) (\s :: DeleteTableVersion
s@DeleteTableVersion' {} Text
a -> DeleteTableVersion
s {$sel:databaseName:DeleteTableVersion' :: Text
databaseName = Text
a} :: DeleteTableVersion)
deleteTableVersion_tableName :: Lens.Lens' DeleteTableVersion Prelude.Text
deleteTableVersion_tableName :: (Text -> f Text) -> DeleteTableVersion -> f DeleteTableVersion
deleteTableVersion_tableName = (DeleteTableVersion -> Text)
-> (DeleteTableVersion -> Text -> DeleteTableVersion)
-> Lens DeleteTableVersion DeleteTableVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTableVersion' {Text
tableName :: Text
$sel:tableName:DeleteTableVersion' :: DeleteTableVersion -> Text
tableName} -> Text
tableName) (\s :: DeleteTableVersion
s@DeleteTableVersion' {} Text
a -> DeleteTableVersion
s {$sel:tableName:DeleteTableVersion' :: Text
tableName = Text
a} :: DeleteTableVersion)
deleteTableVersion_versionId :: Lens.Lens' DeleteTableVersion Prelude.Text
deleteTableVersion_versionId :: (Text -> f Text) -> DeleteTableVersion -> f DeleteTableVersion
deleteTableVersion_versionId = (DeleteTableVersion -> Text)
-> (DeleteTableVersion -> Text -> DeleteTableVersion)
-> Lens DeleteTableVersion DeleteTableVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTableVersion' {Text
versionId :: Text
$sel:versionId:DeleteTableVersion' :: DeleteTableVersion -> Text
versionId} -> Text
versionId) (\s :: DeleteTableVersion
s@DeleteTableVersion' {} Text
a -> DeleteTableVersion
s {$sel:versionId:DeleteTableVersion' :: Text
versionId = Text
a} :: DeleteTableVersion)
instance Core.AWSRequest DeleteTableVersion where
type
AWSResponse DeleteTableVersion =
DeleteTableVersionResponse
request :: DeleteTableVersion -> Request DeleteTableVersion
request = Service -> DeleteTableVersion -> Request DeleteTableVersion
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteTableVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteTableVersion)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteTableVersion))
-> Logger
-> Service
-> Proxy DeleteTableVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteTableVersion)))
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 -> DeleteTableVersionResponse
DeleteTableVersionResponse'
(Int -> DeleteTableVersionResponse)
-> Either String Int -> Either String DeleteTableVersionResponse
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 DeleteTableVersion
instance Prelude.NFData DeleteTableVersion
instance Core.ToHeaders DeleteTableVersion where
toHeaders :: DeleteTableVersion -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteTableVersion -> 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.DeleteTableVersion" :: 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 DeleteTableVersion where
toJSON :: DeleteTableVersion -> Value
toJSON DeleteTableVersion' {Maybe Text
Text
versionId :: Text
tableName :: Text
databaseName :: Text
catalogId :: Maybe Text
$sel:versionId:DeleteTableVersion' :: DeleteTableVersion -> Text
$sel:tableName:DeleteTableVersion' :: DeleteTableVersion -> Text
$sel:databaseName:DeleteTableVersion' :: DeleteTableVersion -> Text
$sel:catalogId:DeleteTableVersion' :: DeleteTableVersion -> 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
"DatabaseName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
databaseName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TableName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
tableName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"VersionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
versionId)
]
)
instance Core.ToPath DeleteTableVersion where
toPath :: DeleteTableVersion -> ByteString
toPath = ByteString -> DeleteTableVersion -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteTableVersion where
toQuery :: DeleteTableVersion -> QueryString
toQuery = QueryString -> DeleteTableVersion -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteTableVersionResponse = DeleteTableVersionResponse'
{
DeleteTableVersionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteTableVersionResponse -> DeleteTableVersionResponse -> Bool
(DeleteTableVersionResponse -> DeleteTableVersionResponse -> Bool)
-> (DeleteTableVersionResponse
-> DeleteTableVersionResponse -> Bool)
-> Eq DeleteTableVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTableVersionResponse -> DeleteTableVersionResponse -> Bool
$c/= :: DeleteTableVersionResponse -> DeleteTableVersionResponse -> Bool
== :: DeleteTableVersionResponse -> DeleteTableVersionResponse -> Bool
$c== :: DeleteTableVersionResponse -> DeleteTableVersionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteTableVersionResponse]
ReadPrec DeleteTableVersionResponse
Int -> ReadS DeleteTableVersionResponse
ReadS [DeleteTableVersionResponse]
(Int -> ReadS DeleteTableVersionResponse)
-> ReadS [DeleteTableVersionResponse]
-> ReadPrec DeleteTableVersionResponse
-> ReadPrec [DeleteTableVersionResponse]
-> Read DeleteTableVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTableVersionResponse]
$creadListPrec :: ReadPrec [DeleteTableVersionResponse]
readPrec :: ReadPrec DeleteTableVersionResponse
$creadPrec :: ReadPrec DeleteTableVersionResponse
readList :: ReadS [DeleteTableVersionResponse]
$creadList :: ReadS [DeleteTableVersionResponse]
readsPrec :: Int -> ReadS DeleteTableVersionResponse
$creadsPrec :: Int -> ReadS DeleteTableVersionResponse
Prelude.Read, Int -> DeleteTableVersionResponse -> ShowS
[DeleteTableVersionResponse] -> ShowS
DeleteTableVersionResponse -> String
(Int -> DeleteTableVersionResponse -> ShowS)
-> (DeleteTableVersionResponse -> String)
-> ([DeleteTableVersionResponse] -> ShowS)
-> Show DeleteTableVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTableVersionResponse] -> ShowS
$cshowList :: [DeleteTableVersionResponse] -> ShowS
show :: DeleteTableVersionResponse -> String
$cshow :: DeleteTableVersionResponse -> String
showsPrec :: Int -> DeleteTableVersionResponse -> ShowS
$cshowsPrec :: Int -> DeleteTableVersionResponse -> ShowS
Prelude.Show, (forall x.
DeleteTableVersionResponse -> Rep DeleteTableVersionResponse x)
-> (forall x.
Rep DeleteTableVersionResponse x -> DeleteTableVersionResponse)
-> Generic DeleteTableVersionResponse
forall x.
Rep DeleteTableVersionResponse x -> DeleteTableVersionResponse
forall x.
DeleteTableVersionResponse -> Rep DeleteTableVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteTableVersionResponse x -> DeleteTableVersionResponse
$cfrom :: forall x.
DeleteTableVersionResponse -> Rep DeleteTableVersionResponse x
Prelude.Generic)
newDeleteTableVersionResponse ::
Prelude.Int ->
DeleteTableVersionResponse
newDeleteTableVersionResponse :: Int -> DeleteTableVersionResponse
newDeleteTableVersionResponse Int
pHttpStatus_ =
DeleteTableVersionResponse' :: Int -> DeleteTableVersionResponse
DeleteTableVersionResponse'
{ $sel:httpStatus:DeleteTableVersionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteTableVersionResponse_httpStatus :: Lens.Lens' DeleteTableVersionResponse Prelude.Int
deleteTableVersionResponse_httpStatus :: (Int -> f Int)
-> DeleteTableVersionResponse -> f DeleteTableVersionResponse
deleteTableVersionResponse_httpStatus = (DeleteTableVersionResponse -> Int)
-> (DeleteTableVersionResponse
-> Int -> DeleteTableVersionResponse)
-> Lens
DeleteTableVersionResponse DeleteTableVersionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTableVersionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteTableVersionResponse' :: DeleteTableVersionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteTableVersionResponse
s@DeleteTableVersionResponse' {} Int
a -> DeleteTableVersionResponse
s {$sel:httpStatus:DeleteTableVersionResponse' :: Int
httpStatus = Int
a} :: DeleteTableVersionResponse)
instance Prelude.NFData DeleteTableVersionResponse