{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Glue.BatchDeleteTableVersion
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a specified batch of versions of a table.
module Amazonka.Glue.BatchDeleteTableVersion
  ( -- * Creating a Request
    BatchDeleteTableVersion (..),
    newBatchDeleteTableVersion,

    -- * Request Lenses
    batchDeleteTableVersion_catalogId,
    batchDeleteTableVersion_databaseName,
    batchDeleteTableVersion_tableName,
    batchDeleteTableVersion_versionIds,

    -- * Destructuring the Response
    BatchDeleteTableVersionResponse (..),
    newBatchDeleteTableVersionResponse,

    -- * Response Lenses
    batchDeleteTableVersionResponse_errors,
    batchDeleteTableVersionResponse_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

-- | /See:/ 'newBatchDeleteTableVersion' smart constructor.
data BatchDeleteTableVersion = BatchDeleteTableVersion'
  { -- | The ID of the Data Catalog where the tables reside. If none is provided,
    -- the Amazon Web Services account ID is used by default.
    BatchDeleteTableVersion -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
    -- | The database in the catalog in which the table resides. For Hive
    -- compatibility, this name is entirely lowercase.
    BatchDeleteTableVersion -> Text
databaseName :: Prelude.Text,
    -- | The name of the table. For Hive compatibility, this name is entirely
    -- lowercase.
    BatchDeleteTableVersion -> Text
tableName :: Prelude.Text,
    -- | A list of the IDs of versions to be deleted. A @VersionId@ is a string
    -- representation of an integer. Each version is incremented by 1.
    BatchDeleteTableVersion -> [Text]
versionIds :: [Prelude.Text]
  }
  deriving (BatchDeleteTableVersion -> BatchDeleteTableVersion -> Bool
(BatchDeleteTableVersion -> BatchDeleteTableVersion -> Bool)
-> (BatchDeleteTableVersion -> BatchDeleteTableVersion -> Bool)
-> Eq BatchDeleteTableVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDeleteTableVersion -> BatchDeleteTableVersion -> Bool
$c/= :: BatchDeleteTableVersion -> BatchDeleteTableVersion -> Bool
== :: BatchDeleteTableVersion -> BatchDeleteTableVersion -> Bool
$c== :: BatchDeleteTableVersion -> BatchDeleteTableVersion -> Bool
Prelude.Eq, ReadPrec [BatchDeleteTableVersion]
ReadPrec BatchDeleteTableVersion
Int -> ReadS BatchDeleteTableVersion
ReadS [BatchDeleteTableVersion]
(Int -> ReadS BatchDeleteTableVersion)
-> ReadS [BatchDeleteTableVersion]
-> ReadPrec BatchDeleteTableVersion
-> ReadPrec [BatchDeleteTableVersion]
-> Read BatchDeleteTableVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDeleteTableVersion]
$creadListPrec :: ReadPrec [BatchDeleteTableVersion]
readPrec :: ReadPrec BatchDeleteTableVersion
$creadPrec :: ReadPrec BatchDeleteTableVersion
readList :: ReadS [BatchDeleteTableVersion]
$creadList :: ReadS [BatchDeleteTableVersion]
readsPrec :: Int -> ReadS BatchDeleteTableVersion
$creadsPrec :: Int -> ReadS BatchDeleteTableVersion
Prelude.Read, Int -> BatchDeleteTableVersion -> ShowS
[BatchDeleteTableVersion] -> ShowS
BatchDeleteTableVersion -> String
(Int -> BatchDeleteTableVersion -> ShowS)
-> (BatchDeleteTableVersion -> String)
-> ([BatchDeleteTableVersion] -> ShowS)
-> Show BatchDeleteTableVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDeleteTableVersion] -> ShowS
$cshowList :: [BatchDeleteTableVersion] -> ShowS
show :: BatchDeleteTableVersion -> String
$cshow :: BatchDeleteTableVersion -> String
showsPrec :: Int -> BatchDeleteTableVersion -> ShowS
$cshowsPrec :: Int -> BatchDeleteTableVersion -> ShowS
Prelude.Show, (forall x.
 BatchDeleteTableVersion -> Rep BatchDeleteTableVersion x)
-> (forall x.
    Rep BatchDeleteTableVersion x -> BatchDeleteTableVersion)
-> Generic BatchDeleteTableVersion
forall x. Rep BatchDeleteTableVersion x -> BatchDeleteTableVersion
forall x. BatchDeleteTableVersion -> Rep BatchDeleteTableVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchDeleteTableVersion x -> BatchDeleteTableVersion
$cfrom :: forall x. BatchDeleteTableVersion -> Rep BatchDeleteTableVersion x
Prelude.Generic)

