{-# 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.Comprehend.BatchDetectEntities
-- 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)
--
-- Inspects the text of a batch of documents for named entities and returns
-- information about them. For more information about named entities, see
-- how-entities
module Amazonka.Comprehend.BatchDetectEntities
  ( -- * Creating a Request
    BatchDetectEntities (..),
    newBatchDetectEntities,

    -- * Request Lenses
    batchDetectEntities_textList,
    batchDetectEntities_languageCode,

    -- * Destructuring the Response
    BatchDetectEntitiesResponse (..),
    newBatchDetectEntitiesResponse,

    -- * Response Lenses
    batchDetectEntitiesResponse_httpStatus,
    batchDetectEntitiesResponse_resultList,
    batchDetectEntitiesResponse_errorList,
  )
where

import Amazonka.Comprehend.Types
import qualified Amazonka.Core as Core
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:/ 'newBatchDetectEntities' smart constructor.
data BatchDetectEntities = BatchDetectEntities'
  { -- | A list containing the text of the input documents. The list can contain
    -- a maximum of 25 documents. Each document must contain fewer than 5,000
    -- bytes of UTF-8 encoded characters.
    BatchDetectEntities -> Sensitive [Sensitive Text]
textList :: Core.Sensitive [Core.Sensitive Prelude.Text],
    -- | The language of the input documents. You can specify any of the primary
    -- languages supported by Amazon Comprehend. All documents must be in the
    -- same language.
    BatchDetectEntities -> LanguageCode
languageCode :: LanguageCode
  }
  deriving (BatchDetectEntities -> BatchDetectEntities -> Bool
(BatchDetectEntities -> BatchDetectEntities -> Bool)
-> (BatchDetectEntities -> BatchDetectEntities -> Bool)
-> Eq BatchDetectEntities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDetectEntities -> BatchDetectEntities -> Bool
$c/= :: BatchDetectEntities -> BatchDetectEntities -> Bool
== :: BatchDetectEntities -> BatchDetectEntities -> Bool
$c== :: BatchDetectEntities -> BatchDetectEntities -> Bool
Prelude.Eq, Int -> BatchDetectEntities -> ShowS
[BatchDetectEntities] -> ShowS
BatchDetectEntities -> String
(Int -> BatchDetectEntities -> ShowS)
-> (BatchDetectEntities -> String)
-> ([BatchDetectEntities] -> ShowS)
-> Show BatchDetectEntities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDetectEntities] -> ShowS
$cshowList :: [BatchDetectEntities] -> ShowS
show :: BatchDetectEntities -> String
$cshow :: BatchDetectEntities -> String
showsPrec :: Int -> BatchDetectEntities -> ShowS
$cshowsPrec :: Int -> BatchDetectEntities -> ShowS
Prelude.Show, (forall x. BatchDetectEntities -> Rep BatchDetectEntities x)
-> (forall x. Rep BatchDetectEntities x -> BatchDetectEntities)
-> Generic BatchDetectEntities
forall x. Rep BatchDetectEntities x -> BatchDetectEntities
forall x. BatchDetectEntities -> Rep BatchDetectEntities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchDetectEntities x -> BatchDetectEntities
$cfrom :: forall x. BatchDetectEntities -> Rep BatchDetectEntities x
Prelude.Generic)

-- |
-- Create a value of 'BatchDetectEntities' 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:
--
-- 'textList', 'batchDetectEntities_textList' - A list containing the text of the input documents. The list can contain
-- a maximum of 25 documents. Each document must contain fewer than 5,000
-- bytes of UTF-8 encoded characters.
--
-- 'languageCode', 'batchDetectEntities_languageCode' - The language of the input documents. You can specify any of the primary
-- languages supported by Amazon Comprehend. All documents must be in the
-- same language.
newBatchDetectEntities ::
  -- | 'languageCode'
  LanguageCode ->
  BatchDetectEntities
newBatchDetectEntities :: LanguageCode -> BatchDetectEntities
newBatchDetectEntities LanguageCode
pLanguageCode_ =
  BatchDetectEntities' :: Sensitive [Sensitive Text] -> LanguageCode -> BatchDetectEntities
BatchDetectEntities'
    { $sel:textList:BatchDetectEntities' :: Sensitive [Sensitive Text]
textList = Sensitive [Sensitive Text]
forall a. Monoid a => a
Prelude.mempty,
      $sel:languageCode:BatchDetectEntities' :: LanguageCode
languageCode = LanguageCode
pLanguageCode_
    }

