{-# 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.Discovery.Types.BatchDeleteImportDataError
-- 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.Discovery.Types.BatchDeleteImportDataError where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Discovery.Types.BatchDeleteImportDataErrorCode
import qualified Amazonka.Prelude as Prelude

-- | Error messages returned for each import task that you deleted as a
-- response for this command.
--
-- /See:/ 'newBatchDeleteImportDataError' smart constructor.
data BatchDeleteImportDataError = BatchDeleteImportDataError'
  { -- | The type of error that occurred for a specific import task.
    BatchDeleteImportDataError -> Maybe BatchDeleteImportDataErrorCode
errorCode :: Prelude.Maybe BatchDeleteImportDataErrorCode,
    -- | The description of the error that occurred for a specific import task.
    BatchDeleteImportDataError -> Maybe Text
errorDescription :: Prelude.Maybe Prelude.Text,
    -- | The unique import ID associated with the error that occurred.
    BatchDeleteImportDataError -> Maybe Text
importTaskId :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchDeleteImportDataError -> BatchDeleteImportDataError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDeleteImportDataError -> BatchDeleteImportDataError -> Bool
$c/= :: BatchDeleteImportDataError -> BatchDeleteImportDataError -> Bool
== :: BatchDeleteImportDataError -> BatchDeleteImportDataError -> Bool
$c== :: BatchDeleteImportDataError -> BatchDeleteImportDataError -> Bool
Prelude.Eq, ReadPrec [BatchDeleteImportDataError]
ReadPrec BatchDeleteImportDataError
Int -> ReadS BatchDeleteImportDataError
ReadS [BatchDeleteImportDataError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDeleteImportDataError]
$creadListPrec :: ReadPrec [BatchDeleteImportDataError]
readPrec :: ReadPrec BatchDeleteImportDataError
$creadPrec :: ReadPrec BatchDeleteImportDataError
readList :: ReadS [BatchDeleteImportDataError]
$creadList :: ReadS [BatchDeleteImportDataError]
readsPrec :: Int -> ReadS BatchDeleteImportDataError
$creadsPrec :: Int -> ReadS BatchDeleteImportDataError
Prelude.Read, Int -> BatchDeleteImportDataError -> ShowS
[BatchDeleteImportDataError] -> ShowS
BatchDeleteImportDataError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDeleteImportDataError] -> ShowS
$cshowList :: [BatchDeleteImportDataError] -> ShowS
show :: BatchDeleteImportDataError -> String
$cshow :: BatchDeleteImportDataError -> String
showsPrec :: Int -> BatchDeleteImportDataError -> ShowS
$cshowsPrec :: Int -> BatchDeleteImportDataError -> ShowS
Prelude.Show, forall x.
Rep BatchDeleteImportDataError x -> BatchDeleteImportDataError
forall x.
BatchDeleteImportDataError -> Rep BatchDeleteImportDataError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchDeleteImportDataError x -> BatchDeleteImportDataError
$cfrom :: forall x.
BatchDeleteImportDataError -> Rep BatchDeleteImportDataError x
Prelude.Generic)

-- |
-- Create a value of 'BatchDeleteImportDataError' 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:
--
-- 'errorCode', 'batchDeleteImportDataError_errorCode' - The type of error that occurred for a specific import task.
--
-- 'errorDescription', 'batchDeleteImportDataError_errorDescription' - The description of the error that occurred for a specific import task.
--
-- 'importTaskId', 'batchDeleteImportDataError_importTaskId' - The unique import ID associated with the error that occurred.
newBatchDeleteImportDataError ::
  BatchDeleteImportDataError
newBatchDeleteImportDataError :: BatchDeleteImportDataError
newBatchDeleteImportDataError =
  BatchDeleteImportDataError'
    { $sel:errorCode:BatchDeleteImportDataError' :: Maybe BatchDeleteImportDataErrorCode
errorCode =
        forall a. Maybe a
Prelude.Nothing,
      $sel:errorDescription:BatchDeleteImportDataError' :: Maybe Text
errorDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:importTaskId:BatchDeleteImportDataError' :: Maybe Text
importTaskId = forall a. Maybe a
Prelude.Nothing
    }

-- | The type of error that occurred for a specific import task.
batchDeleteImportDataError_errorCode :: Lens.Lens' BatchDeleteImportDataError (Prelude.Maybe BatchDeleteImportDataErrorCode)
batchDeleteImportDataError_errorCode :: Lens'
  BatchDeleteImportDataError (Maybe BatchDeleteImportDataErrorCode)
