{-# 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.BatchDetectKeyPhrases
-- 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)
--
-- Detects the key noun phrases found in a batch of documents.
module Amazonka.Comprehend.BatchDetectKeyPhrases
  ( -- * Creating a Request
    BatchDetectKeyPhrases (..),
    newBatchDetectKeyPhrases,

    -- * Request Lenses
    batchDetectKeyPhrases_textList,
    batchDetectKeyPhrases_languageCode,

    -- * Destructuring the Response
    BatchDetectKeyPhrasesResponse (..),
    newBatchDetectKeyPhrasesResponse,

    -- * Response Lenses
    batchDetectKeyPhrasesResponse_httpStatus,
    batchDetectKeyPhrasesResponse_resultList,
    batchDetectKeyPhrasesResponse_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:/ 'newBatchDetectKeyPhrases' smart constructor.
data BatchDetectKeyPhrases = BatchDetectKeyPhrases'
  { -- | 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.
    BatchDetectKeyPhrases -> 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.
    BatchDetectKeyPhrases -> LanguageCode
languageCode :: LanguageCode
  }
  deriving (BatchDetectKeyPhrases -> BatchDetectKeyPhrases -> Bool
(BatchDetectKeyPhrases -> BatchDetectKeyPhrases -> Bool)
-> (BatchDetectKeyPhrases -> BatchDetectKeyPhrases -> Bool)
-> Eq BatchDetectKeyPhrases
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDetectKeyPhrases -> BatchDetectKeyPhrases -> Bool
$c/= :: BatchDetectKeyPhrases -> BatchDetectKeyPhrases -> Bool
== :: BatchDetectKeyPhrases -> BatchDetectKeyPhrases -> Bool
$c== :: BatchDetectKeyPhrases -> BatchDetectKeyPhrases -> Bool
Prelude.Eq, Int -> BatchDetectKeyPhrases -> ShowS
[BatchDetectKeyPhrases] -> ShowS
BatchDetectKeyPhrases -> String
(Int -> BatchDetectKeyPhrases -> ShowS)
-> (BatchDetectKeyPhrases -> String)
-> ([BatchDetectKeyPhrases] -> ShowS)
-> Show BatchDetectKeyPhrases
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDetectKeyPhrases] -> ShowS
$cshowList :: [BatchDetectKeyPhrases] -> ShowS
show :: BatchDetectKeyPhrases -> String
$cshow :: BatchDetectKeyPhrases -> String
showsPrec :: Int -> BatchDetectKeyPhrases -> ShowS
$cshowsPrec :: Int -> BatchDetectKeyPhrases -> ShowS
Prelude.Show, (forall x. BatchDetectKeyPhrases -> Rep BatchDetectKeyPhrases x)
-> (forall x. Rep BatchDetectKeyPhrases x -> BatchDetectKeyPhrases)
-> Generic BatchDetectKeyPhrases
forall x. Rep BatchDetectKeyPhrases x -> BatchDetectKeyPhrases
forall x. BatchDetectKeyPhrases -> Rep BatchDetectKeyPhrases x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchDetectKeyPhrases x -> BatchDetectKeyPhrases
$cfrom :: forall x. BatchDetectKeyPhrases -> Rep BatchDetectKeyPhrases x
Prelude.Generic)

-- |
-- Create a value of 'BatchDetectKeyPhrases' 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', 'batchDetectKeyPhrases_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', 'batchDetectKeyPhrases_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.
newBatchDetectKeyPhrases ::
  -- | 'languageCode'
  LanguageCode ->
  BatchDetectKeyPhrases
newBatchDetectKeyPhrases :: LanguageCode -> BatchDetectKeyPhrases
newBatchDetectKeyPhrases LanguageCode
pLanguageCode_ =
  BatchDetectKeyPhrases' :: Sensitive [Sensitive Text] -> LanguageCode -> BatchDetectKeyPhrases
BatchDetectKeyPhrases'
    { $sel:textList:BatchDetectKeyPhrases' :: Sensitive [Sensitive Text]
textList = Sensitive [Sensitive Text]
forall a. Monoid a => a
Prelude.mempty,
      $sel:languageCode:BatchDetectKeyPhrases' :: 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.
batchDetectKeyPhrases_textList :: Lens.Lens' BatchDetectKeyPhrases [Prelude.Text]
batchDetectKeyPhrases_textList :: ([Text] -> f [Text])
-> BatchDetectKeyPhrases -> f BatchDetectKeyPhrases
batchDetectKeyPhrases_textList = (BatchDetectKeyPhrases -> Sensitive [Sensitive Text])
-> (BatchDetectKeyPhrases
    -> Sensitive [Sensitive Text] -> BatchDetectKeyPhrases)
-> Lens
     BatchDetectKeyPhrases
     BatchDetectKeyPhrases
     (Sensitive [Sensitive Text])
     (Sensitive [Sensitive Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetectKeyPhrases' {Sensitive [Sensitive Text]
textList :: Sensitive [Sensitive Text]
$sel:textList:BatchDetectKeyPhrases' :: BatchDetectKeyPhrases -> Sensitive [Sensitive Text]
textList} -> Sensitive [Sensitive Text]
textList) (\s :: BatchDetectKeyPhrases
s@BatchDetectKeyPhrases' {} Sensitive [Sensitive Text]
a -> BatchDetectKeyPhrases
s {$sel:textList:BatchDetectKeyPhrases' :: Sensitive [Sensitive Text]
textList = Sensitive [Sensitive Text]
a} :: BatchDetectKeyPhrases) ((Sensitive [Sensitive Text] -> f (Sensitive [Sensitive Text]))
 -> BatchDetectKeyPhrases -> f BatchDetectKeyPhrases)
-> (([Text] -> f [Text])
    -> Sensitive [Sensitive Text] -> f (Sensitive [Sensitive Text]))
-> ([Text] -> f [Text])
-> BatchDetectKeyPhrases
-> f BatchDetectKeyPhrases
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.
batchDetectKeyPhrases_languageCode :: Lens.Lens' BatchDetectKeyPhrases LanguageCode
batchDetectKeyPhrases_languageCode :: (LanguageCode -> f LanguageCode)
-> BatchDetectKeyPhrases -> f BatchDetectKeyPhrases
batchDetectKeyPhrases_languageCode = (BatchDetectKeyPhrases -> LanguageCode)
-> (BatchDetectKeyPhrases -> LanguageCode -> BatchDetectKeyPhrases)
-> Lens
     BatchDetectKeyPhrases
     BatchDetectKeyPhrases
     LanguageCode
     LanguageCode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetectKeyPhrases' {LanguageCode
languageCode :: LanguageCode
$sel:languageCode:BatchDetectKeyPhrases' :: BatchDetectKeyPhrases -> LanguageCode
languageCode} -> LanguageCode
languageCode) (\s :: BatchDetectKeyPhrases
s@BatchDetectKeyPhrases' {} LanguageCode
a -> BatchDetectKeyPhrases
s {$sel:languageCode:BatchDetectKeyPhrases' :: LanguageCode
languageCode = LanguageCode
a} :: BatchDetectKeyPhrases)

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

instance Prelude.NFData BatchDetectKeyPhrases

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

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

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

-- |
-- Create a value of 'BatchDetectKeyPhrasesResponse' 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', 'batchDetectKeyPhrasesResponse_httpStatus' - The response's http status code.
--
-- 'resultList', 'batchDetectKeyPhrasesResponse_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', 'batchDetectKeyPhrasesResponse_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.
newBatchDetectKeyPhrasesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchDetectKeyPhrasesResponse
newBatchDetectKeyPhrasesResponse :: Int -> BatchDetectKeyPhrasesResponse
newBatchDetectKeyPhrasesResponse Int
pHttpStatus_ =
  BatchDetectKeyPhrasesResponse' :: Int
-> [BatchDetectKeyPhrasesItemResult]
-> [BatchItemError]
-> BatchDetectKeyPhrasesResponse
BatchDetectKeyPhrasesResponse'
    { $sel:httpStatus:BatchDetectKeyPhrasesResponse' :: Int
httpStatus =
        Int
pHttpStatus_,
      $sel:resultList:BatchDetectKeyPhrasesResponse' :: [BatchDetectKeyPhrasesItemResult]
resultList = [BatchDetectKeyPhrasesItemResult]
forall a. Monoid a => a
Prelude.mempty,
      $sel:errorList:BatchDetectKeyPhrasesResponse' :: [BatchItemError]
errorList = [BatchItemError]
forall a. Monoid a => a
Prelude.mempty
    }

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

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