{-# 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.LexV2Models.BatchUpdateCustomVocabularyItem
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Batch update custom vocabulary item for the specified locale in the
-- specified bot.
module Amazonka.LexV2Models.BatchUpdateCustomVocabularyItem
  ( -- * Creating a Request
    BatchUpdateCustomVocabularyItem (..),
    newBatchUpdateCustomVocabularyItem,

    -- * Request Lenses
    batchUpdateCustomVocabularyItem_botId,
    batchUpdateCustomVocabularyItem_botVersion,
    batchUpdateCustomVocabularyItem_localeId,
    batchUpdateCustomVocabularyItem_customVocabularyItemList,

    -- * Destructuring the Response
    BatchUpdateCustomVocabularyItemResponse (..),
    newBatchUpdateCustomVocabularyItemResponse,

    -- * Response Lenses
    batchUpdateCustomVocabularyItemResponse_botId,
    batchUpdateCustomVocabularyItemResponse_botVersion,
    batchUpdateCustomVocabularyItemResponse_errors,
    batchUpdateCustomVocabularyItemResponse_localeId,
    batchUpdateCustomVocabularyItemResponse_resources,
    batchUpdateCustomVocabularyItemResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newBatchUpdateCustomVocabularyItem' smart constructor.
data BatchUpdateCustomVocabularyItem = BatchUpdateCustomVocabularyItem'
  { -- | The unique identifier of the bot to the batch update request for the
    -- custom vocabulary item.
    BatchUpdateCustomVocabularyItem -> Text
botId :: Prelude.Text,
    -- | The bot version of the bot to the batch update request for the custom
    -- vocabulary item.
    BatchUpdateCustomVocabularyItem -> Text
botVersion :: Prelude.Text,
    -- | The locale identifier of the bot to the batch update request for the
    -- custom vocabulary item.
    BatchUpdateCustomVocabularyItem -> Text
localeId :: Prelude.Text,
    -- | The custom vocabulary item list of the bot to the batch update request
    -- for the custom vocabulary item.
    BatchUpdateCustomVocabularyItem -> NonEmpty CustomVocabularyItem
customVocabularyItemList :: Prelude.NonEmpty CustomVocabularyItem
  }
  deriving (BatchUpdateCustomVocabularyItem
-> BatchUpdateCustomVocabularyItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchUpdateCustomVocabularyItem
-> BatchUpdateCustomVocabularyItem -> Bool
$c/= :: BatchUpdateCustomVocabularyItem
-> BatchUpdateCustomVocabularyItem -> Bool
== :: BatchUpdateCustomVocabularyItem
-> BatchUpdateCustomVocabularyItem -> Bool
$c== :: BatchUpdateCustomVocabularyItem
-> BatchUpdateCustomVocabularyItem -> Bool
Prelude.Eq, ReadPrec [BatchUpdateCustomVocabularyItem]
ReadPrec BatchUpdateCustomVocabularyItem
Int -> ReadS BatchUpdateCustomVocabularyItem
ReadS [BatchUpdateCustomVocabularyItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchUpdateCustomVocabularyItem]
$creadListPrec :: ReadPrec [BatchUpdateCustomVocabularyItem]
readPrec :: ReadPrec BatchUpdateCustomVocabularyItem
$creadPrec :: ReadPrec BatchUpdateCustomVocabularyItem
readList :: ReadS [BatchUpdateCustomVocabularyItem]
$creadList :: ReadS [BatchUpdateCustomVocabularyItem]
readsPrec :: Int -> ReadS BatchUpdateCustomVocabularyItem
$creadsPrec :: Int -> ReadS BatchUpdateCustomVocabularyItem
Prelude.Read, Int -> BatchUpdateCustomVocabularyItem -> ShowS
[BatchUpdateCustomVocabularyItem] -> ShowS
BatchUpdateCustomVocabularyItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchUpdateCustomVocabularyItem] -> ShowS
$cshowList :: [BatchUpdateCustomVocabularyItem] -> ShowS
show :: BatchUpdateCustomVocabularyItem -> String
$cshow :: BatchUpdateCustomVocabularyItem -> String
showsPrec :: Int -> BatchUpdateCustomVocabularyItem -> ShowS
$cshowsPrec :: Int -> BatchUpdateCustomVocabularyItem -> ShowS
Prelude.Show, forall x.
Rep BatchUpdateCustomVocabularyItem x
-> BatchUpdateCustomVocabularyItem
forall x.
BatchUpdateCustomVocabularyItem
-> Rep BatchUpdateCustomVocabularyItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchUpdateCustomVocabularyItem x
-> BatchUpdateCustomVocabularyItem
$cfrom :: forall x.
BatchUpdateCustomVocabularyItem
-> Rep BatchUpdateCustomVocabularyItem x
Prelude.Generic)

-- |
-- Create a value of 'BatchUpdateCustomVocabularyItem' 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:
--
-- 'botId', 'batchUpdateCustomVocabularyItem_botId' - The unique identifier of the bot to the batch update request for the
-- custom vocabulary item.
--
-- 'botVersion', 'batchUpdateCustomVocabularyItem_botVersion' - The bot version of the bot to the batch update request for the custom
-- vocabulary item.
--
-- 'localeId', 'batchUpdateCustomVocabularyItem_localeId' - The locale identifier of the bot to the batch update request for the
-- custom vocabulary item.
--
-- 'customVocabularyItemList', 'batchUpdateCustomVocabularyItem_customVocabularyItemList' - The custom vocabulary item list of the bot to the batch update request
-- for the custom vocabulary item.
newBatchUpdateCustomVocabularyItem ::
  -- | 'botId'
  Prelude.Text ->
  -- | 'botVersion'
  Prelude.Text ->
  -- | 'localeId'
  Prelude.Text ->
  -- | 'customVocabularyItemList'
  Prelude.NonEmpty CustomVocabularyItem ->
  BatchUpdateCustomVocabularyItem
newBatchUpdateCustomVocabularyItem :: Text
-> Text
-> Text
-> NonEmpty CustomVocabularyItem
-> BatchUpdateCustomVocabularyItem
newBatchUpdateCustomVocabularyItem
  Text
pBotId_
  Text
pBotVersion_
  Text
pLocaleId_
  NonEmpty CustomVocabularyItem
pCustomVocabularyItemList_ =
    BatchUpdateCustomVocabularyItem'
      { $sel:botId:BatchUpdateCustomVocabularyItem' :: Text
botId = Text
pBotId_,
        $sel:botVersion:BatchUpdateCustomVocabularyItem' :: Text
botVersion = Text
pBotVersion_,
        $sel:localeId:BatchUpdateCustomVocabularyItem' :: Text
localeId = Text
pLocaleId_,
        $sel:customVocabularyItemList:BatchUpdateCustomVocabularyItem' :: NonEmpty CustomVocabularyItem
customVocabularyItemList =
          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 CustomVocabularyItem
pCustomVocabularyItemList_
      }

-- | The unique identifier of the bot to the batch update request for the
-- custom vocabulary item.
batchUpdateCustomVocabularyItem_botId :: Lens.Lens' BatchUpdateCustomVocabularyItem Prelude.Text
batchUpdateCustomVocabularyItem_botId :: Lens' BatchUpdateCustomVocabularyItem Text
batchUpdateCustomVocabularyItem_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateCustomVocabularyItem' {Text
botId :: Text
$sel:botId:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
botId} -> Text
botId) (\s :: BatchUpdateCustomVocabularyItem
s@BatchUpdateCustomVocabularyItem' {} Text
a -> BatchUpdateCustomVocabularyItem
s {$sel:botId:BatchUpdateCustomVocabularyItem' :: Text
botId = Text
a} :: BatchUpdateCustomVocabularyItem)

