{-# 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.DeletePartition
(
DeletePartition (..),
newDeletePartition,
deletePartition_catalogId,
deletePartition_databaseName,
deletePartition_tableName,
deletePartition_partitionValues,
DeletePartitionResponse (..),
newDeletePartitionResponse,
deletePartitionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeletePartition = DeletePartition'
{
DeletePartition -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
DeletePartition -> Text
databaseName :: Prelude.Text,
DeletePartition -> Text
tableName :: Prelude.Text,
DeletePartition -> [Text]
partitionValues :: [Prelude.Text]
}
deriving (DeletePartition -> DeletePartition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePartition -> DeletePartition -> Bool
$c/= :: DeletePartition -> DeletePartition -> Bool
== :: DeletePartition -> DeletePartition -> Bool
$c== :: DeletePartition -> DeletePartition -> Bool
Prelude.Eq, ReadPrec [DeletePartition]
ReadPrec DeletePartition
Int -> ReadS DeletePartition
ReadS [DeletePartition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePartition]
$creadListPrec :: ReadPrec [DeletePartition]
readPrec :: ReadPrec DeletePartition
$creadPrec :: ReadPrec DeletePartition
readList :: ReadS [DeletePartition]
$creadList :: ReadS [DeletePartition]
readsPrec :: Int -> ReadS DeletePartition
$creadsPrec :: Int -> ReadS DeletePartition
Prelude.Read, Int -> DeletePartition -> ShowS
[DeletePartition] -> ShowS
DeletePartition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePartition] -> ShowS
$cshowList :: [DeletePartition] -> ShowS
show :: DeletePartition -> String
$cshow :: DeletePartition -> String
showsPrec :: Int -> DeletePartition -> ShowS
$cshowsPrec :: Int -> DeletePartition -> ShowS
Prelude.Show, forall x. Rep DeletePartition x -> DeletePartition
forall x. DeletePartition -> Rep DeletePartition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeletePartition x -> DeletePartition
$cfrom :: forall x. DeletePartition -> Rep DeletePartition x
Prelude.Generic)
newDeletePartition ::
Prelude.Text ->
Prelude.Text ->
DeletePartition
newDeletePartition :: Text -> Text -> DeletePartition
newDeletePartition Text
pDatabaseName_ Text
pTableName_ =
DeletePartition'
{ $sel:catalogId:DeletePartition' :: Maybe Text
catalogId = forall a. Maybe a
Prelude.Nothing,
$sel:databaseName:DeletePartition' :: Text
databaseName = Text
pDatabaseName_,
$sel:tableName:DeletePartition' :: Text
tableName = Text
pTableName_,
$sel:partitionValues:DeletePartition' :: [Text]
partitionValues = forall a. Monoid a => a
Prelude.mempty
}
deletePartition_catalogId :: Lens.Lens' DeletePartition (Prelude.Maybe Prelude.Text)
deletePartition_catalogId :: Lens' DeletePartition (Maybe Text)
deletePartition_catalogId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePartition' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:DeletePartition' :: DeletePartition -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: DeletePartition
s@DeletePartition' {} Maybe Text
a -> DeletePartition
s {$sel:catalogId:DeletePartition' :: Maybe Text
catalogId = Maybe Text
a} :: DeletePartition)
deletePartition_databaseName :: Lens.Lens' DeletePartition Prelude.Text
deletePartition_databaseName :: Lens' DeletePartition Text
deletePartition_databaseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePartition' {Text
databaseName :: Text
$sel:databaseName:DeletePartition' :: DeletePartition -> Text
databaseName} -> Text
databaseName) (\s :: DeletePartition
s@DeletePartition' {} Text
a -> DeletePartition
s {$sel:databaseName:DeletePartition' :: Text
databaseName = Text
a} :: DeletePartition)
deletePartition_tableName :: Lens.Lens' DeletePartition Prelude.Text
deletePartition_tableName :: Lens' DeletePartition Text
deletePartition_tableName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePartition' {Text
tableName :: Text
$sel:tableName:DeletePartition' :: DeletePartition -> Text
tableName} -> Text
tableName) (\s :: DeletePartition
s@DeletePartition' {} Text
a -> DeletePartition
s {$sel:tableName:DeletePartition' :: Text
tableName = Text
a} :: DeletePartition)
deletePartition_partitionValues :: Lens.Lens' DeletePartition [Prelude.Text]
deletePartition_partitionValues :: Lens' DeletePartition [Text]
deletePartition_partitionValues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePartition' {[Text]
partitionValues :: [Text]
$sel:partitionValues:DeletePartition' :: DeletePartition -> [Text]
partitionValues} -> [Text]
partitionValues) (\s :: DeletePartition
s@DeletePartition' {} [Text]
a -> DeletePartition
s {$sel:partitionValues:DeletePartition' :: [Text]
partitionValues = [Text]
a} :: DeletePartition) 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 DeletePartition where
type
AWSResponse DeletePartition =
DeletePartitionResponse
request :: (Service -> Service) -> DeletePartition -> Request DeletePartition
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 DeletePartition
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeletePartition)))
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 -> DeletePartitionResponse
DeletePartitionResponse'
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 DeletePartition where
hashWithSalt :: Int -> DeletePartition -> Int
hashWithSalt Int
_salt DeletePartition' {[Text]
Maybe Text
Text
partitionValues :: [Text]
tableName :: Text
databaseName :: Text
catalogId :: Maybe Text
$sel:partitionValues:DeletePartition' :: DeletePartition -> [Text]
$sel:tableName:DeletePartition' :: DeletePartition -> Text
$sel:databaseName:DeletePartition' :: DeletePartition -> Text
$sel:catalogId:DeletePartition' :: DeletePartition -> 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` Text
databaseName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
tableName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
partitionValues
instance Prelude.NFData DeletePartition where
rnf :: DeletePartition -> ()
rnf DeletePartition' {[Text]
Maybe Text
Text
partitionValues :: [Text]
tableName :: Text
databaseName :: Text
catalogId :: Maybe Text
$sel:partitionValues:DeletePartition' :: DeletePartition -> [Text]
$sel:tableName:DeletePartition' :: DeletePartition -> Text
$sel:databaseName:DeletePartition' :: DeletePartition -> Text
$sel:catalogId:DeletePartition' :: DeletePartition -> 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 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 [Text]
partitionValues
instance Data.ToHeaders DeletePartition where
toHeaders :: DeletePartition -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"AWSGlue.DeletePartition" :: Prelude.ByteString),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DeletePartition where
toJSON :: DeletePartition -> Value
toJSON DeletePartition' {[Text]
Maybe Text
Text
partitionValues :: [Text]
tableName :: Text
databaseName :: Text
catalogId :: Maybe Text
$sel:partitionValues:DeletePartition' :: DeletePartition -> [Text]
$sel:tableName:DeletePartition' :: DeletePartition -> Text
$sel:databaseName:DeletePartition' :: DeletePartition -> Text
$sel:catalogId:DeletePartition' :: DeletePartition -> 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
"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
"PartitionValues" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
partitionValues)
]
)
instance Data.ToPath DeletePartition where
toPath :: DeletePartition -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeletePartition where
toQuery :: DeletePartition -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeletePartitionResponse = DeletePartitionResponse'
{
DeletePartitionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeletePartitionResponse -> DeletePartitionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePartitionResponse -> DeletePartitionResponse -> Bool
$c/= :: DeletePartitionResponse -> DeletePartitionResponse -> Bool
== :: DeletePartitionResponse -> DeletePartitionResponse -> Bool
$c== :: DeletePartitionResponse -> DeletePartitionResponse -> Bool
Prelude.Eq, ReadPrec [DeletePartitionResponse]
ReadPrec DeletePartitionResponse
Int -> ReadS DeletePartitionResponse
ReadS [DeletePartitionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePartitionResponse]
$creadListPrec :: ReadPrec [DeletePartitionResponse]
readPrec :: ReadPrec DeletePartitionResponse
$creadPrec :: ReadPrec DeletePartitionResponse
readList :: ReadS [DeletePartitionResponse]
$creadList :: ReadS [DeletePartitionResponse]
readsPrec :: Int -> ReadS DeletePartitionResponse
$creadsPrec :: Int -> ReadS DeletePartitionResponse
Prelude.Read, Int -> DeletePartitionResponse -> ShowS
[DeletePartitionResponse] -> ShowS
DeletePartitionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePartitionResponse] -> ShowS
$cshowList :: [DeletePartitionResponse] -> ShowS
show :: DeletePartitionResponse -> String
$cshow :: DeletePartitionResponse -> String
showsPrec :: Int -> DeletePartitionResponse -> ShowS
$cshowsPrec :: Int -> DeletePartitionResponse -> ShowS
Prelude.Show, forall x. Rep DeletePartitionResponse x -> DeletePartitionResponse
forall x. DeletePartitionResponse -> Rep DeletePartitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeletePartitionResponse x -> DeletePartitionResponse
$cfrom :: forall x. DeletePartitionResponse -> Rep DeletePartitionResponse x
Prelude.Generic)
newDeletePartitionResponse ::
Prelude.Int ->
DeletePartitionResponse
newDeletePartitionResponse :: Int -> DeletePartitionResponse
newDeletePartitionResponse Int
pHttpStatus_ =
DeletePartitionResponse' {$sel:httpStatus:DeletePartitionResponse' :: Int
httpStatus = Int
pHttpStatus_}
deletePartitionResponse_httpStatus :: Lens.Lens' DeletePartitionResponse Prelude.Int
deletePartitionResponse_httpStatus :: Lens' DeletePartitionResponse Int
deletePartitionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePartitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeletePartitionResponse' :: DeletePartitionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeletePartitionResponse
s@DeletePartitionResponse' {} Int
a -> DeletePartitionResponse
s {$sel:httpStatus:DeletePartitionResponse' :: Int
httpStatus = Int
a} :: DeletePartitionResponse)
instance Prelude.NFData DeletePartitionResponse where
rnf :: DeletePartitionResponse -> ()
rnf DeletePartitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeletePartitionResponse' :: DeletePartitionResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus