{-# 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.BatchDetectSentiment
-- 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 a batch of documents and returns an inference of the prevailing
-- sentiment, @POSITIVE@, @NEUTRAL@, @MIXED@, or @NEGATIVE@, in each one.
module Amazonka.Comprehend.BatchDetectSentiment
  ( -- * Creating a Request
    BatchDetectSentiment (..),
    newBatchDetectSentiment,

    -- * Request Lenses
    batchDetectSentiment_textList,
    batchDetectSentiment_languageCode,

    -- * Destructuring the Response
    BatchDetectSentimentResponse (..),
    newBatchDetectSentimentResponse,

    -- * Response Lenses
    batchDetectSentimentResponse_httpStatus,
    batchDetectSentimentResponse_resultList,
    batchDetectSentimentResponse_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:/ 'newBatchDetectSentiment' smart constructor.
data BatchDetectSentiment = BatchDetectSentiment'
  { -- | A list containing the text of the input documents. The list can contain
    -- a maximum of 25 documents. Each document must contain fewer that 5,000
    -- bytes of UTF-8 encoded characters.
    BatchDetectSentiment -> 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.
    BatchDetectSentiment -> LanguageCode
languageCode :: LanguageCode
  }
  deriving (BatchDetectSentiment -> BatchDetectSentiment -> Bool
(BatchDetectSentiment -> BatchDetectSentiment -> Bool)
-> (BatchDetectSentiment -> BatchDetectSentiment -> Bool)
-> Eq BatchDetectSentiment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDetectSentiment -> BatchDetectSentiment -> Bool
$c/= :: BatchDetectSentiment -> BatchDetectSentiment -> Bool
== :: BatchDetectSentiment -> BatchDetectSentiment -> Bool
$c== :: BatchDetectSentiment -> BatchDetectSentiment -> Bool
Prelude.Eq, Int -> BatchDetectSentiment -> ShowS
[BatchDetectSentiment] -> ShowS
BatchDetectSentiment -> String
(Int -> BatchDetectSentiment -> ShowS)
-> (BatchDetectSentiment -> String)
-> ([BatchDetectSentiment] -> ShowS)
-> Show BatchDetectSentiment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDetectSentiment] -> ShowS
$cshowList :: [BatchDetectSentiment] -> ShowS
show :: BatchDetectSentiment -> String
$cshow :: BatchDetectSentiment -> String
showsPrec :: Int -> BatchDetectSentiment -> ShowS
$cshowsPrec :: Int -> BatchDetectSentiment -> ShowS
Prelude.Show, (forall x. BatchDetectSentiment -> Rep BatchDetectSentiment x)
-> (forall x. Rep BatchDetectSentiment x -> BatchDetectSentiment)
-> Generic BatchDetectSentiment
forall x. Rep BatchDetectSentiment x -> BatchDetectSentiment
forall x. BatchDetectSentiment -> Rep BatchDetectSentiment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchDetectSentiment x -> BatchDetectSentiment
$cfrom :: forall x. BatchDetectSentiment -> Rep BatchDetectSentiment x
Prelude.Generic)

-- |
-- Create a value of 'BatchDetectSentiment' 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', 'batchDetectSentiment_textList' - A list containing the text of the input documents. The list can contain
-- a maximum of 25 documents. Each document must contain fewer that 5,000
-- bytes of UTF-8 encoded characters.
--
-- 'languageCode', 'batchDetectSentiment_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.
newBatchDetectSentiment ::
  -- | 'languageCode'
  LanguageCode ->
  BatchDetectSentiment
newBatchDetectSentiment :: LanguageCode -> BatchDetectSentiment
newBatchDetectSentiment LanguageCode
pLanguageCode_ =
  BatchDetectSentiment' :: Sensitive [Sensitive Text] -> LanguageCode -> BatchDetectSentiment
BatchDetectSentiment'
    { $sel:textList:BatchDetectSentiment' :: Sensitive [Sensitive Text]
textList = Sensitive [Sensitive Text]
forall a. Monoid a => a
Prelude.mempty,
      $sel:languageCode:BatchDetectSentiment' :: 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 that 5,000
-- bytes of UTF-8 encoded characters.
batchDetectSentiment_textList :: Lens.Lens' BatchDetectSentiment [Prelude.Text]
batchDetectSentiment_textList :: ([Text] -> f [Text])
-> BatchDetectSentiment -> f BatchDetectSentiment
batchDetectSentiment_textList = (BatchDetectSentiment -> Sensitive [Sensitive Text])
-> (BatchDetectSentiment
    -> Sensitive [Sensitive Text] -> BatchDetectSentiment)
-> Lens
     BatchDetectSentiment
     BatchDetectSentiment
     (Sensitive [Sensitive Text])
     (Sensitive [Sensitive Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetectSentiment' {Sensitive [Sensitive Text]
textList :: Sensitive [Sensitive Text]
$sel:textList:BatchDetectSentiment' :: BatchDetectSentiment -> Sensitive [Sensitive Text]
textList} -> Sensitive [Sensitive Text]
textList) (\s :: BatchDetectSentiment
s@BatchDetectSentiment' {} Sensitive [Sensitive Text]
a -> BatchDetectSentiment
s {$sel:textList:BatchDetectSentiment' :: Sensitive [Sensitive Text]
textList = Sensitive [Sensitive Text]
a} :: BatchDetectSentiment) ((Sensitive [Sensitive Text] -> f (Sensitive [Sensitive Text]))
 -> BatchDetectSentiment -> f BatchDetectSentiment)
-> (([Text] -> f [Text])
    -> Sensitive [Sensitive Text] -> f (Sensitive [Sensitive Text]))
-> ([Text] -> f [Text])
-> BatchDetectSentiment
-> f BatchDetectSentiment
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.
batchDetectSentiment_languageCode :: Lens.Lens' BatchDetectSentiment LanguageCode
batchDetectSentiment_languageCode :: (LanguageCode -> f LanguageCode)
-> BatchDetectSentiment -> f BatchDetectSentiment
batchDetectSentiment_languageCode = (BatchDetectSentiment -> LanguageCode)
-> (BatchDetectSentiment -> LanguageCode -> BatchDetectSentiment)
-> Lens
     BatchDetectSentiment BatchDetectSentiment LanguageCode LanguageCode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetectSentiment' {LanguageCode
languageCode :: LanguageCode
$sel:languageCode:BatchDetectSentiment' :: BatchDetectSentiment -> LanguageCode
languageCode} -> LanguageCode
languageCode) (\s :: BatchDetectSentiment
s@BatchDetectSentiment' {} LanguageCode
a -> BatchDetectSentiment
s {$sel:languageCode:BatchDetectSentiment' :: LanguageCode
languageCode = LanguageCode
a} :: BatchDetectSentiment)

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