batchDeleteImportDataError_errorCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteImportDataError' {Maybe BatchDeleteImportDataErrorCode
errorCode :: Maybe BatchDeleteImportDataErrorCode
$sel:errorCode:BatchDeleteImportDataError' :: BatchDeleteImportDataError -> Maybe BatchDeleteImportDataErrorCode
errorCode} -> Maybe BatchDeleteImportDataErrorCode
errorCode) (\s :: BatchDeleteImportDataError
s@BatchDeleteImportDataError' {} Maybe BatchDeleteImportDataErrorCode
a -> BatchDeleteImportDataError
s {$sel:errorCode:BatchDeleteImportDataError' :: Maybe BatchDeleteImportDataErrorCode
errorCode = Maybe BatchDeleteImportDataErrorCode
a} :: BatchDeleteImportDataError)

-- | The description of the error that occurred for a specific import task.
batchDeleteImportDataError_errorDescription :: Lens.Lens' BatchDeleteImportDataError (Prelude.Maybe Prelude.Text)
batchDeleteImportDataError_errorDescription :: Lens' BatchDeleteImportDataError (Maybe Text)
batchDeleteImportDataError_errorDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteImportDataError' {Maybe Text
errorDescription :: Maybe Text
$sel:errorDescription:BatchDeleteImportDataError' :: BatchDeleteImportDataError -> Maybe Text
errorDescription} -> Maybe Text
errorDescription) (\s :: BatchDeleteImportDataError
s@BatchDeleteImportDataError' {} Maybe Text
a -> BatchDeleteImportDataError
s {$sel:errorDescription:BatchDeleteImportDataError' :: Maybe Text
errorDescription = Maybe Text
a} :: BatchDeleteImportDataError)

-- | The unique import ID associated with the error that occurred.
batchDeleteImportDataError_importTaskId :: Lens.Lens' BatchDeleteImportDataError (Prelude.Maybe Prelude.Text)
batchDeleteImportDataError_importTaskId :: Lens' BatchDeleteImportDataError (Maybe Text)
batchDeleteImportDataError_importTaskId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteImportDataError' {Maybe Text
importTaskId :: Maybe Text
$sel:importTaskId:BatchDeleteImportDataError' :: BatchDeleteImportDataError -> Maybe Text
importTaskId} -> Maybe Text
importTaskId) (\s :: BatchDeleteImportDataError
s@BatchDeleteImportDataError' {} Maybe Text
a -> BatchDeleteImportDataError
s {$sel:importTaskId:BatchDeleteImportDataError' :: Maybe Text
importTaskId = Maybe Text
a} :: BatchDeleteImportDataError)

instance Data.FromJSON BatchDeleteImportDataError where
  parseJSON :: Value -> Parser BatchDeleteImportDataError
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchDeleteImportDataError"
      ( \Object
x ->
          Maybe BatchDeleteImportDataErrorCode
-> Maybe Text -> Maybe Text -> BatchDeleteImportDataError
BatchDeleteImportDataError'
            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
"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
"errorDescription")
            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
"importTaskId")
      )

instance Prelude.Hashable BatchDeleteImportDataError where
  hashWithSalt :: Int -> BatchDeleteImportDataError -> Int
hashWithSalt Int
_salt BatchDeleteImportDataError' {Maybe Text
Maybe BatchDeleteImportDataErrorCode
importTaskId :: Maybe Text
errorDescription :: Maybe Text
errorCode :: Maybe BatchDeleteImportDataErrorCode
$sel:importTaskId:BatchDeleteImportDataError' :: BatchDeleteImportDataError -> Maybe Text
$sel:errorDescription:BatchDeleteImportDataError' :: BatchDeleteImportDataError -> Maybe Text
$sel:errorCode:BatchDeleteImportDataError' :: BatchDeleteImportDataError -> Maybe BatchDeleteImportDataErrorCode
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BatchDeleteImportDataErrorCode
errorCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
importTaskId

instance Prelude.NFData BatchDeleteImportDataError where
  rnf :: BatchDeleteImportDataError -> ()
rnf BatchDeleteImportDataError' {Maybe Text
Maybe BatchDeleteImportDataErrorCode
importTaskId :: Maybe Text
errorDescription :: Maybe Text
errorCode :: Maybe BatchDeleteImportDataErrorCode
$sel:importTaskId:BatchDeleteImportDataError' :: BatchDeleteImportDataError -> Maybe Text
$sel:errorDescription:BatchDeleteImportDataError' :: BatchDeleteImportDataError -> Maybe Text
$sel:errorCode:BatchDeleteImportDataError' :: BatchDeleteImportDataError -> Maybe BatchDeleteImportDataErrorCode
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe BatchDeleteImportDataErrorCode
errorCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
importTaskId