-- | The bot version of the bot to the batch update request for the custom
-- vocabulary item.
batchUpdateCustomVocabularyItem_botVersion :: Lens.Lens' BatchUpdateCustomVocabularyItem Prelude.Text
batchUpdateCustomVocabularyItem_botVersion :: Lens' BatchUpdateCustomVocabularyItem Text
batchUpdateCustomVocabularyItem_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateCustomVocabularyItem' {Text
botVersion :: Text
$sel:botVersion:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
botVersion} -> Text
botVersion) (\s :: BatchUpdateCustomVocabularyItem
s@BatchUpdateCustomVocabularyItem' {} Text
a -> BatchUpdateCustomVocabularyItem
s {$sel:botVersion:BatchUpdateCustomVocabularyItem' :: Text
botVersion = Text
a} :: BatchUpdateCustomVocabularyItem)

-- | The locale identifier of the bot to the batch update request for the
-- custom vocabulary item.
batchUpdateCustomVocabularyItem_localeId :: Lens.Lens' BatchUpdateCustomVocabularyItem Prelude.Text
batchUpdateCustomVocabularyItem_localeId :: Lens' BatchUpdateCustomVocabularyItem Text
batchUpdateCustomVocabularyItem_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateCustomVocabularyItem' {Text
localeId :: Text
$sel:localeId:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
localeId} -> Text
localeId) (\s :: BatchUpdateCustomVocabularyItem
s@BatchUpdateCustomVocabularyItem' {} Text
a -> BatchUpdateCustomVocabularyItem
s {$sel:localeId:BatchUpdateCustomVocabularyItem' :: Text
localeId = Text
a} :: BatchUpdateCustomVocabularyItem)

-- | The custom vocabulary item list of the bot to the batch update request
-- for the custom vocabulary item.
batchUpdateCustomVocabularyItem_customVocabularyItemList :: Lens.Lens' BatchUpdateCustomVocabularyItem (Prelude.NonEmpty CustomVocabularyItem)
batchUpdateCustomVocabularyItem_customVocabularyItemList :: Lens'
  BatchUpdateCustomVocabularyItem (NonEmpty CustomVocabularyItem)
batchUpdateCustomVocabularyItem_customVocabularyItemList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateCustomVocabularyItem' {NonEmpty CustomVocabularyItem
customVocabularyItemList :: NonEmpty CustomVocabularyItem
$sel:customVocabularyItemList:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> NonEmpty CustomVocabularyItem
customVocabularyItemList} -> NonEmpty CustomVocabularyItem
customVocabularyItemList) (\s :: BatchUpdateCustomVocabularyItem
s@BatchUpdateCustomVocabularyItem' {} NonEmpty CustomVocabularyItem
a -> BatchUpdateCustomVocabularyItem
s {$sel:customVocabularyItemList:BatchUpdateCustomVocabularyItem' :: NonEmpty CustomVocabularyItem
customVocabularyItemList = NonEmpty CustomVocabularyItem
a} :: BatchUpdateCustomVocabularyItem) 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
    BatchUpdateCustomVocabularyItem
  where
  type
    AWSResponse BatchUpdateCustomVocabularyItem =
      BatchUpdateCustomVocabularyItemResponse
  request :: (Service -> Service)
-> BatchUpdateCustomVocabularyItem
-> Request BatchUpdateCustomVocabularyItem
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy BatchUpdateCustomVocabularyItem
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse BatchUpdateCustomVocabularyItem)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [FailedCustomVocabularyItem]
-> Maybe Text
-> Maybe [CustomVocabularyItem]
-> Int
-> BatchUpdateCustomVocabularyItemResponse
BatchUpdateCustomVocabularyItemResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"botId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"botVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"errors" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"localeId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"resources" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => 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
    BatchUpdateCustomVocabularyItem
  where
  hashWithSalt :: Int -> BatchUpdateCustomVocabularyItem -> Int
hashWithSalt
    Int
_salt
    BatchUpdateCustomVocabularyItem' {NonEmpty CustomVocabularyItem
Text
customVocabularyItemList :: NonEmpty CustomVocabularyItem
localeId :: Text
botVersion :: Text
botId :: Text
$sel:customVocabularyItemList:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> NonEmpty CustomVocabularyItem
$sel:localeId:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
$sel:botVersion:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
$sel:botId:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botVersion
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
localeId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty CustomVocabularyItem
customVocabularyItemList

instance
  Prelude.NFData
    BatchUpdateCustomVocabularyItem
  where
  rnf :: BatchUpdateCustomVocabularyItem -> ()
rnf BatchUpdateCustomVocabularyItem' {NonEmpty CustomVocabularyItem
Text
customVocabularyItemList :: NonEmpty CustomVocabularyItem
localeId :: Text
botVersion :: Text
botId :: Text
$sel:customVocabularyItemList:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> NonEmpty CustomVocabularyItem
$sel:localeId:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
$sel:botVersion:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
$sel:botId:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
botId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
botVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
localeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty CustomVocabularyItem
customVocabularyItemList

instance
  Data.ToHeaders
    BatchUpdateCustomVocabularyItem
  where
  toHeaders :: BatchUpdateCustomVocabularyItem -> 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 BatchUpdateCustomVocabularyItem where
  toJSON :: BatchUpdateCustomVocabularyItem -> Value
toJSON BatchUpdateCustomVocabularyItem' {NonEmpty CustomVocabularyItem
Text
customVocabularyItemList :: NonEmpty CustomVocabularyItem
localeId :: Text
botVersion :: Text
botId :: Text
$sel:customVocabularyItemList:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> NonEmpty CustomVocabularyItem
$sel:localeId:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
$sel:botVersion:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
$sel:botId:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              ( Key
"customVocabularyItemList"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty CustomVocabularyItem
customVocabularyItemList
              )
          ]
      )

instance Data.ToPath BatchUpdateCustomVocabularyItem where
  toPath :: BatchUpdateCustomVocabularyItem -> ByteString
toPath BatchUpdateCustomVocabularyItem' {NonEmpty CustomVocabularyItem
Text
customVocabularyItemList :: NonEmpty CustomVocabularyItem
localeId :: Text
botVersion :: Text
botId :: Text
$sel:customVocabularyItemList:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> NonEmpty CustomVocabularyItem
$sel:localeId:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
$sel:botVersion:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
$sel:botId:BatchUpdateCustomVocabularyItem' :: BatchUpdateCustomVocabularyItem -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/bots/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
botId,
        ByteString
"/botversions/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
botVersion,
        ByteString
"/botlocales/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
localeId,
        ByteString
"/customvocabulary/DEFAULT/batchupdate"
      ]

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

-- | /See:/ 'newBatchUpdateCustomVocabularyItemResponse' smart constructor.
data BatchUpdateCustomVocabularyItemResponse = BatchUpdateCustomVocabularyItemResponse'
  { -- | The unique identifier of the bot to the batch update response for the
    -- custom vocabulary item.
    BatchUpdateCustomVocabularyItemResponse -> Maybe Text
botId :: Prelude.Maybe Prelude.Text,
    -- | The bot version of the bot to the batch update response for the custom
    -- vocabulary item.
    BatchUpdateCustomVocabularyItemResponse -> Maybe Text
botVersion :: Prelude.Maybe Prelude.Text,
    -- | The errors of the action to batch update response for the custom
    -- vocabulary item.
    BatchUpdateCustomVocabularyItemResponse
-> Maybe [FailedCustomVocabularyItem]
errors :: Prelude.Maybe [FailedCustomVocabularyItem],
    -- | The locale identifier of the bot to the batch update response for the
    -- custom vocabulary item.
    BatchUpdateCustomVocabularyItemResponse -> Maybe Text
localeId :: Prelude.Maybe Prelude.Text,
    -- | The resources of the action to batch update response for the custom
    -- vocabulary item.
    BatchUpdateCustomVocabularyItemResponse
-> Maybe [CustomVocabularyItem]
resources :: Prelude.Maybe [CustomVocabularyItem],
    -- | The response's http status code.
    BatchUpdateCustomVocabularyItemResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (BatchUpdateCustomVocabularyItemResponse
-> BatchUpdateCustomVocabularyItemResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchUpdateCustomVocabularyItemResponse
-> BatchUpdateCustomVocabularyItemResponse -> Bool
$c/= :: BatchUpdateCustomVocabularyItemResponse
-> BatchUpdateCustomVocabularyItemResponse -> Bool
== :: BatchUpdateCustomVocabularyItemResponse
-> BatchUpdateCustomVocabularyItemResponse -> Bool
$c== :: BatchUpdateCustomVocabularyItemResponse
-> BatchUpdateCustomVocabularyItemResponse -> Bool
Prelude.Eq, ReadPrec [BatchUpdateCustomVocabularyItemResponse]
ReadPrec BatchUpdateCustomVocabularyItemResponse
Int -> ReadS BatchUpdateCustomVocabularyItemResponse
ReadS [BatchUpdateCustomVocabularyItemResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchUpdateCustomVocabularyItemResponse]
$creadListPrec :: ReadPrec [BatchUpdateCustomVocabularyItemResponse]
readPrec :: ReadPrec BatchUpdateCustomVocabularyItemResponse
$creadPrec :: ReadPrec BatchUpdateCustomVocabularyItemResponse
readList :: ReadS [BatchUpdateCustomVocabularyItemResponse]
$creadList :: ReadS [BatchUpdateCustomVocabularyItemResponse]
readsPrec :: Int -> ReadS BatchUpdateCustomVocabularyItemResponse
$creadsPrec :: Int -> ReadS BatchUpdateCustomVocabularyItemResponse
Prelude.Read, Int -> BatchUpdateCustomVocabularyItemResponse -> ShowS
[BatchUpdateCustomVocabularyItemResponse] -> ShowS
BatchUpdateCustomVocabularyItemResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchUpdateCustomVocabularyItemResponse] -> ShowS
$cshowList :: [BatchUpdateCustomVocabularyItemResponse] -> ShowS
show :: BatchUpdateCustomVocabularyItemResponse -> String
$cshow :: BatchUpdateCustomVocabularyItemResponse -> String
showsPrec :: Int -> BatchUpdateCustomVocabularyItemResponse -> ShowS
$cshowsPrec :: Int -> BatchUpdateCustomVocabularyItemResponse -> ShowS
Prelude.Show, forall x.
Rep BatchUpdateCustomVocabularyItemResponse x
-> BatchUpdateCustomVocabularyItemResponse
forall x.
BatchUpdateCustomVocabularyItemResponse
-> Rep BatchUpdateCustomVocabularyItemResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchUpdateCustomVocabularyItemResponse x
-> BatchUpdateCustomVocabularyItemResponse
$cfrom :: forall x.
BatchUpdateCustomVocabularyItemResponse
-> Rep BatchUpdateCustomVocabularyItemResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchUpdateCustomVocabularyItemResponse' 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:
--
-- 'botId', 'batchUpdateCustomVocabularyItemResponse_botId' - The unique identifier of the bot to the batch update response for the
-- custom vocabulary item.
--
-- 'botVersion', 'batchUpdateCustomVocabularyItemResponse_botVersion' - The bot version of the bot to the batch update response for the custom
-- vocabulary item.
--
-- 'errors', 'batchUpdateCustomVocabularyItemResponse_errors' - The errors of the action to batch update response for the custom
-- vocabulary item.
--
-- 'localeId', 'batchUpdateCustomVocabularyItemResponse_localeId' - The locale identifier of the bot to the batch update response for the
-- custom vocabulary item.
--
-- 'resources', 'batchUpdateCustomVocabularyItemResponse_resources' - The resources of the action to batch update response for the custom
-- vocabulary item.
--
-- 'httpStatus', 'batchUpdateCustomVocabularyItemResponse_httpStatus' - The response's http status code.
newBatchUpdateCustomVocabularyItemResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchUpdateCustomVocabularyItemResponse
newBatchUpdateCustomVocabularyItemResponse :: Int -> BatchUpdateCustomVocabularyItemResponse
newBatchUpdateCustomVocabularyItemResponse
  Int
pHttpStatus_ =
    BatchUpdateCustomVocabularyItemResponse'
      { $sel:botId:BatchUpdateCustomVocabularyItemResponse' :: Maybe Text
botId =
          forall a. Maybe a
Prelude.Nothing,
        $sel:botVersion:BatchUpdateCustomVocabularyItemResponse' :: Maybe Text
botVersion = forall a. Maybe a
Prelude.Nothing,
        $sel:errors:BatchUpdateCustomVocabularyItemResponse' :: Maybe [FailedCustomVocabularyItem]
errors = forall a. Maybe a
Prelude.Nothing,
        $sel:localeId:BatchUpdateCustomVocabularyItemResponse' :: Maybe Text
localeId = forall a. Maybe a
Prelude.Nothing,
        $sel:resources:BatchUpdateCustomVocabularyItemResponse' :: Maybe [CustomVocabularyItem]
resources = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:BatchUpdateCustomVocabularyItemResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The unique identifier of the bot to the batch update response for the
-- custom vocabulary item.
batchUpdateCustomVocabularyItemResponse_botId :: Lens.Lens' BatchUpdateCustomVocabularyItemResponse (Prelude.Maybe Prelude.Text)
batchUpdateCustomVocabularyItemResponse_botId :: Lens' BatchUpdateCustomVocabularyItemResponse (Maybe Text)
batchUpdateCustomVocabularyItemResponse_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateCustomVocabularyItemResponse' {Maybe Text
botId :: Maybe Text
$sel:botId:BatchUpdateCustomVocabularyItemResponse' :: BatchUpdateCustomVocabularyItemResponse -> Maybe Text
botId} -> Maybe Text
botId) (\s :: BatchUpdateCustomVocabularyItemResponse
s@BatchUpdateCustomVocabularyItemResponse' {} Maybe Text
a -> BatchUpdateCustomVocabularyItemResponse
s {$sel:botId:BatchUpdateCustomVocabularyItemResponse' :: Maybe Text
botId = Maybe Text
a} :: BatchUpdateCustomVocabularyItemResponse)