instance Prelude.NFData BatchDetectSentiment

instance Core.ToHeaders BatchDetectSentiment where
  toHeaders :: BatchDetectSentiment -> ResponseHeaders
toHeaders =
    ResponseHeaders -> BatchDetectSentiment -> 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.BatchDetectSentiment" ::
                          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 BatchDetectSentiment where
  toJSON :: BatchDetectSentiment -> Value
toJSON BatchDetectSentiment' {Sensitive [Sensitive Text]
LanguageCode
languageCode :: LanguageCode
textList :: Sensitive [Sensitive Text]
$sel:languageCode:BatchDetectSentiment' :: BatchDetectSentiment -> LanguageCode
$sel:textList:BatchDetectSentiment' :: BatchDetectSentiment -> 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 BatchDetectSentiment where
  toPath :: BatchDetectSentiment -> ByteString
toPath = ByteString -> BatchDetectSentiment -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newBatchDetectSentimentResponse' smart constructor.
data BatchDetectSentimentResponse = BatchDetectSentimentResponse'
  { -- | The response's http status code.
    BatchDetectSentimentResponse -> 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.
    BatchDetectSentimentResponse -> [BatchDetectSentimentItemResult]
resultList :: [BatchDetectSentimentItemResult],
    -- | 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.
    BatchDetectSentimentResponse -> [BatchItemError]
errorList :: [BatchItemError]
  }
  deriving (BatchDetectSentimentResponse
-> BatchDetectSentimentResponse -> Bool
(BatchDetectSentimentResponse
 -> BatchDetectSentimentResponse -> Bool)
-> (BatchDetectSentimentResponse
    -> BatchDetectSentimentResponse -> Bool)
-> Eq BatchDetectSentimentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDetectSentimentResponse
-> BatchDetectSentimentResponse -> Bool
$c/= :: BatchDetectSentimentResponse
-> BatchDetectSentimentResponse -> Bool
== :: BatchDetectSentimentResponse
-> BatchDetectSentimentResponse -> Bool
$c== :: BatchDetectSentimentResponse
-> BatchDetectSentimentResponse -> Bool
Prelude.Eq, Int -> BatchDetectSentimentResponse -> ShowS
[BatchDetectSentimentResponse] -> ShowS
BatchDetectSentimentResponse -> String
(Int -> BatchDetectSentimentResponse -> ShowS)
-> (BatchDetectSentimentResponse -> String)
-> ([BatchDetectSentimentResponse] -> ShowS)
-> Show BatchDetectSentimentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDetectSentimentResponse] -> ShowS
$cshowList :: [BatchDetectSentimentResponse] -> ShowS
show :: BatchDetectSentimentResponse -> String
$cshow :: BatchDetectSentimentResponse -> String
showsPrec :: Int -> BatchDetectSentimentResponse -> ShowS
$cshowsPrec :: Int -> BatchDetectSentimentResponse -> ShowS
Prelude.Show, (forall x.
 BatchDetectSentimentResponse -> Rep BatchDetectSentimentResponse x)