-- |
-- Create a value of 'BatchDeleteTableVersion' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'catalogId', 'batchDeleteTableVersion_catalogId' - The ID of the Data Catalog where the tables reside. If none is provided,
-- the Amazon Web Services account ID is used by default.
--
-- 'databaseName', 'batchDeleteTableVersion_databaseName' - The database in the catalog in which the table resides. For Hive
-- compatibility, this name is entirely lowercase.
--
-- 'tableName', 'batchDeleteTableVersion_tableName' - The name of the table. For Hive compatibility, this name is entirely
-- lowercase.
--
-- 'versionIds', 'batchDeleteTableVersion_versionIds' - A list of the IDs of versions to be deleted. A @VersionId@ is a string
-- representation of an integer. Each version is incremented by 1.
newBatchDeleteTableVersion ::
  -- | 'databaseName'
  Prelude.Text ->
  -- | 'tableName'
  Prelude.Text ->
  BatchDeleteTableVersion
newBatchDeleteTableVersion :: Text -> Text -> BatchDeleteTableVersion
newBatchDeleteTableVersion Text
pDatabaseName_ Text
pTableName_ =
  BatchDeleteTableVersion' :: Maybe Text -> Text -> Text -> [Text] -> BatchDeleteTableVersion
BatchDeleteTableVersion'
    { $sel:catalogId:BatchDeleteTableVersion' :: Maybe Text
catalogId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:databaseName:BatchDeleteTableVersion' :: Text
databaseName = Text
pDatabaseName_,
      $sel:tableName:BatchDeleteTableVersion' :: Text
tableName = Text
pTableName_,
      $sel:versionIds:BatchDeleteTableVersion' :: [Text]
versionIds = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The ID of the Data Catalog where the tables reside. If none is provided,
-- the Amazon Web Services account ID is used by default.
batchDeleteTableVersion_catalogId :: Lens.Lens' BatchDeleteTableVersion (Prelude.Maybe Prelude.Text)
batchDeleteTableVersion_catalogId :: (Maybe Text -> f (Maybe Text))
-> BatchDeleteTableVersion -> f BatchDeleteTableVersion
batchDeleteTableVersion_catalogId = (BatchDeleteTableVersion -> Maybe Text)
-> (BatchDeleteTableVersion
    -> Maybe Text -> BatchDeleteTableVersion)
-> Lens
     BatchDeleteTableVersion
     BatchDeleteTableVersion
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteTableVersion' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:BatchDeleteTableVersion' :: BatchDeleteTableVersion -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: BatchDeleteTableVersion
s@BatchDeleteTableVersion' {} Maybe Text
a -> BatchDeleteTableVersion
s {$sel:catalogId:BatchDeleteTableVersion' :: Maybe Text
catalogId = Maybe Text
a} :: BatchDeleteTableVersion)

-- | The database in the catalog in which the table resides. For Hive
-- compatibility, this name is entirely lowercase.
batchDeleteTableVersion_databaseName :: Lens.Lens' BatchDeleteTableVersion Prelude.Text
batchDeleteTableVersion_databaseName :: (Text -> f Text)
-> BatchDeleteTableVersion -> f BatchDeleteTableVersion
batchDeleteTableVersion_databaseName = (BatchDeleteTableVersion -> Text)
-> (BatchDeleteTableVersion -> Text -> BatchDeleteTableVersion)
-> Lens BatchDeleteTableVersion BatchDeleteTableVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteTableVersion' {Text
databaseName :: Text
$sel:databaseName:BatchDeleteTableVersion' :: BatchDeleteTableVersion -> Text
databaseName} -> Text
databaseName) (\s :: BatchDeleteTableVersion
s@BatchDeleteTableVersion' {} Text
a -> BatchDeleteTableVersion
s {$sel:databaseName:BatchDeleteTableVersion' :: Text
databaseName = Text
a} :: BatchDeleteTableVersion)

-- | The name of the table. For Hive compatibility, this name is entirely
-- lowercase.
batchDeleteTableVersion_tableName :: Lens.Lens' BatchDeleteTableVersion Prelude.Text
batchDeleteTableVersion_tableName :: (Text -> f Text)
-> BatchDeleteTableVersion -> f BatchDeleteTableVersion
batchDeleteTableVersion_tableName = (BatchDeleteTableVersion -> Text)
-> (BatchDeleteTableVersion -> Text -> BatchDeleteTableVersion)
-> Lens BatchDeleteTableVersion BatchDeleteTableVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteTableVersion' {Text
tableName :: Text
$sel:tableName:BatchDeleteTableVersion' :: BatchDeleteTableVersion -> Text
tableName} -> Text
tableName) (\s :: BatchDeleteTableVersion
s@BatchDeleteTableVersion' {} Text
a -> BatchDeleteTableVersion
s {$sel:tableName:BatchDeleteTableVersion' :: Text
tableName = Text
a} :: BatchDeleteTableVersion)

-- | A list of the IDs of versions to be deleted. A @VersionId@ is a string
-- representation of an integer. Each version is incremented by 1.
batchDeleteTableVersion_versionIds :: Lens.Lens' BatchDeleteTableVersion [Prelude.Text]
batchDeleteTableVersion_versionIds :: ([Text] -> f [Text])
-> BatchDeleteTableVersion -> f BatchDeleteTableVersion
batchDeleteTableVersion_versionIds = (BatchDeleteTableVersion -> [Text])
-> (BatchDeleteTableVersion -> [Text] -> BatchDeleteTableVersion)
-> Lens
     BatchDeleteTableVersion BatchDeleteTableVersion [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteTableVersion' {[Text]
versionIds :: [Text]
$sel:versionIds:BatchDeleteTableVersion' :: BatchDeleteTableVersion -> [Text]
versionIds} -> [Text]
versionIds) (\s :: BatchDeleteTableVersion
s@BatchDeleteTableVersion' {} [Text]
a -> BatchDeleteTableVersion
s {$sel:versionIds:BatchDeleteTableVersion' :: [Text]
versionIds = [Text]
a} :: BatchDeleteTableVersion) (([Text] -> f [Text])
 -> BatchDeleteTableVersion -> f BatchDeleteTableVersion)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> BatchDeleteTableVersion
-> f BatchDeleteTableVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest BatchDeleteTableVersion where
  type
    AWSResponse BatchDeleteTableVersion =
      BatchDeleteTableVersionResponse
  request :: BatchDeleteTableVersion -> Request BatchDeleteTableVersion
request = Service
-> BatchDeleteTableVersion -> Request BatchDeleteTableVersion
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy BatchDeleteTableVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchDeleteTableVersion)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse BatchDeleteTableVersion))
-> Logger
-> Service
-> Proxy BatchDeleteTableVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchDeleteTableVersion)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [TableVersionError] -> Int -> BatchDeleteTableVersionResponse
BatchDeleteTableVersionResponse'
            (Maybe [TableVersionError]
 -> Int -> BatchDeleteTableVersionResponse)
-> Either String (Maybe [TableVersionError])
-> Either String (Int -> BatchDeleteTableVersionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [TableVersionError]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Errors" Either String (Maybe (Maybe [TableVersionError]))
-> Maybe [TableVersionError]
-> Either String (Maybe [TableVersionError])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [TableVersionError]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> BatchDeleteTableVersionResponse)
-> Either String Int
-> Either String BatchDeleteTableVersionResponse
forall (f :: * -> *) a b. Applicative f => 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 BatchDeleteTableVersion

instance Prelude.NFData BatchDeleteTableVersion

instance Core.ToHeaders BatchDeleteTableVersion where
  toHeaders :: BatchDeleteTableVersion -> ResponseHeaders
toHeaders =
    ResponseHeaders -> BatchDeleteTableVersion -> 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.BatchDeleteTableVersion" ::
                          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 BatchDeleteTableVersion where
  toJSON :: BatchDeleteTableVersion -> Value
toJSON BatchDeleteTableVersion' {[Text]
Maybe Text
Text
versionIds :: [Text]
tableName :: Text
databaseName :: Text
catalogId :: Maybe Text
$sel:versionIds:BatchDeleteTableVersion' :: BatchDeleteTableVersion -> [Text]
$sel:tableName:BatchDeleteTableVersion' :: BatchDeleteTableVersion -> Text
$sel:databaseName:BatchDeleteTableVersion' :: BatchDeleteTableVersion -> Text
$sel:catalogId:BatchDeleteTableVersion' :: BatchDeleteTableVersion -> 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
"VersionIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
versionIds)
          ]
      )

instance Core.ToPath BatchDeleteTableVersion where
  toPath :: BatchDeleteTableVersion -> ByteString
toPath = ByteString -> BatchDeleteTableVersion -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery BatchDeleteTableVersion where
  toQuery :: BatchDeleteTableVersion -> QueryString
toQuery = QueryString -> BatchDeleteTableVersion -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newBatchDeleteTableVersionResponse' smart constructor.
data BatchDeleteTableVersionResponse = BatchDeleteTableVersionResponse'
  { -- | A list of errors encountered while trying to delete the specified table
    -- versions.
    BatchDeleteTableVersionResponse -> Maybe [TableVersionError]
errors :: Prelude.Maybe [TableVersionError],
    -- | The response's http status code.
    BatchDeleteTableVersionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (BatchDeleteTableVersionResponse
-> BatchDeleteTableVersionResponse -> Bool
(BatchDeleteTableVersionResponse
 -> BatchDeleteTableVersionResponse -> Bool)
-> (BatchDeleteTableVersionResponse
    -> BatchDeleteTableVersionResponse -> Bool)
-> Eq BatchDeleteTableVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDeleteTableVersionResponse
-> BatchDeleteTableVersionResponse -> Bool
$c/= :: BatchDeleteTableVersionResponse
-> BatchDeleteTableVersionResponse -> Bool
== :: BatchDeleteTableVersionResponse
-> BatchDeleteTableVersionResponse -> Bool
$c== :: BatchDeleteTableVersionResponse
-> BatchDeleteTableVersionResponse -> Bool
Prelude.Eq, ReadPrec [BatchDeleteTableVersionResponse]
ReadPrec BatchDeleteTableVersionResponse
Int -> ReadS BatchDeleteTableVersionResponse
ReadS [BatchDeleteTableVersionResponse]
(Int -> ReadS BatchDeleteTableVersionResponse)
-> ReadS [BatchDeleteTableVersionResponse]
-> ReadPrec BatchDeleteTableVersionResponse
-> ReadPrec [BatchDeleteTableVersionResponse]
-> Read BatchDeleteTableVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDeleteTableVersionResponse]
$creadListPrec :: ReadPrec [BatchDeleteTableVersionResponse]
readPrec :: ReadPrec BatchDeleteTableVersionResponse
$creadPrec :: ReadPrec BatchDeleteTableVersionResponse
readList :: ReadS [BatchDeleteTableVersionResponse]
$creadList :: ReadS [BatchDeleteTableVersionResponse]
readsPrec :: Int -> ReadS BatchDeleteTableVersionResponse
$creadsPrec :: Int -> ReadS BatchDeleteTableVersionResponse
Prelude.Read, Int -> BatchDeleteTableVersionResponse -> ShowS
[BatchDeleteTableVersionResponse] -> ShowS
BatchDeleteTableVersionResponse -> String
(Int -> BatchDeleteTableVersionResponse -> ShowS)
-> (BatchDeleteTableVersionResponse -> String)
-> ([BatchDeleteTableVersionResponse] -> ShowS)
-> Show BatchDeleteTableVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDeleteTableVersionResponse] -> ShowS
$cshowList :: [BatchDeleteTableVersionResponse] -> ShowS
show :: BatchDeleteTableVersionResponse -> String
$cshow :: BatchDeleteTableVersionResponse -> String
showsPrec :: Int -> BatchDeleteTableVersionResponse -> ShowS
$cshowsPrec :: Int -> BatchDeleteTableVersionResponse -> ShowS
Prelude.Show, (forall x.
 BatchDeleteTableVersionResponse
 -> Rep BatchDeleteTableVersionResponse x)
-> (forall x.
    Rep BatchDeleteTableVersionResponse x
    -> BatchDeleteTableVersionResponse)
-> Generic BatchDeleteTableVersionResponse
forall x.
Rep BatchDeleteTableVersionResponse x
-> BatchDeleteTableVersionResponse
forall x.
BatchDeleteTableVersionResponse
-> Rep BatchDeleteTableVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchDeleteTableVersionResponse x
-> BatchDeleteTableVersionResponse
$cfrom :: forall x.
BatchDeleteTableVersionResponse
-> Rep BatchDeleteTableVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchDeleteTableVersionResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'errors', 'batchDeleteTableVersionResponse_errors' - A list of errors encountered while trying to delete the specified table
-- versions.
--
-- 'httpStatus', 'batchDeleteTableVersionResponse_httpStatus' - The response's http status code.
newBatchDeleteTableVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchDeleteTableVersionResponse
newBatchDeleteTableVersionResponse :: Int -> BatchDeleteTableVersionResponse
newBatchDeleteTableVersionResponse Int
pHttpStatus_ =
  BatchDeleteTableVersionResponse' :: Maybe [TableVersionError] -> Int -> BatchDeleteTableVersionResponse
BatchDeleteTableVersionResponse'
    { $sel:errors:BatchDeleteTableVersionResponse' :: Maybe [TableVersionError]
errors =
        Maybe [TableVersionError]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:BatchDeleteTableVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of errors encountered while trying to delete the specified table
-- versions.
batchDeleteTableVersionResponse_errors :: Lens.Lens' BatchDeleteTableVersionResponse (Prelude.Maybe [TableVersionError])
batchDeleteTableVersionResponse_errors :: (Maybe [TableVersionError] -> f (Maybe [TableVersionError]))
-> BatchDeleteTableVersionResponse
-> f BatchDeleteTableVersionResponse
batchDeleteTableVersionResponse_errors = (BatchDeleteTableVersionResponse -> Maybe [TableVersionError])
-> (BatchDeleteTableVersionResponse
    -> Maybe [TableVersionError] -> BatchDeleteTableVersionResponse)
-> Lens
     BatchDeleteTableVersionResponse
     BatchDeleteTableVersionResponse
     (Maybe [TableVersionError])
     (Maybe [TableVersionError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteTableVersionResponse' {Maybe [TableVersionError]
errors :: Maybe [TableVersionError]
$sel:errors:BatchDeleteTableVersionResponse' :: BatchDeleteTableVersionResponse -> Maybe [TableVersionError]
errors} -> Maybe [TableVersionError]
errors) (\s :: BatchDeleteTableVersionResponse
s@BatchDeleteTableVersionResponse' {} Maybe [TableVersionError]
a -> BatchDeleteTableVersionResponse
s {$sel:errors:BatchDeleteTableVersionResponse' :: Maybe [TableVersionError]
errors = Maybe [TableVersionError]
a} :: BatchDeleteTableVersionResponse) ((Maybe [TableVersionError] -> f (Maybe [TableVersionError]))
 -> BatchDeleteTableVersionResponse
 -> f BatchDeleteTableVersionResponse)
-> ((Maybe [TableVersionError] -> f (Maybe [TableVersionError]))
    -> Maybe [TableVersionError] -> f (Maybe [TableVersionError]))
-> (Maybe [TableVersionError] -> f (Maybe [TableVersionError]))
-> BatchDeleteTableVersionResponse
-> f BatchDeleteTableVersionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TableVersionError]
  [TableVersionError]
  [TableVersionError]
  [TableVersionError]
-> Iso
     (Maybe [TableVersionError])
     (Maybe [TableVersionError])
     (Maybe [TableVersionError])
     (Maybe [TableVersionError])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [TableVersionError]
  [TableVersionError]
  [TableVersionError]
  [TableVersionError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
batchDeleteTableVersionResponse_httpStatus :: Lens.Lens' BatchDeleteTableVersionResponse Prelude.Int
batchDeleteTableVersionResponse_httpStatus :: (Int -> f Int)
-> BatchDeleteTableVersionResponse
-> f BatchDeleteTableVersionResponse
batchDeleteTableVersionResponse_httpStatus = (BatchDeleteTableVersionResponse -> Int)
-> (BatchDeleteTableVersionResponse
    -> Int -> BatchDeleteTableVersionResponse)
-> Lens
     BatchDeleteTableVersionResponse
     BatchDeleteTableVersionResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteTableVersionResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchDeleteTableVersionResponse' :: BatchDeleteTableVersionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchDeleteTableVersionResponse
s@BatchDeleteTableVersionResponse' {} Int
a -> BatchDeleteTableVersionResponse
s {$sel:httpStatus:BatchDeleteTableVersionResponse' :: Int
httpStatus = Int
a} :: BatchDeleteTableVersionResponse)

instance
  Prelude.NFData
    BatchDeleteTableVersionResponse