-- | The bot version of the bot to the batch update response for the custom
-- vocabulary item.
batchUpdateCustomVocabularyItemResponse_botVersion :: Lens.Lens' BatchUpdateCustomVocabularyItemResponse (Prelude.Maybe Prelude.Text)
batchUpdateCustomVocabularyItemResponse_botVersion :: Lens' BatchUpdateCustomVocabularyItemResponse (Maybe Text)
batchUpdateCustomVocabularyItemResponse_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateCustomVocabularyItemResponse' {Maybe Text
botVersion :: Maybe Text
$sel:botVersion:BatchUpdateCustomVocabularyItemResponse' :: BatchUpdateCustomVocabularyItemResponse -> Maybe Text
botVersion} -> Maybe Text
botVersion) (\s :: BatchUpdateCustomVocabularyItemResponse
s@BatchUpdateCustomVocabularyItemResponse' {} Maybe Text
a -> BatchUpdateCustomVocabularyItemResponse
s {$sel:botVersion:BatchUpdateCustomVocabularyItemResponse' :: Maybe Text
botVersion = Maybe Text
a} :: BatchUpdateCustomVocabularyItemResponse)

-- | The errors of the action to batch update response for the custom
-- vocabulary item.
batchUpdateCustomVocabularyItemResponse_errors :: Lens.Lens' BatchUpdateCustomVocabularyItemResponse (Prelude.Maybe [FailedCustomVocabularyItem])
batchUpdateCustomVocabularyItemResponse_errors :: Lens'
  BatchUpdateCustomVocabularyItemResponse
  (Maybe [FailedCustomVocabularyItem])
batchUpdateCustomVocabularyItemResponse_errors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateCustomVocabularyItemResponse' {Maybe [FailedCustomVocabularyItem]
errors :: Maybe [FailedCustomVocabularyItem]
$sel:errors:BatchUpdateCustomVocabularyItemResponse' :: BatchUpdateCustomVocabularyItemResponse
-> Maybe [FailedCustomVocabularyItem]
errors} -> Maybe [FailedCustomVocabularyItem]
errors) (\s :: BatchUpdateCustomVocabularyItemResponse
s@BatchUpdateCustomVocabularyItemResponse' {} Maybe [FailedCustomVocabularyItem]
a -> BatchUpdateCustomVocabularyItemResponse
s {$sel:errors:BatchUpdateCustomVocabularyItemResponse' :: Maybe [FailedCustomVocabularyItem]
errors = Maybe [FailedCustomVocabularyItem]
a} :: BatchUpdateCustomVocabularyItemResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The locale identifier of the bot to the batch update response for the
-- custom vocabulary item.
batchUpdateCustomVocabularyItemResponse_localeId :: Lens.Lens' BatchUpdateCustomVocabularyItemResponse (Prelude.Maybe Prelude.Text)
batchUpdateCustomVocabularyItemResponse_localeId :: Lens' BatchUpdateCustomVocabularyItemResponse (Maybe Text)
batchUpdateCustomVocabularyItemResponse_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateCustomVocabularyItemResponse' {Maybe Text
localeId :: Maybe Text
$sel:localeId:BatchUpdateCustomVocabularyItemResponse' :: BatchUpdateCustomVocabularyItemResponse -> Maybe Text
localeId} -> Maybe Text
localeId) (\s :: BatchUpdateCustomVocabularyItemResponse
s@BatchUpdateCustomVocabularyItemResponse' {} Maybe Text
a -> BatchUpdateCustomVocabularyItemResponse
s {$sel:localeId:BatchUpdateCustomVocabularyItemResponse' :: Maybe Text
localeId = Maybe Text
a} :: BatchUpdateCustomVocabularyItemResponse)

-- | The resources of the action to batch update response for the custom
-- vocabulary item.
batchUpdateCustomVocabularyItemResponse_resources :: Lens.Lens' BatchUpdateCustomVocabularyItemResponse (Prelude.Maybe [CustomVocabularyItem])
batchUpdateCustomVocabularyItemResponse_resources :: Lens'
  BatchUpdateCustomVocabularyItemResponse
  (Maybe [CustomVocabularyItem])
batchUpdateCustomVocabularyItemResponse_resources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateCustomVocabularyItemResponse' {Maybe [CustomVocabularyItem]
resources :: Maybe [CustomVocabularyItem]
$sel:resources:BatchUpdateCustomVocabularyItemResponse' :: BatchUpdateCustomVocabularyItemResponse
-> Maybe [CustomVocabularyItem]
resources} -> Maybe [CustomVocabularyItem]
resources) (\s :: BatchUpdateCustomVocabularyItemResponse
s@BatchUpdateCustomVocabularyItemResponse' {} Maybe [CustomVocabularyItem]
a -> BatchUpdateCustomVocabularyItemResponse
s {$sel:resources:BatchUpdateCustomVocabularyItemResponse' :: Maybe [CustomVocabularyItem]
resources = Maybe [CustomVocabularyItem]
a} :: BatchUpdateCustomVocabularyItemResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    BatchUpdateCustomVocabularyItemResponse
  where
  rnf :: BatchUpdateCustomVocabularyItemResponse -> ()
rnf BatchUpdateCustomVocabularyItemResponse' {Int
Maybe [CustomVocabularyItem]
Maybe [FailedCustomVocabularyItem]
Maybe Text
httpStatus :: Int
resources :: Maybe [CustomVocabularyItem]
localeId :: Maybe Text
errors :: Maybe [FailedCustomVocabularyItem]
botVersion :: Maybe Text
botId :: Maybe Text
$sel:httpStatus:BatchUpdateCustomVocabularyItemResponse' :: BatchUpdateCustomVocabularyItemResponse -> Int
$sel:resources:BatchUpdateCustomVocabularyItemResponse' :: BatchUpdateCustomVocabularyItemResponse
-> Maybe [CustomVocabularyItem]
$sel:localeId:BatchUpdateCustomVocabularyItemResponse' :: BatchUpdateCustomVocabularyItemResponse -> Maybe Text
$sel:errors:BatchUpdateCustomVocabularyItemResponse' :: BatchUpdateCustomVocabularyItemResponse
-> Maybe [FailedCustomVocabularyItem]
$sel:botVersion:BatchUpdateCustomVocabularyItemResponse' :: BatchUpdateCustomVocabularyItemResponse -> Maybe Text
$sel:botId:BatchUpdateCustomVocabularyItemResponse' :: BatchUpdateCustomVocabularyItemResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [FailedCustomVocabularyItem]
errors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
localeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [CustomVocabularyItem]
resources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus