{-# 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.SageMakerGeoSpatial.Types.VectorEnrichmentJobErrorDetails
-- 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.SageMakerGeoSpatial.Types.VectorEnrichmentJobErrorDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMakerGeoSpatial.Types.VectorEnrichmentJobErrorType

-- | VectorEnrichmentJob error details in response from
-- GetVectorEnrichmentJob.
--
-- /See:/ 'newVectorEnrichmentJobErrorDetails' smart constructor.
data VectorEnrichmentJobErrorDetails = VectorEnrichmentJobErrorDetails'
  { -- | A message that you define and then is processed and rendered by the
    -- Vector Enrichment job when the error occurs.
    VectorEnrichmentJobErrorDetails -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
    -- | The type of error generated during the Vector Enrichment job.
    VectorEnrichmentJobErrorDetails
-> Maybe VectorEnrichmentJobErrorType
errorType :: Prelude.Maybe VectorEnrichmentJobErrorType
  }
  deriving (VectorEnrichmentJobErrorDetails
-> VectorEnrichmentJobErrorDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VectorEnrichmentJobErrorDetails
-> VectorEnrichmentJobErrorDetails -> Bool
$c/= :: VectorEnrichmentJobErrorDetails
-> VectorEnrichmentJobErrorDetails -> Bool
== :: VectorEnrichmentJobErrorDetails
-> VectorEnrichmentJobErrorDetails -> Bool
$c== :: VectorEnrichmentJobErrorDetails
-> VectorEnrichmentJobErrorDetails -> Bool
Prelude.Eq, ReadPrec [VectorEnrichmentJobErrorDetails]
ReadPrec VectorEnrichmentJobErrorDetails
Int -> ReadS VectorEnrichmentJobErrorDetails
ReadS [VectorEnrichmentJobErrorDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VectorEnrichmentJobErrorDetails]
$creadListPrec :: ReadPrec [VectorEnrichmentJobErrorDetails]
readPrec :: ReadPrec VectorEnrichmentJobErrorDetails
$creadPrec :: ReadPrec VectorEnrichmentJobErrorDetails
readList :: ReadS [VectorEnrichmentJobErrorDetails]
$creadList :: ReadS [VectorEnrichmentJobErrorDetails]
readsPrec :: Int -> ReadS VectorEnrichmentJobErrorDetails
$creadsPrec :: Int -> ReadS VectorEnrichmentJobErrorDetails
Prelude.Read, Int -> VectorEnrichmentJobErrorDetails -> ShowS
[VectorEnrichmentJobErrorDetails] -> ShowS
VectorEnrichmentJobErrorDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VectorEnrichmentJobErrorDetails] -> ShowS
$cshowList :: [VectorEnrichmentJobErrorDetails] -> ShowS
show :: VectorEnrichmentJobErrorDetails -> String
$cshow :: VectorEnrichmentJobErrorDetails -> String
showsPrec :: Int -> VectorEnrichmentJobErrorDetails -> ShowS
$cshowsPrec :: Int -> VectorEnrichmentJobErrorDetails -> ShowS
Prelude.Show, forall x.
Rep VectorEnrichmentJobErrorDetails x
-> VectorEnrichmentJobErrorDetails
forall x.
VectorEnrichmentJobErrorDetails
-> Rep VectorEnrichmentJobErrorDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VectorEnrichmentJobErrorDetails x
-> VectorEnrichmentJobErrorDetails
$cfrom :: forall x.
VectorEnrichmentJobErrorDetails
-> Rep VectorEnrichmentJobErrorDetails x
Prelude.Generic)

-- |
-- Create a value of 'VectorEnrichmentJobErrorDetails' 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:
--
-- 'errorMessage', 'vectorEnrichmentJobErrorDetails_errorMessage' - A message that you define and then is processed and rendered by the
-- Vector Enrichment job when the error occurs.
--
-- 'errorType', 'vectorEnrichmentJobErrorDetails_errorType' - The type of error generated during the Vector Enrichment job.
newVectorEnrichmentJobErrorDetails ::
  VectorEnrichmentJobErrorDetails
newVectorEnrichmentJobErrorDetails :: VectorEnrichmentJobErrorDetails
newVectorEnrichmentJobErrorDetails =
  VectorEnrichmentJobErrorDetails'
    { $sel:errorMessage:VectorEnrichmentJobErrorDetails' :: Maybe Text
errorMessage =
        forall a. Maybe a
Prelude.Nothing,
      $sel:errorType:VectorEnrichmentJobErrorDetails' :: Maybe VectorEnrichmentJobErrorType
errorType = forall a. Maybe a
Prelude.Nothing
    }