-> (forall x.
    Rep BatchDetectSentimentResponse x -> BatchDetectSentimentResponse)
-> Generic BatchDetectSentimentResponse
forall x.
Rep BatchDetectSentimentResponse x -> BatchDetectSentimentResponse
forall x.
BatchDetectSentimentResponse -> Rep BatchDetectSentimentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchDetectSentimentResponse x -> BatchDetectSentimentResponse
$cfrom :: forall x.
BatchDetectSentimentResponse -> Rep BatchDetectSentimentResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchDetectSentimentResponse' 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', 'batchDetectSentimentResponse_httpStatus' - The response's http status code.
--
-- 'resultList', 'batchDetectSentimentResponse_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', 'batchDetectSentimentResponse_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.
newBatchDetectSentimentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchDetectSentimentResponse
newBatchDetectSentimentResponse :: Int -> BatchDetectSentimentResponse
newBatchDetectSentimentResponse Int
pHttpStatus_ =
  BatchDetectSentimentResponse' :: Int
-> [BatchDetectSentimentItemResult]
-> [BatchItemError]
-> BatchDetectSentimentResponse
BatchDetectSentimentResponse'
    { $sel:httpStatus:BatchDetectSentimentResponse' :: Int
httpStatus =
        Int
pHttpStatus_,
      $sel:resultList:BatchDetectSentimentResponse' :: [BatchDetectSentimentItemResult]
resultList = [BatchDetectSentimentItemResult]
forall a. Monoid a => a
Prelude.mempty,
      $sel:errorList:BatchDetectSentimentResponse' :: [BatchItemError]
errorList = [BatchItemError]
forall a. Monoid a => a
Prelude.mempty
    }

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

-- | 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.
batchDetectSentimentResponse_resultList :: Lens.Lens' BatchDetectSentimentResponse [BatchDetectSentimentItemResult]
batchDetectSentimentResponse_resultList :: ([BatchDetectSentimentItemResult]
 -> f [BatchDetectSentimentItemResult])
-> BatchDetectSentimentResponse -> f BatchDetectSentimentResponse
batchDetectSentimentResponse_resultList = (BatchDetectSentimentResponse -> [BatchDetectSentimentItemResult])
-> (BatchDetectSentimentResponse
    -> [BatchDetectSentimentItemResult]
    -> BatchDetectSentimentResponse)
-> Lens
     BatchDetectSentimentResponse
     BatchDetectSentimentResponse
     [BatchDetectSentimentItemResult]
     [BatchDetectSentimentItemResult]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetectSentimentResponse' {[BatchDetectSentimentItemResult]
resultList :: [BatchDetectSentimentItemResult]
$sel:resultList:BatchDetectSentimentResponse' :: BatchDetectSentimentResponse -> [BatchDetectSentimentItemResult]
resultList} -> [BatchDetectSentimentItemResult]
resultList) (\s :: BatchDetectSentimentResponse
s@BatchDetectSentimentResponse' {} [BatchDetectSentimentItemResult]
a -> BatchDetectSentimentResponse
s {$sel:resultList:BatchDetectSentimentResponse' :: [BatchDetectSentimentItemResult]
resultList = [BatchDetectSentimentItemResult]
a} :: BatchDetectSentimentResponse) (([BatchDetectSentimentItemResult]
  -> f [BatchDetectSentimentItemResult])
 -> BatchDetectSentimentResponse -> f BatchDetectSentimentResponse)
-> (([BatchDetectSentimentItemResult]
     -> f [BatchDetectSentimentItemResult])
    -> [BatchDetectSentimentItemResult]
    -> f [BatchDetectSentimentItemResult])
-> ([BatchDetectSentimentItemResult]
    -> f [BatchDetectSentimentItemResult])
-> BatchDetectSentimentResponse
-> f BatchDetectSentimentResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BatchDetectSentimentItemResult]
 -> f [BatchDetectSentimentItemResult])
-> [BatchDetectSentimentItemResult]
-> f [BatchDetectSentimentItemResult]
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.
batchDetectSentimentResponse_errorList :: Lens.Lens' BatchDetectSentimentResponse [BatchItemError]
batchDetectSentimentResponse_errorList :: ([BatchItemError] -> f [BatchItemError])
-> BatchDetectSentimentResponse -> f BatchDetectSentimentResponse
batchDetectSentimentResponse_errorList = (BatchDetectSentimentResponse -> [BatchItemError])
-> (BatchDetectSentimentResponse
    -> [BatchItemError] -> BatchDetectSentimentResponse)
-> Lens
     BatchDetectSentimentResponse
     BatchDetectSentimentResponse
     [BatchItemError]
     [BatchItemError]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetectSentimentResponse' {[BatchItemError]
errorList :: [BatchItemError]
$sel:errorList:BatchDetectSentimentResponse' :: BatchDetectSentimentResponse -> [BatchItemError]
errorList} -> [BatchItemError]
errorList) (\s :: BatchDetectSentimentResponse
s@BatchDetectSentimentResponse' {} [BatchItemError]
a -> BatchDetectSentimentResponse
s {$sel:errorList:BatchDetectSentimentResponse' :: [BatchItemError]
errorList = [BatchItemError]
a} :: BatchDetectSentimentResponse) (([BatchItemError] -> f [BatchItemError])
 -> BatchDetectSentimentResponse -> f BatchDetectSentimentResponse)
-> (([BatchItemError] -> f [BatchItemError])
    -> [BatchItemError] -> f [BatchItemError])
-> ([BatchItemError] -> f [BatchItemError])
-> BatchDetectSentimentResponse
-> f BatchDetectSentimentResponse
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 BatchDetectSentimentResponse