{-# 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.BatchDetectDominantLanguage
-- 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)
--
-- Determines the dominant language of the input text for a batch of
-- documents. For a list of languages that Amazon Comprehend can detect,
-- see
-- <https://docs.aws.amazon.com/comprehend/latest/dg/how-languages.html Amazon Comprehend Supported Languages>.
module Amazonka.Comprehend.BatchDetectDominantLanguage
  ( -- * Creating a Request
    BatchDetectDominantLanguage (..),
    newBatchDetectDominantLanguage,

    -- * Request Lenses
    batchDetectDominantLanguage_textList,

    -- * Destructuring the Response
    BatchDetectDominantLanguageResponse (..),
    newBatchDetectDominantLanguageResponse,

    -- * Response Lenses
    batchDetectDominantLanguageResponse_httpStatus,
    batchDetectDominantLanguageResponse_resultList,
    batchDetectDominantLanguageResponse_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:/ 'newBatchDetectDominantLanguage' smart constructor.
data BatchDetectDominantLanguage = BatchDetectDominantLanguage'
  { -- | A list containing the text of the input documents. The list can contain
    -- a maximum of 25 documents. Each document should contain at least 20
    -- characters and must contain fewer than 5,000 bytes of UTF-8 encoded
    -- characters.
    BatchDetectDominantLanguage -> Sensitive [Sensitive Text]
textList :: Core.Sensitive [Core.Sensitive Prelude.Text]
  }
  deriving (BatchDetectDominantLanguage -> BatchDetectDominantLanguage -> Bool
(BatchDetectDominantLanguage
 -> BatchDetectDominantLanguage -> Bool)
-> (BatchDetectDominantLanguage
    -> BatchDetectDominantLanguage -> Bool)
-> Eq BatchDetectDominantLanguage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDetectDominantLanguage -> BatchDetectDominantLanguage -> Bool
$c/= :: BatchDetectDominantLanguage -> BatchDetectDominantLanguage -> Bool
== :: BatchDetectDominantLanguage -> BatchDetectDominantLanguage -> Bool
$c== :: BatchDetectDominantLanguage -> BatchDetectDominantLanguage -> Bool
Prelude.Eq, Int -> BatchDetectDominantLanguage -> ShowS
[BatchDetectDominantLanguage] -> ShowS
BatchDetectDominantLanguage -> String
(Int -> BatchDetectDominantLanguage -> ShowS)
-> (BatchDetectDominantLanguage -> String)
-> ([BatchDetectDominantLanguage] -> ShowS)
-> Show BatchDetectDominantLanguage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDetectDominantLanguage] -> ShowS
$cshowList :: [BatchDetectDominantLanguage] -> ShowS
show :: BatchDetectDominantLanguage -> String
$cshow :: BatchDetectDominantLanguage -> String
showsPrec :: Int -> BatchDetectDominantLanguage -> ShowS
$cshowsPrec :: Int -> BatchDetectDominantLanguage -> ShowS
Prelude.Show, (forall x.
 BatchDetectDominantLanguage -> Rep BatchDetectDominantLanguage x)
-> (forall x.
    Rep BatchDetectDominantLanguage x -> BatchDetectDominantLanguage)
-> Generic BatchDetectDominantLanguage
forall x.
Rep BatchDetectDominantLanguage x -> BatchDetectDominantLanguage
forall x.
BatchDetectDominantLanguage -> Rep BatchDetectDominantLanguage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchDetectDominantLanguage x -> BatchDetectDominantLanguage
$cfrom :: forall x.
BatchDetectDominantLanguage -> Rep BatchDetectDominantLanguage x
Prelude.Generic)

-- |
-- Create a value of 'BatchDetectDominantLanguage' 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', 'batchDetectDominantLanguage_textList' - A list containing the text of the input documents. The list can contain
-- a maximum of 25 documents. Each document should contain at least 20
-- characters and must contain fewer than 5,000 bytes of UTF-8 encoded
-- characters.
newBatchDetectDominantLanguage ::
  BatchDetectDominantLanguage
newBatchDetectDominantLanguage :: BatchDetectDominantLanguage
newBatchDetectDominantLanguage =
  BatchDetectDominantLanguage' :: Sensitive [Sensitive Text] -> BatchDetectDominantLanguage
BatchDetectDominantLanguage'
    { $sel:textList:BatchDetectDominantLanguage' :: Sensitive [Sensitive Text]
textList =
        Sensitive [Sensitive Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A list containing the text of the input documents. The list can contain
-- a maximum of 25 documents. Each document should contain at least 20
-- characters and must contain fewer than 5,000 bytes of UTF-8 encoded
-- characters.
batchDetectDominantLanguage_textList :: Lens.Lens' BatchDetectDominantLanguage [Prelude.Text]
batchDetectDominantLanguage_textList :: ([Text] -> f [Text])
-> BatchDetectDominantLanguage -> f BatchDetectDominantLanguage
batchDetectDominantLanguage_textList = (BatchDetectDominantLanguage -> Sensitive [Sensitive Text])
-> (BatchDetectDominantLanguage
    -> Sensitive [Sensitive Text] -> BatchDetectDominantLanguage)
-> Lens
     BatchDetectDominantLanguage
     BatchDetectDominantLanguage
     (Sensitive [Sensitive Text])
     (Sensitive [Sensitive Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetectDominantLanguage' {Sensitive [Sensitive Text]
textList :: Sensitive [Sensitive Text]
$sel:textList:BatchDetectDominantLanguage' :: BatchDetectDominantLanguage -> Sensitive [Sensitive Text]
textList} -> Sensitive [Sensitive Text]
textList) (\s :: BatchDetectDominantLanguage
s@BatchDetectDominantLanguage' {} Sensitive [Sensitive Text]
a -> BatchDetectDominantLanguage
s {$sel:textList:BatchDetectDominantLanguage' :: Sensitive [Sensitive Text]
textList = Sensitive [Sensitive Text]
a} :: BatchDetectDominantLanguage) ((Sensitive [Sensitive Text] -> f (Sensitive [Sensitive Text]))
 -> BatchDetectDominantLanguage -> f BatchDetectDominantLanguage)
-> (([Text] -> f [Text])
    -> Sensitive [Sensitive Text] -> f (Sensitive [Sensitive Text]))
-> ([Text] -> f [Text])
-> BatchDetectDominantLanguage
-> f BatchDetectDominantLanguage
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

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

instance Prelude.NFData BatchDetectDominantLanguage

instance Core.ToHeaders BatchDetectDominantLanguage where
  toHeaders :: BatchDetectDominantLanguage -> ResponseHeaders
toHeaders =
    ResponseHeaders -> BatchDetectDominantLanguage -> 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.BatchDetectDominantLanguage" ::
                          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 BatchDetectDominantLanguage where
  toJSON :: BatchDetectDominantLanguage -> Value
toJSON BatchDetectDominantLanguage' {Sensitive [Sensitive Text]
textList :: Sensitive [Sensitive Text]
$sel:textList:BatchDetectDominantLanguage' :: BatchDetectDominantLanguage -> 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)]
      )

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

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

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

-- |
-- Create a value of 'BatchDetectDominantLanguageResponse' 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', 'batchDetectDominantLanguageResponse_httpStatus' - The response's http status code.
--
-- 'resultList', 'batchDetectDominantLanguageResponse_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', 'batchDetectDominantLanguageResponse_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.
newBatchDetectDominantLanguageResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchDetectDominantLanguageResponse
newBatchDetectDominantLanguageResponse :: Int -> BatchDetectDominantLanguageResponse
newBatchDetectDominantLanguageResponse Int
pHttpStatus_ =
  BatchDetectDominantLanguageResponse' :: Int
-> [BatchDetectDominantLanguageItemResult]
-> [BatchItemError]
-> BatchDetectDominantLanguageResponse
BatchDetectDominantLanguageResponse'
    { $sel:httpStatus:BatchDetectDominantLanguageResponse' :: Int
httpStatus =
        Int
pHttpStatus_,
      $sel:resultList:BatchDetectDominantLanguageResponse' :: [BatchDetectDominantLanguageItemResult]
resultList = [BatchDetectDominantLanguageItemResult]
forall a. Monoid a => a
Prelude.mempty,
      $sel:errorList:BatchDetectDominantLanguageResponse' :: [BatchItemError]
errorList = [BatchItemError]
forall a. Monoid a => a
Prelude.mempty
    }

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

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