{-# 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.BatchUpdatePartition
-- 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)
--
-- Updates one or more partitions in a batch operation.
module Amazonka.Glue.BatchUpdatePartition
  ( -- * Creating a Request
    BatchUpdatePartition (..),
    newBatchUpdatePartition,

    -- * Request Lenses
    batchUpdatePartition_catalogId,
    batchUpdatePartition_databaseName,
    batchUpdatePartition_tableName,
    batchUpdatePartition_entries,

    -- * Destructuring the Response
    BatchUpdatePartitionResponse (..),
    newBatchUpdatePartitionResponse,

    -- * Response Lenses
    batchUpdatePartitionResponse_errors,
    batchUpdatePartitionResponse_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:/ 'newBatchUpdatePartition' smart constructor.
data BatchUpdatePartition = BatchUpdatePartition'
  { -- | The ID of the catalog in which the partition is to be updated.
    -- Currently, this should be the Amazon Web Services account ID.
    BatchUpdatePartition -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
    -- | The name of the metadata database in which the partition is to be
    -- updated.
    BatchUpdatePartition -> Text
databaseName :: Prelude.Text,
    -- | The name of the metadata table in which the partition is to be updated.
    BatchUpdatePartition -> Text
tableName :: Prelude.Text,
    -- | A list of up to 100 @BatchUpdatePartitionRequestEntry@ objects to
    -- update.
    BatchUpdatePartition -> NonEmpty BatchUpdatePartitionRequestEntry
entries :: Prelude.NonEmpty BatchUpdatePartitionRequestEntry
  }
  deriving (BatchUpdatePartition -> BatchUpdatePartition -> Bool
(BatchUpdatePartition -> BatchUpdatePartition -> Bool)
-> (BatchUpdatePartition -> BatchUpdatePartition -> Bool)
-> Eq BatchUpdatePartition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchUpdatePartition -> BatchUpdatePartition -> Bool
$c/= :: BatchUpdatePartition -> BatchUpdatePartition -> Bool
== :: BatchUpdatePartition -> BatchUpdatePartition -> Bool
$c== :: BatchUpdatePartition -> BatchUpdatePartition -> Bool
Prelude.Eq, ReadPrec [BatchUpdatePartition]
ReadPrec BatchUpdatePartition
Int -> ReadS BatchUpdatePartition
ReadS [BatchUpdatePartition]
(Int -> ReadS BatchUpdatePartition)
-> ReadS [BatchUpdatePartition]
-> ReadPrec BatchUpdatePartition
-> ReadPrec [BatchUpdatePartition]
-> Read BatchUpdatePartition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchUpdatePartition]
$creadListPrec :: ReadPrec [BatchUpdatePartition]
readPrec :: ReadPrec BatchUpdatePartition
$creadPrec :: ReadPrec BatchUpdatePartition
readList :: ReadS [BatchUpdatePartition]
$creadList :: ReadS [BatchUpdatePartition]
readsPrec :: Int -> ReadS BatchUpdatePartition
$creadsPrec :: Int -> ReadS BatchUpdatePartition
Prelude.Read, Int -> BatchUpdatePartition -> ShowS
[BatchUpdatePartition] -> ShowS
BatchUpdatePartition -> String
(Int -> BatchUpdatePartition -> ShowS)
-> (BatchUpdatePartition -> String)
-> ([BatchUpdatePartition] -> ShowS)
-> Show BatchUpdatePartition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchUpdatePartition] -> ShowS
$cshowList :: [BatchUpdatePartition] -> ShowS
show :: BatchUpdatePartition -> String
$cshow :: BatchUpdatePartition -> String
showsPrec :: Int -> BatchUpdatePartition -> ShowS
$cshowsPrec :: Int -> BatchUpdatePartition -> ShowS
Prelude.Show, (forall x. BatchUpdatePartition -> Rep BatchUpdatePartition x)
-> (forall x. Rep BatchUpdatePartition x -> BatchUpdatePartition)
-> Generic BatchUpdatePartition
forall x. Rep BatchUpdatePartition x -> BatchUpdatePartition
forall x. BatchUpdatePartition -> Rep BatchUpdatePartition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchUpdatePartition x -> BatchUpdatePartition
$cfrom :: forall x. BatchUpdatePartition -> Rep BatchUpdatePartition x
Prelude.Generic)

-- |
-- Create a value of 'BatchUpdatePartition' 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', 'batchUpdatePartition_catalogId' - The ID of the catalog in which the partition is to be updated.
-- Currently, this should be the Amazon Web Services account ID.
--
-- 'databaseName', 'batchUpdatePartition_databaseName' - The name of the metadata database in which the partition is to be
-- updated.
--
-- 'tableName', 'batchUpdatePartition_tableName' - The name of the metadata table in which the partition is to be updated.
--
-- 'entries', 'batchUpdatePartition_entries' - A list of up to 100 @BatchUpdatePartitionRequestEntry@ objects to
-- update.
newBatchUpdatePartition ::
  -- | 'databaseName'
  Prelude.Text ->
  -- | 'tableName'
  Prelude.Text ->
  -- | 'entries'
  Prelude.NonEmpty BatchUpdatePartitionRequestEntry ->
  BatchUpdatePartition
newBatchUpdatePartition :: Text
-> Text
-> NonEmpty BatchUpdatePartitionRequestEntry
-> BatchUpdatePartition
newBatchUpdatePartition
  Text
pDatabaseName_
  Text
pTableName_
  NonEmpty BatchUpdatePartitionRequestEntry
pEntries_ =
    BatchUpdatePartition' :: Maybe Text
-> Text
-> Text
-> NonEmpty BatchUpdatePartitionRequestEntry
-> BatchUpdatePartition
BatchUpdatePartition'
      { $sel:catalogId:BatchUpdatePartition' :: Maybe Text
catalogId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:databaseName:BatchUpdatePartition' :: Text
databaseName = Text
pDatabaseName_,
        $sel:tableName:BatchUpdatePartition' :: Text
tableName = Text
pTableName_,
        $sel:entries:BatchUpdatePartition' :: NonEmpty BatchUpdatePartitionRequestEntry
entries = Tagged
  (NonEmpty BatchUpdatePartitionRequestEntry)
  (Identity (NonEmpty BatchUpdatePartitionRequestEntry))
-> Tagged
     (NonEmpty BatchUpdatePartitionRequestEntry)
     (Identity (NonEmpty BatchUpdatePartitionRequestEntry))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty BatchUpdatePartitionRequestEntry)
   (Identity (NonEmpty BatchUpdatePartitionRequestEntry))
 -> Tagged
      (NonEmpty BatchUpdatePartitionRequestEntry)
      (Identity (NonEmpty BatchUpdatePartitionRequestEntry)))
-> NonEmpty BatchUpdatePartitionRequestEntry
-> NonEmpty BatchUpdatePartitionRequestEntry
forall t b. AReview t b -> b -> t
Lens.# NonEmpty BatchUpdatePartitionRequestEntry
pEntries_
      }

-- | The ID of the catalog in which the partition is to be updated.
-- Currently, this should be the Amazon Web Services account ID.
batchUpdatePartition_catalogId :: Lens.Lens' BatchUpdatePartition (Prelude.Maybe Prelude.Text)
batchUpdatePartition_catalogId :: (Maybe Text -> f (Maybe Text))
-> BatchUpdatePartition -> f BatchUpdatePartition
batchUpdatePartition_catalogId = (BatchUpdatePartition -> Maybe Text)
-> (BatchUpdatePartition -> Maybe Text -> BatchUpdatePartition)
-> Lens
     BatchUpdatePartition BatchUpdatePartition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdatePartition' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:BatchUpdatePartition' :: BatchUpdatePartition -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: BatchUpdatePartition
s@BatchUpdatePartition' {} Maybe Text
a -> BatchUpdatePartition
s {$sel:catalogId:BatchUpdatePartition' :: Maybe Text
catalogId = Maybe Text
a} :: BatchUpdatePartition)

-- | The name of the metadata database in which the partition is to be
-- updated.
batchUpdatePartition_databaseName :: Lens.Lens' BatchUpdatePartition Prelude.Text
batchUpdatePartition_databaseName :: (Text -> f Text) -> BatchUpdatePartition -> f BatchUpdatePartition
batchUpdatePartition_databaseName = (BatchUpdatePartition -> Text)
-> (BatchUpdatePartition -> Text -> BatchUpdatePartition)
-> Lens BatchUpdatePartition BatchUpdatePartition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdatePartition' {Text
databaseName :: Text
$sel:databaseName:BatchUpdatePartition' :: BatchUpdatePartition -> Text
databaseName} -> Text
databaseName) (\s :: BatchUpdatePartition
s@BatchUpdatePartition' {} Text
a -> BatchUpdatePartition
s {$sel:databaseName:BatchUpdatePartition' :: Text
databaseName = Text
a} :: BatchUpdatePartition)

-- | The name of the metadata table in which the partition is to be updated.
batchUpdatePartition_tableName :: Lens.Lens' BatchUpdatePartition Prelude.Text
batchUpdatePartition_tableName :: (Text -> f Text) -> BatchUpdatePartition -> f BatchUpdatePartition
batchUpdatePartition_tableName = (BatchUpdatePartition -> Text)
-> (BatchUpdatePartition -> Text -> BatchUpdatePartition)
-> Lens BatchUpdatePartition BatchUpdatePartition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdatePartition' {Text
tableName :: Text
$sel:tableName:BatchUpdatePartition' :: BatchUpdatePartition -> Text
tableName} -> Text
tableName) (\s :: BatchUpdatePartition
s@BatchUpdatePartition' {} Text
a -> BatchUpdatePartition
s {$sel:tableName:BatchUpdatePartition' :: Text
tableName = Text
a} :: BatchUpdatePartition)

-- | A list of up to 100 @BatchUpdatePartitionRequestEntry@ objects to
-- update.
batchUpdatePartition_entries :: Lens.Lens' BatchUpdatePartition (Prelude.NonEmpty BatchUpdatePartitionRequestEntry)
batchUpdatePartition_entries :: (NonEmpty BatchUpdatePartitionRequestEntry
 -> f (NonEmpty BatchUpdatePartitionRequestEntry))
-> BatchUpdatePartition -> f BatchUpdatePartition
batchUpdatePartition_entries = (BatchUpdatePartition -> NonEmpty BatchUpdatePartitionRequestEntry)
-> (BatchUpdatePartition
    -> NonEmpty BatchUpdatePartitionRequestEntry
    -> BatchUpdatePartition)
-> Lens
     BatchUpdatePartition
     BatchUpdatePartition
     (NonEmpty BatchUpdatePartitionRequestEntry)
     (NonEmpty BatchUpdatePartitionRequestEntry)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdatePartition' {NonEmpty BatchUpdatePartitionRequestEntry
entries :: NonEmpty BatchUpdatePartitionRequestEntry
$sel:entries:BatchUpdatePartition' :: BatchUpdatePartition -> NonEmpty BatchUpdatePartitionRequestEntry
entries} -> NonEmpty BatchUpdatePartitionRequestEntry
entries) (\s :: BatchUpdatePartition
s@BatchUpdatePartition' {} NonEmpty BatchUpdatePartitionRequestEntry
a -> BatchUpdatePartition
s {$sel:entries:BatchUpdatePartition' :: NonEmpty BatchUpdatePartitionRequestEntry
entries = NonEmpty BatchUpdatePartitionRequestEntry
a} :: BatchUpdatePartition) ((NonEmpty BatchUpdatePartitionRequestEntry
  -> f (NonEmpty BatchUpdatePartitionRequestEntry))
 -> BatchUpdatePartition -> f BatchUpdatePartition)
-> ((NonEmpty BatchUpdatePartitionRequestEntry
     -> f (NonEmpty BatchUpdatePartitionRequestEntry))
    -> NonEmpty BatchUpdatePartitionRequestEntry
    -> f (NonEmpty BatchUpdatePartitionRequestEntry))
-> (NonEmpty BatchUpdatePartitionRequestEntry
    -> f (NonEmpty BatchUpdatePartitionRequestEntry))
-> BatchUpdatePartition
-> f BatchUpdatePartition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty BatchUpdatePartitionRequestEntry
 -> f (NonEmpty BatchUpdatePartitionRequestEntry))
-> NonEmpty BatchUpdatePartitionRequestEntry
-> f (NonEmpty BatchUpdatePartitionRequestEntry)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData BatchUpdatePartition

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

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

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

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

-- |
-- Create a value of 'BatchUpdatePartitionResponse' 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', 'batchUpdatePartitionResponse_errors' - The errors encountered when trying to update the requested partitions. A
-- list of @BatchUpdatePartitionFailureEntry@ objects.
--
-- 'httpStatus', 'batchUpdatePartitionResponse_httpStatus' - The response's http status code.
newBatchUpdatePartitionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchUpdatePartitionResponse
newBatchUpdatePartitionResponse :: Int -> BatchUpdatePartitionResponse
newBatchUpdatePartitionResponse Int
pHttpStatus_ =
  BatchUpdatePartitionResponse' :: Maybe [BatchUpdatePartitionFailureEntry]
-> Int -> BatchUpdatePartitionResponse
BatchUpdatePartitionResponse'
    { $sel:errors:BatchUpdatePartitionResponse' :: Maybe [BatchUpdatePartitionFailureEntry]
errors =
        Maybe [BatchUpdatePartitionFailureEntry]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:BatchUpdatePartitionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The errors encountered when trying to update the requested partitions. A
-- list of @BatchUpdatePartitionFailureEntry@ objects.
batchUpdatePartitionResponse_errors :: Lens.Lens' BatchUpdatePartitionResponse (Prelude.Maybe [BatchUpdatePartitionFailureEntry])
batchUpdatePartitionResponse_errors :: (Maybe [BatchUpdatePartitionFailureEntry]
 -> f (Maybe [BatchUpdatePartitionFailureEntry]))
-> BatchUpdatePartitionResponse -> f BatchUpdatePartitionResponse
batchUpdatePartitionResponse_errors = (BatchUpdatePartitionResponse
 -> Maybe [BatchUpdatePartitionFailureEntry])
-> (BatchUpdatePartitionResponse
    -> Maybe [BatchUpdatePartitionFailureEntry]
    -> BatchUpdatePartitionResponse)
-> Lens
     BatchUpdatePartitionResponse
     BatchUpdatePartitionResponse
     (Maybe [BatchUpdatePartitionFailureEntry])
     (Maybe [BatchUpdatePartitionFailureEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdatePartitionResponse' {Maybe [BatchUpdatePartitionFailureEntry]
errors :: Maybe [BatchUpdatePartitionFailureEntry]
$sel:errors:BatchUpdatePartitionResponse' :: BatchUpdatePartitionResponse
-> Maybe [BatchUpdatePartitionFailureEntry]
errors} -> Maybe [BatchUpdatePartitionFailureEntry]
errors) (\s :: BatchUpdatePartitionResponse
s@BatchUpdatePartitionResponse' {} Maybe [BatchUpdatePartitionFailureEntry]
a -> BatchUpdatePartitionResponse
s {$sel:errors:BatchUpdatePartitionResponse' :: Maybe [BatchUpdatePartitionFailureEntry]
errors = Maybe [BatchUpdatePartitionFailureEntry]
a} :: BatchUpdatePartitionResponse) ((Maybe [BatchUpdatePartitionFailureEntry]
  -> f (Maybe [BatchUpdatePartitionFailureEntry]))
 -> BatchUpdatePartitionResponse -> f BatchUpdatePartitionResponse)
-> ((Maybe [BatchUpdatePartitionFailureEntry]
     -> f (Maybe [BatchUpdatePartitionFailureEntry]))
    -> Maybe [BatchUpdatePartitionFailureEntry]
    -> f (Maybe [BatchUpdatePartitionFailureEntry]))
-> (Maybe [BatchUpdatePartitionFailureEntry]
    -> f (Maybe [BatchUpdatePartitionFailureEntry]))
-> BatchUpdatePartitionResponse
-> f BatchUpdatePartitionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [BatchUpdatePartitionFailureEntry]
  [BatchUpdatePartitionFailureEntry]
  [BatchUpdatePartitionFailureEntry]
  [BatchUpdatePartitionFailureEntry]
-> Iso
     (Maybe [BatchUpdatePartitionFailureEntry])
     (Maybe [BatchUpdatePartitionFailureEntry])
     (Maybe [BatchUpdatePartitionFailureEntry])
     (Maybe [BatchUpdatePartitionFailureEntry])
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
  [BatchUpdatePartitionFailureEntry]
  [BatchUpdatePartitionFailureEntry]
  [BatchUpdatePartitionFailureEntry]
  [BatchUpdatePartitionFailureEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData BatchUpdatePartitionResponse