-- | A list containing the text of the input documents. The list can contain
-- a maximum of 25 documents. Each document must contain fewer than 5,000
-- bytes of UTF-8 encoded characters.
batchDetectEntities_textList :: Lens.Lens' BatchDetectEntities [Prelude.Text]
batchDetectEntities_textList :: ([Text] -> f [Text])
-> BatchDetectEntities -> f BatchDetectEntities
batchDetectEntities_textList = (BatchDetectEntities -> Sensitive [Sensitive Text])
-> (BatchDetectEntities
    -> Sensitive [Sensitive Text] -> BatchDetectEntities)
-> Lens
     BatchDetectEntities
     BatchDetectEntities
     (Sensitive [Sensitive Text])
     (Sensitive [Sensitive Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetectEntities' {Sensitive [Sensitive Text]
textList :: Sensitive [Sensitive Text]
$sel:textList:BatchDetectEntities' :: BatchDetectEntities -> Sensitive [Sensitive Text]
textList} -> Sensitive [Sensitive Text]
textList) (\s :: BatchDetectEntities
s@BatchDetectEntities' {} Sensitive [Sensitive Text]
a -> BatchDetectEntities
s {$sel:textList:BatchDetectEntities' :: Sensitive [Sensitive Text]
textList = Sensitive [Sensitive Text]
a} :: BatchDetectEntities) ((Sensitive [Sensitive Text] -> f (Sensitive [Sensitive Text]))
 -> BatchDetectEntities -> f BatchDetectEntities)
-> (([Text] -> f [Text])
    -> Sensitive [Sensitive Text] -> f (Sensitive [Sensitive Text]))
-> ([Text] -> f [Text])
-> BatchDetectEntities
-> f BatchDetectEntities
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Sensitive Text] -> f [Sensitive Text])
-> Sensitive [Sensitive Text] -> f (Sensitive [Sensitive Text])
forall a. Iso' (Sensitive a) a
Core._Sensitive (([Sensitive Text] -> f [Sensitive Text])
 -> Sensitive [Sensitive Text] -> f (Sensitive [Sensitive Text]))
-> (([Text] -> f [Text]) -> [Sensitive Text] -> f [Sensitive Text])
-> ([Text] -> f [Text])
-> Sensitive [Sensitive Text]
-> f (Sensitive [Sensitive Text])
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Sensitive Text] -> f [Sensitive Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The language of the input documents. You can specify any of the primary
-- languages supported by Amazon Comprehend. All documents must be in the
-- same language.
batchDetectEntities_languageCode :: Lens.Lens' BatchDetectEntities LanguageCode
batchDetectEntities_languageCode :: (LanguageCode -> f LanguageCode)
-> BatchDetectEntities -> f BatchDetectEntities
batchDetectEntities_languageCode = (BatchDetectEntities -> LanguageCode)
-> (BatchDetectEntities -> LanguageCode -> BatchDetectEntities)
-> Lens
     BatchDetectEntities BatchDetectEntities LanguageCode LanguageCode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetectEntities' {LanguageCode
languageCode :: LanguageCode
$sel:languageCode:BatchDetectEntities' :: BatchDetectEntities -> LanguageCode
languageCode} -> LanguageCode
languageCode) (\s :: BatchDetectEntities
s@BatchDetectEntities' {} LanguageCode
a -> BatchDetectEntities
s {$sel:languageCode:BatchDetectEntities' :: LanguageCode
languageCode = LanguageCode
a} :: BatchDetectEntities)

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

instance Prelude.Hashable BatchDetectEntities

instance Prelude.NFData BatchDetectEntities

instance Core.ToHeaders BatchDetectEntities where
  toHeaders :: BatchDetectEntities -> ResponseHeaders
toHeaders =
    ResponseHeaders -> BatchDetectEntities -> 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
"Comprehend_20171127.BatchDetectEntities" ::
                          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 BatchDetectEntities where
  toJSON :: BatchDetectEntities -> Value
toJSON BatchDetectEntities' {Sensitive [Sensitive Text]
LanguageCode
languageCode :: LanguageCode
textList :: Sensitive [Sensitive Text]
$sel:languageCode:BatchDetectEntities' :: BatchDetectEntities -> LanguageCode
$sel:textList:BatchDetectEntities' :: BatchDetectEntities -> Sensitive [Sensitive Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TextList" Text -> Sensitive [Sensitive Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive [Sensitive Text]
textList),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LanguageCode" Text -> LanguageCode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= LanguageCode
languageCode)
          ]
      )

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

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

-- | /See:/ 'newBatchDetectEntitiesResponse' smart constructor.
data BatchDetectEntitiesResponse = BatchDetectEntitiesResponse'
  { -- | The response's http status code.
    BatchDetectEntitiesResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of objects containing the results of the operation. The results
    -- are sorted in ascending order by the @Index@ field and match the order
    -- of the documents in the input list. If all of the documents contain an
    -- error, the @ResultList@ is empty.
    BatchDetectEntitiesResponse -> [BatchDetectEntitiesItemResult]
resultList :: [BatchDetectEntitiesItemResult],
    -- | A list containing one object for each document that contained an error.
    -- The results are sorted in ascending order by the @Index@ field and match
    -- the order of the documents in the input list. If there are no errors in
    -- the batch, the @ErrorList@ is empty.
    BatchDetectEntitiesResponse -> [BatchItemError]
errorList :: [BatchItemError]
  }
  deriving (BatchDetectEntitiesResponse -> BatchDetectEntitiesResponse -> Bool
(BatchDetectEntitiesResponse
 -> BatchDetectEntitiesResponse -> Bool)
-> (BatchDetectEntitiesResponse
    -> BatchDetectEntitiesResponse -> Bool)
-> Eq BatchDetectEntitiesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDetectEntitiesResponse -> BatchDetectEntitiesResponse -> Bool
$c/= :: BatchDetectEntitiesResponse -> BatchDetectEntitiesResponse -> Bool
== :: BatchDetectEntitiesResponse -> BatchDetectEntitiesResponse -> Bool
$c== :: BatchDetectEntitiesResponse -> BatchDetectEntitiesResponse -> Bool
Prelude.Eq, Int -> BatchDetectEntitiesResponse -> ShowS
[BatchDetectEntitiesResponse] -> ShowS
BatchDetectEntitiesResponse -> String
(Int -> BatchDetectEntitiesResponse -> ShowS)
-> (BatchDetectEntitiesResponse -> String)
-> ([BatchDetectEntitiesResponse] -> ShowS)
-> Show BatchDetectEntitiesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDetectEntitiesResponse] -> ShowS
$cshowList :: [BatchDetectEntitiesResponse] -> ShowS
show :: BatchDetectEntitiesResponse -> String
$cshow :: BatchDetectEntitiesResponse -> String
showsPrec :: Int -> BatchDetectEntitiesResponse -> ShowS
$cshowsPrec :: Int -> BatchDetectEntitiesResponse -> ShowS
Prelude.Show, (forall x.
 BatchDetectEntitiesResponse -> Rep BatchDetectEntitiesResponse x)
-> (forall x.
    Rep BatchDetectEntitiesResponse x -> BatchDetectEntitiesResponse)
-> Generic BatchDetectEntitiesResponse
forall x.
Rep BatchDetectEntitiesResponse x -> BatchDetectEntitiesResponse
forall x.
BatchDetectEntitiesResponse -> Rep BatchDetectEntitiesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchDetectEntitiesResponse x -> BatchDetectEntitiesResponse
$cfrom :: forall x.
BatchDetectEntitiesResponse -> Rep BatchDetectEntitiesResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchDetectEntitiesResponse' 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:
--
-- 'httpStatus', 'batchDetectEntitiesResponse_httpStatus' - The response's http status code.
--
-- 'resultList', 'batchDetectEntitiesResponse_resultList' - A list of objects containing the results of the operation. The results
-- are sorted in ascending order by the @Index@ field and match the order
-- of the documents in the input list. If all of the documents contain an
-- error, the @ResultList@ is empty.
--
-- 'errorList', 'batchDetectEntitiesResponse_errorList' - A list containing one object for each document that contained an error.
-- The results are sorted in ascending order by the @Index@ field and match
-- the order of the documents in the input list. If there are no errors in
-- the batch, the @ErrorList@ is empty.
newBatchDetectEntitiesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchDetectEntitiesResponse
newBatchDetectEntitiesResponse :: Int -> BatchDetectEntitiesResponse
newBatchDetectEntitiesResponse Int
pHttpStatus_ =
  BatchDetectEntitiesResponse' :: Int
-> [BatchDetectEntitiesItemResult]
-> [BatchItemError]
-> BatchDetectEntitiesResponse
BatchDetectEntitiesResponse'
    { $sel:httpStatus:BatchDetectEntitiesResponse' :: Int
httpStatus =
        Int
pHttpStatus_,
      $sel:resultList:BatchDetectEntitiesResponse' :: [BatchDetectEntitiesItemResult]
resultList = [BatchDetectEntitiesItemResult]
forall a. Monoid a => a
Prelude.mempty,
      $sel:errorList:BatchDetectEntitiesResponse' :: [BatchItemError]
errorList = [BatchItemError]
forall a. Monoid a => a
Prelude.mempty
    }

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

-- | A list of objects containing the results of the operation. The results
-- are sorted in ascending order by the @Index@ field and match the order
-- of the documents in the input list. If all of the documents contain an
-- error, the @ResultList@ is empty.
batchDetectEntitiesResponse_resultList :: Lens.Lens' BatchDetectEntitiesResponse [BatchDetectEntitiesItemResult]
batchDetectEntitiesResponse_resultList :: ([BatchDetectEntitiesItemResult]
 -> f [BatchDetectEntitiesItemResult])
-> BatchDetectEntitiesResponse -> f BatchDetectEntitiesResponse
batchDetectEntitiesResponse_resultList = (BatchDetectEntitiesResponse -> [BatchDetectEntitiesItemResult])
-> (BatchDetectEntitiesResponse
    -> [BatchDetectEntitiesItemResult] -> BatchDetectEntitiesResponse)
-> Lens
     BatchDetectEntitiesResponse
     BatchDetectEntitiesResponse
     [BatchDetectEntitiesItemResult]
     [BatchDetectEntitiesItemResult]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetectEntitiesResponse' {[BatchDetectEntitiesItemResult]
resultList :: [BatchDetectEntitiesItemResult]
$sel:resultList:BatchDetectEntitiesResponse' :: BatchDetectEntitiesResponse -> [BatchDetectEntitiesItemResult]
resultList} -> [BatchDetectEntitiesItemResult]
resultList) (\s :: BatchDetectEntitiesResponse
s@BatchDetectEntitiesResponse' {} [BatchDetectEntitiesItemResult]
a -> BatchDetectEntitiesResponse
s {$sel:resultList:BatchDetectEntitiesResponse' :: [BatchDetectEntitiesItemResult]
resultList = [BatchDetectEntitiesItemResult]
a} :: BatchDetectEntitiesResponse) (([BatchDetectEntitiesItemResult]
  -> f [BatchDetectEntitiesItemResult])
 -> BatchDetectEntitiesResponse -> f BatchDetectEntitiesResponse)
-> (([BatchDetectEntitiesItemResult]
     -> f [BatchDetectEntitiesItemResult])
    -> [BatchDetectEntitiesItemResult]
    -> f [BatchDetectEntitiesItemResult])
-> ([BatchDetectEntitiesItemResult]
    -> f [BatchDetectEntitiesItemResult])
-> BatchDetectEntitiesResponse
-> f BatchDetectEntitiesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BatchDetectEntitiesItemResult]
 -> f [BatchDetectEntitiesItemResult])
-> [BatchDetectEntitiesItemResult]
-> f [BatchDetectEntitiesItemResult]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list containing one object for each document that contained an error.
-- The results are sorted in ascending order by the @Index@ field and match
-- the order of the documents in the input list. If there are no errors in
-- the batch, the @ErrorList@ is empty.
batchDetectEntitiesResponse_errorList :: Lens.Lens' BatchDetectEntitiesResponse [BatchItemError]
batchDetectEntitiesResponse_errorList :: ([BatchItemError] -> f [BatchItemError])
-> BatchDetectEntitiesResponse -> f BatchDetectEntitiesResponse
batchDetectEntitiesResponse_errorList = (BatchDetectEntitiesResponse -> [BatchItemError])
-> (BatchDetectEntitiesResponse
    -> [BatchItemError] -> BatchDetectEntitiesResponse)
-> Lens
     BatchDetectEntitiesResponse
     BatchDetectEntitiesResponse
     [BatchItemError]
     [BatchItemError]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetectEntitiesResponse' {[BatchItemError]
errorList :: [BatchItemError]
$sel:errorList:BatchDetectEntitiesResponse' :: BatchDetectEntitiesResponse -> [BatchItemError]
errorList} -> [BatchItemError]
errorList) (\s :: BatchDetectEntitiesResponse
s@BatchDetectEntitiesResponse' {} [BatchItemError]
a -> BatchDetectEntitiesResponse
s {$sel:errorList:BatchDetectEntitiesResponse' :: [BatchItemError]
errorList = [BatchItemError]
a} :: BatchDetectEntitiesResponse) (([BatchItemError] -> f [BatchItemError])
 -> BatchDetectEntitiesResponse -> f BatchDetectEntitiesResponse)
-> (([BatchItemError] -> f [BatchItemError])
    -> [BatchItemError] -> f [BatchItemError])
-> ([BatchItemError] -> f [BatchItemError])
-> BatchDetectEntitiesResponse
-> f BatchDetectEntitiesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BatchItemError] -> f [BatchItemError])
-> [BatchItemError] -> f [BatchItemError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData BatchDetectEntitiesResponse