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

import qualified Amazonka.Core as Core
import Amazonka.Discovery.Types.BatchDeleteImportDataErrorCode
import qualified Amazonka.Lens as Lens
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 unique import ID associated with the error that occurred.
    BatchDeleteImportDataError -> Maybe Text
importTaskId :: Prelude.Maybe Prelude.Text,
    -- | 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
  }
  deriving (BatchDeleteImportDataError -> BatchDeleteImportDataError -> Bool
(BatchDeleteImportDataError -> BatchDeleteImportDataError -> Bool)
-> (BatchDeleteImportDataError
    -> BatchDeleteImportDataError -> Bool)
-> Eq BatchDeleteImportDataError
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]
(Int -> ReadS BatchDeleteImportDataError)
-> ReadS [BatchDeleteImportDataError]
-> ReadPrec BatchDeleteImportDataError
-> ReadPrec [BatchDeleteImportDataError]
-> Read 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
(Int -> BatchDeleteImportDataError -> ShowS)
-> (BatchDeleteImportDataError -> String)
-> ([BatchDeleteImportDataError] -> ShowS)
-> Show BatchDeleteImportDataError
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.
 BatchDeleteImportDataError -> Rep BatchDeleteImportDataError x)
-> (forall x.
    Rep BatchDeleteImportDataError x -> BatchDeleteImportDataError)
-> Generic BatchDeleteImportDataError
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:
--
-- 'importTaskId', 'batchDeleteImportDataError_importTaskId' - The unique import ID associated with the error that occurred.
--
-- '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.
newBatchDeleteImportDataError ::
  BatchDeleteImportDataError
newBatchDeleteImportDataError :: BatchDeleteImportDataError
newBatchDeleteImportDataError =
  BatchDeleteImportDataError' :: Maybe Text
-> Maybe BatchDeleteImportDataErrorCode
-> Maybe Text
-> BatchDeleteImportDataError
BatchDeleteImportDataError'
    { $sel:importTaskId:BatchDeleteImportDataError' :: Maybe Text
importTaskId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorCode:BatchDeleteImportDataError' :: Maybe BatchDeleteImportDataErrorCode
errorCode = Maybe BatchDeleteImportDataErrorCode
forall a. Maybe a
Prelude.Nothing,
      $sel:errorDescription:BatchDeleteImportDataError' :: Maybe Text
errorDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The unique import ID associated with the error that occurred.
batchDeleteImportDataError_importTaskId :: Lens.Lens' BatchDeleteImportDataError (Prelude.Maybe Prelude.Text)
batchDeleteImportDataError_importTaskId :: (Maybe Text -> f (Maybe Text))
-> BatchDeleteImportDataError -> f BatchDeleteImportDataError
batchDeleteImportDataError_importTaskId = (BatchDeleteImportDataError -> Maybe Text)
-> (BatchDeleteImportDataError
    -> Maybe Text -> BatchDeleteImportDataError)
-> Lens
     BatchDeleteImportDataError
     BatchDeleteImportDataError
     (Maybe Text)
     (Maybe Text)
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)

-- | The type of error that occurred for a specific import task.
batchDeleteImportDataError_errorCode :: Lens.Lens' BatchDeleteImportDataError (Prelude.Maybe BatchDeleteImportDataErrorCode)
batchDeleteImportDataError_errorCode :: (Maybe BatchDeleteImportDataErrorCode
 -> f (Maybe BatchDeleteImportDataErrorCode))
-> BatchDeleteImportDataError -> f BatchDeleteImportDataError
batchDeleteImportDataError_errorCode = (BatchDeleteImportDataError
 -> Maybe BatchDeleteImportDataErrorCode)
-> (BatchDeleteImportDataError
    -> Maybe BatchDeleteImportDataErrorCode
    -> BatchDeleteImportDataError)
-> Lens
     BatchDeleteImportDataError
     BatchDeleteImportDataError
     (Maybe BatchDeleteImportDataErrorCode)
     (Maybe BatchDeleteImportDataErrorCode)
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 :: (Maybe Text -> f (Maybe Text))
-> BatchDeleteImportDataError -> f BatchDeleteImportDataError
batchDeleteImportDataError_errorDescription = (BatchDeleteImportDataError -> Maybe Text)
-> (BatchDeleteImportDataError
    -> Maybe Text -> BatchDeleteImportDataError)
-> Lens
     BatchDeleteImportDataError
     BatchDeleteImportDataError
     (Maybe Text)
     (Maybe Text)
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)

instance Core.FromJSON BatchDeleteImportDataError where
  parseJSON :: Value -> Parser BatchDeleteImportDataError
parseJSON =
    String
-> (Object -> Parser BatchDeleteImportDataError)
-> Value
-> Parser BatchDeleteImportDataError
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchDeleteImportDataError"
      ( \Object
x ->
          Maybe Text
-> Maybe BatchDeleteImportDataErrorCode
-> Maybe Text
-> BatchDeleteImportDataError
BatchDeleteImportDataError'
            (Maybe Text
 -> Maybe BatchDeleteImportDataErrorCode
 -> Maybe Text
 -> BatchDeleteImportDataError)
-> Parser (Maybe Text)
-> Parser
     (Maybe BatchDeleteImportDataErrorCode
      -> Maybe Text -> BatchDeleteImportDataError)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"importTaskId")
            Parser
  (Maybe BatchDeleteImportDataErrorCode
   -> Maybe Text -> BatchDeleteImportDataError)
-> Parser (Maybe BatchDeleteImportDataErrorCode)
-> Parser (Maybe Text -> BatchDeleteImportDataError)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BatchDeleteImportDataErrorCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errorCode")
            Parser (Maybe Text -> BatchDeleteImportDataError)
-> Parser (Maybe Text) -> Parser BatchDeleteImportDataError
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errorDescription")
      )

instance Prelude.Hashable BatchDeleteImportDataError

instance Prelude.NFData BatchDeleteImportDataError