-- | A message that you define and then is processed and rendered by the
-- Vector Enrichment job when the error occurs.
vectorEnrichmentJobErrorDetails_errorMessage :: Lens.Lens' VectorEnrichmentJobErrorDetails (Prelude.Maybe Prelude.Text)
vectorEnrichmentJobErrorDetails_errorMessage :: Lens' VectorEnrichmentJobErrorDetails (Maybe Text)
vectorEnrichmentJobErrorDetails_errorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VectorEnrichmentJobErrorDetails' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:VectorEnrichmentJobErrorDetails' :: VectorEnrichmentJobErrorDetails -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: VectorEnrichmentJobErrorDetails
s@VectorEnrichmentJobErrorDetails' {} Maybe Text
a -> VectorEnrichmentJobErrorDetails
s {$sel:errorMessage:VectorEnrichmentJobErrorDetails' :: Maybe Text
errorMessage = Maybe Text
a} :: VectorEnrichmentJobErrorDetails)

-- | The type of error generated during the Vector Enrichment job.
vectorEnrichmentJobErrorDetails_errorType :: Lens.Lens' VectorEnrichmentJobErrorDetails (Prelude.Maybe VectorEnrichmentJobErrorType)
vectorEnrichmentJobErrorDetails_errorType :: Lens'
  VectorEnrichmentJobErrorDetails
  (Maybe VectorEnrichmentJobErrorType)
vectorEnrichmentJobErrorDetails_errorType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VectorEnrichmentJobErrorDetails' {Maybe VectorEnrichmentJobErrorType
errorType :: Maybe VectorEnrichmentJobErrorType
$sel:errorType:VectorEnrichmentJobErrorDetails' :: VectorEnrichmentJobErrorDetails
-> Maybe VectorEnrichmentJobErrorType
errorType} -> Maybe VectorEnrichmentJobErrorType
errorType) (\s :: VectorEnrichmentJobErrorDetails
s@VectorEnrichmentJobErrorDetails' {} Maybe VectorEnrichmentJobErrorType
a -> VectorEnrichmentJobErrorDetails
s {$sel:errorType:VectorEnrichmentJobErrorDetails' :: Maybe VectorEnrichmentJobErrorType
errorType = Maybe VectorEnrichmentJobErrorType
a} :: VectorEnrichmentJobErrorDetails)

instance
  Data.FromJSON
    VectorEnrichmentJobErrorDetails
  where
  parseJSON :: Value -> Parser VectorEnrichmentJobErrorDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VectorEnrichmentJobErrorDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe VectorEnrichmentJobErrorType
-> VectorEnrichmentJobErrorDetails
VectorEnrichmentJobErrorDetails'
            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
"ErrorMessage")
            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
"ErrorType")
      )

instance
  Prelude.Hashable
    VectorEnrichmentJobErrorDetails
  where
  hashWithSalt :: Int -> VectorEnrichmentJobErrorDetails -> Int
hashWithSalt
    Int
_salt
    VectorEnrichmentJobErrorDetails' {Maybe Text
Maybe VectorEnrichmentJobErrorType
errorType :: Maybe VectorEnrichmentJobErrorType
errorMessage :: Maybe Text
$sel:errorType:VectorEnrichmentJobErrorDetails' :: VectorEnrichmentJobErrorDetails
-> Maybe VectorEnrichmentJobErrorType
$sel:errorMessage:VectorEnrichmentJobErrorDetails' :: VectorEnrichmentJobErrorDetails -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VectorEnrichmentJobErrorType
errorType

instance
  Prelude.NFData
    VectorEnrichmentJobErrorDetails
  where
  rnf :: VectorEnrichmentJobErrorDetails -> ()
rnf VectorEnrichmentJobErrorDetails' {Maybe Text
Maybe VectorEnrichmentJobErrorType
errorType :: Maybe VectorEnrichmentJobErrorType
errorMessage :: Maybe Text
$sel:errorType:VectorEnrichmentJobErrorDetails' :: VectorEnrichmentJobErrorDetails
-> Maybe VectorEnrichmentJobErrorType
$sel:errorMessage:VectorEnrichmentJobErrorDetails' :: VectorEnrichmentJobErrorDetails -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VectorEnrichmentJobErrorType
errorType