{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Kendra.Types.BatchGetDocumentStatusResponseError
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Kendra.Types.BatchGetDocumentStatusResponseError where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kendra.Types.ErrorCode
import qualified Amazonka.Prelude as Prelude

-- | Provides a response when the status of a document could not be
-- retrieved.
--
-- /See:/ 'newBatchGetDocumentStatusResponseError' smart constructor.
data BatchGetDocumentStatusResponseError = BatchGetDocumentStatusResponseError'
  { -- | The identifier of the document whose status could not be retrieved.
    BatchGetDocumentStatusResponseError -> Maybe Text
documentId :: Prelude.Maybe Prelude.Text,
    -- | Indicates the source of the error.
    BatchGetDocumentStatusResponseError -> Maybe ErrorCode
errorCode :: Prelude.Maybe ErrorCode,
    -- | States that the API could not get the status of a document. This could
    -- be because the request is not valid or there is a system error.
    BatchGetDocumentStatusResponseError -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchGetDocumentStatusResponseError
-> BatchGetDocumentStatusResponseError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetDocumentStatusResponseError
-> BatchGetDocumentStatusResponseError -> Bool
$c/= :: BatchGetDocumentStatusResponseError
-> BatchGetDocumentStatusResponseError -> Bool
== :: BatchGetDocumentStatusResponseError
-> BatchGetDocumentStatusResponseError -> Bool
$c== :: BatchGetDocumentStatusResponseError
-> BatchGetDocumentStatusResponseError -> Bool
Prelude.Eq, ReadPrec [BatchGetDocumentStatusResponseError]
ReadPrec BatchGetDocumentStatusResponseError
Int -> ReadS BatchGetDocumentStatusResponseError
ReadS [BatchGetDocumentStatusResponseError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetDocumentStatusResponseError]
$creadListPrec :: ReadPrec [BatchGetDocumentStatusResponseError]
readPrec :: ReadPrec BatchGetDocumentStatusResponseError
$creadPrec :: ReadPrec BatchGetDocumentStatusResponseError
readList :: ReadS [BatchGetDocumentStatusResponseError]
$creadList :: ReadS [BatchGetDocumentStatusResponseError]
readsPrec :: Int -> ReadS BatchGetDocumentStatusResponseError
$creadsPrec :: Int -> ReadS BatchGetDocumentStatusResponseError
Prelude.Read, Int -> BatchGetDocumentStatusResponseError -> ShowS
[BatchGetDocumentStatusResponseError] -> ShowS
BatchGetDocumentStatusResponseError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetDocumentStatusResponseError] -> ShowS
$cshowList :: [BatchGetDocumentStatusResponseError] -> ShowS
show :: BatchGetDocumentStatusResponseError -> String
$cshow :: BatchGetDocumentStatusResponseError -> String
showsPrec :: Int -> BatchGetDocumentStatusResponseError -> ShowS
$cshowsPrec :: Int -> BatchGetDocumentStatusResponseError -> ShowS
Prelude.Show, forall x.
Rep BatchGetDocumentStatusResponseError x
-> BatchGetDocumentStatusResponseError
forall x.
BatchGetDocumentStatusResponseError
-> Rep BatchGetDocumentStatusResponseError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetDocumentStatusResponseError x
-> BatchGetDocumentStatusResponseError
$cfrom :: forall x.
BatchGetDocumentStatusResponseError
-> Rep BatchGetDocumentStatusResponseError x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetDocumentStatusResponseError' 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:
--
-- 'documentId', 'batchGetDocumentStatusResponseError_documentId' - The identifier of the document whose status could not be retrieved.
--
-- 'errorCode', 'batchGetDocumentStatusResponseError_errorCode' - Indicates the source of the error.
--
-- 'errorMessage', 'batchGetDocumentStatusResponseError_errorMessage' - States that the API could not get the status of a document. This could
-- be because the request is not valid or there is a system error.
newBatchGetDocumentStatusResponseError ::
  BatchGetDocumentStatusResponseError
newBatchGetDocumentStatusResponseError :: BatchGetDocumentStatusResponseError
newBatchGetDocumentStatusResponseError =
  BatchGetDocumentStatusResponseError'
    { $sel:documentId:BatchGetDocumentStatusResponseError' :: Maybe Text
documentId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:errorCode:BatchGetDocumentStatusResponseError' :: Maybe ErrorCode
errorCode = forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:BatchGetDocumentStatusResponseError' :: Maybe Text
errorMessage = forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of the document whose status could not be retrieved.
batchGetDocumentStatusResponseError_documentId :: Lens.Lens' BatchGetDocumentStatusResponseError (Prelude.Maybe Prelude.Text)
batchGetDocumentStatusResponseError_documentId :: Lens' BatchGetDocumentStatusResponseError (Maybe Text)
batchGetDocumentStatusResponseError_documentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetDocumentStatusResponseError' {Maybe Text
documentId :: Maybe Text
$sel:documentId:BatchGetDocumentStatusResponseError' :: BatchGetDocumentStatusResponseError -> Maybe Text
documentId} -> Maybe Text
documentId) (\s :: BatchGetDocumentStatusResponseError
s@BatchGetDocumentStatusResponseError' {} Maybe Text
a -> BatchGetDocumentStatusResponseError
s {$sel:documentId:BatchGetDocumentStatusResponseError' :: Maybe Text
documentId = Maybe Text
a} :: BatchGetDocumentStatusResponseError)

-- | Indicates the source of the error.
batchGetDocumentStatusResponseError_errorCode :: Lens.Lens' BatchGetDocumentStatusResponseError (Prelude.Maybe ErrorCode)
batchGetDocumentStatusResponseError_errorCode :: Lens' BatchGetDocumentStatusResponseError (Maybe ErrorCode)
batchGetDocumentStatusResponseError_errorCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetDocumentStatusResponseError' {Maybe ErrorCode
errorCode :: Maybe ErrorCode
$sel:errorCode:BatchGetDocumentStatusResponseError' :: BatchGetDocumentStatusResponseError -> Maybe ErrorCode
errorCode} -> Maybe ErrorCode
errorCode) (\s :: BatchGetDocumentStatusResponseError
s@BatchGetDocumentStatusResponseError' {} Maybe ErrorCode
a -> BatchGetDocumentStatusResponseError
s {$sel:errorCode:BatchGetDocumentStatusResponseError' :: Maybe ErrorCode
errorCode = Maybe ErrorCode
a} :: BatchGetDocumentStatusResponseError)

-- | States that the API could not get the status of a document. This could
-- be because the request is not valid or there is a system error.
batchGetDocumentStatusResponseError_errorMessage :: Lens.Lens' BatchGetDocumentStatusResponseError (Prelude.Maybe Prelude.Text)
batchGetDocumentStatusResponseError_errorMessage :: Lens' BatchGetDocumentStatusResponseError (Maybe Text)
batchGetDocumentStatusResponseError_errorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetDocumentStatusResponseError' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:BatchGetDocumentStatusResponseError' :: BatchGetDocumentStatusResponseError -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: BatchGetDocumentStatusResponseError
s@BatchGetDocumentStatusResponseError' {} Maybe Text
a -> BatchGetDocumentStatusResponseError
s {$sel:errorMessage:BatchGetDocumentStatusResponseError' :: Maybe Text
errorMessage = Maybe Text
a} :: BatchGetDocumentStatusResponseError)

instance
  Data.FromJSON
    BatchGetDocumentStatusResponseError
  where
  parseJSON :: Value -> Parser BatchGetDocumentStatusResponseError
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchGetDocumentStatusResponseError"
      ( \Object
x ->
          Maybe Text
-> Maybe ErrorCode
-> Maybe Text
-> BatchGetDocumentStatusResponseError
BatchGetDocumentStatusResponseError'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DocumentId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ErrorCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ErrorMessage")
      )

instance
  Prelude.Hashable
    BatchGetDocumentStatusResponseError
  where
  hashWithSalt :: Int -> BatchGetDocumentStatusResponseError -> Int
hashWithSalt
    Int
_salt
    BatchGetDocumentStatusResponseError' {Maybe Text
Maybe ErrorCode
errorMessage :: Maybe Text
errorCode :: Maybe ErrorCode
documentId :: Maybe Text
$sel:errorMessage:BatchGetDocumentStatusResponseError' :: BatchGetDocumentStatusResponseError -> Maybe Text
$sel:errorCode:BatchGetDocumentStatusResponseError' :: BatchGetDocumentStatusResponseError -> Maybe ErrorCode
$sel:documentId:BatchGetDocumentStatusResponseError' :: BatchGetDocumentStatusResponseError -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
documentId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ErrorCode
errorCode
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage

instance
  Prelude.NFData
    BatchGetDocumentStatusResponseError
  where
  rnf :: BatchGetDocumentStatusResponseError -> ()
rnf BatchGetDocumentStatusResponseError' {Maybe Text
Maybe ErrorCode
errorMessage :: Maybe Text
errorCode :: Maybe ErrorCode
documentId :: Maybe Text
$sel:errorMessage:BatchGetDocumentStatusResponseError' :: BatchGetDocumentStatusResponseError -> Maybe Text
$sel:errorCode:BatchGetDocumentStatusResponseError' :: BatchGetDocumentStatusResponseError -> Maybe ErrorCode
$sel:documentId:BatchGetDocumentStatusResponseError' :: BatchGetDocumentStatusResponseError -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
documentId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ErrorCode
errorCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorMessage