{-# 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.ExportErrorDetails
-- 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.ExportErrorDetails 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.ExportErrorDetailsOutput

-- | The structure for returning the export error details in a
-- GetEarthObservationJob.
--
-- /See:/ 'newExportErrorDetails' smart constructor.
data ExportErrorDetails = ExportErrorDetails'
  { ExportErrorDetails -> Maybe ExportErrorDetailsOutput
exportResults :: Prelude.Maybe ExportErrorDetailsOutput,
    ExportErrorDetails -> Maybe ExportErrorDetailsOutput
exportSourceImages :: Prelude.Maybe ExportErrorDetailsOutput
  }
  deriving (ExportErrorDetails -> ExportErrorDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportErrorDetails -> ExportErrorDetails -> Bool
$c/= :: ExportErrorDetails -> ExportErrorDetails -> Bool
== :: ExportErrorDetails -> ExportErrorDetails -> Bool
$c== :: ExportErrorDetails -> ExportErrorDetails -> Bool
Prelude.Eq, ReadPrec [ExportErrorDetails]
ReadPrec ExportErrorDetails
Int -> ReadS ExportErrorDetails
ReadS [ExportErrorDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportErrorDetails]
$creadListPrec :: ReadPrec [ExportErrorDetails]
readPrec :: ReadPrec ExportErrorDetails
$creadPrec :: ReadPrec ExportErrorDetails
readList :: ReadS [ExportErrorDetails]
$creadList :: ReadS [ExportErrorDetails]
readsPrec :: Int -> ReadS ExportErrorDetails
$creadsPrec :: Int -> ReadS ExportErrorDetails
Prelude.Read, Int -> ExportErrorDetails -> ShowS
[ExportErrorDetails] -> ShowS
ExportErrorDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportErrorDetails] -> ShowS
$cshowList :: [ExportErrorDetails] -> ShowS
show :: ExportErrorDetails -> String
$cshow :: ExportErrorDetails -> String
showsPrec :: Int -> ExportErrorDetails -> ShowS
$cshowsPrec :: Int -> ExportErrorDetails -> ShowS
Prelude.Show, forall x. Rep ExportErrorDetails x -> ExportErrorDetails
forall x. ExportErrorDetails -> Rep ExportErrorDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportErrorDetails x -> ExportErrorDetails
$cfrom :: forall x. ExportErrorDetails -> Rep ExportErrorDetails x
Prelude.Generic)

-- |
-- Create a value of 'ExportErrorDetails' 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:
--
-- 'exportResults', 'exportErrorDetails_exportResults' -
--
-- 'exportSourceImages', 'exportErrorDetails_exportSourceImages' -
newExportErrorDetails ::
  ExportErrorDetails
newExportErrorDetails :: ExportErrorDetails
newExportErrorDetails =
  ExportErrorDetails'
    { $sel:exportResults:ExportErrorDetails' :: Maybe ExportErrorDetailsOutput
exportResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:exportSourceImages:ExportErrorDetails' :: Maybe ExportErrorDetailsOutput
exportSourceImages = forall a. Maybe a
Prelude.Nothing
    }

exportErrorDetails_exportResults :: Lens.Lens' ExportErrorDetails (Prelude.Maybe ExportErrorDetailsOutput)
exportErrorDetails_exportResults :: Lens' ExportErrorDetails (Maybe ExportErrorDetailsOutput)
exportErrorDetails_exportResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportErrorDetails' {Maybe ExportErrorDetailsOutput
exportResults :: Maybe ExportErrorDetailsOutput
$sel:exportResults:ExportErrorDetails' :: ExportErrorDetails -> Maybe ExportErrorDetailsOutput
exportResults} -> Maybe ExportErrorDetailsOutput
exportResults) (\s :: ExportErrorDetails
s@ExportErrorDetails' {} Maybe ExportErrorDetailsOutput
a -> ExportErrorDetails
s {$sel:exportResults:ExportErrorDetails' :: Maybe ExportErrorDetailsOutput
exportResults = Maybe ExportErrorDetailsOutput
a} :: ExportErrorDetails)

exportErrorDetails_exportSourceImages :: Lens.Lens' ExportErrorDetails (Prelude.Maybe ExportErrorDetailsOutput)
exportErrorDetails_exportSourceImages :: Lens' ExportErrorDetails (Maybe ExportErrorDetailsOutput)
exportErrorDetails_exportSourceImages = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportErrorDetails' {Maybe ExportErrorDetailsOutput
exportSourceImages :: Maybe ExportErrorDetailsOutput
$sel:exportSourceImages:ExportErrorDetails' :: ExportErrorDetails -> Maybe ExportErrorDetailsOutput
exportSourceImages} -> Maybe ExportErrorDetailsOutput
exportSourceImages) (\s :: ExportErrorDetails
s@ExportErrorDetails' {} Maybe ExportErrorDetailsOutput
a -> ExportErrorDetails
s {$sel:exportSourceImages:ExportErrorDetails' :: Maybe ExportErrorDetailsOutput
exportSourceImages = Maybe ExportErrorDetailsOutput
a} :: ExportErrorDetails)

instance Data.FromJSON ExportErrorDetails where
  parseJSON :: Value -> Parser ExportErrorDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ExportErrorDetails"
      ( \Object
x ->
          Maybe ExportErrorDetailsOutput
-> Maybe ExportErrorDetailsOutput -> ExportErrorDetails
ExportErrorDetails'
            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
"ExportResults")
            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
"ExportSourceImages")
      )

instance Prelude.Hashable ExportErrorDetails where
  hashWithSalt :: Int -> ExportErrorDetails -> Int
hashWithSalt Int
_salt ExportErrorDetails' {Maybe ExportErrorDetailsOutput
exportSourceImages :: Maybe ExportErrorDetailsOutput
exportResults :: Maybe ExportErrorDetailsOutput
$sel:exportSourceImages:ExportErrorDetails' :: ExportErrorDetails -> Maybe ExportErrorDetailsOutput
$sel:exportResults:ExportErrorDetails' :: ExportErrorDetails -> Maybe ExportErrorDetailsOutput
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExportErrorDetailsOutput
exportResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExportErrorDetailsOutput
exportSourceImages

instance Prelude.NFData ExportErrorDetails where
  rnf :: ExportErrorDetails -> ()
rnf ExportErrorDetails' {Maybe ExportErrorDetailsOutput
exportSourceImages :: Maybe ExportErrorDetailsOutput
exportResults :: Maybe ExportErrorDetailsOutput
$sel:exportSourceImages:ExportErrorDetails' :: ExportErrorDetails -> Maybe ExportErrorDetailsOutput
$sel:exportResults:ExportErrorDetails' :: ExportErrorDetails -> Maybe ExportErrorDetailsOutput
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ExportErrorDetailsOutput
exportResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ExportErrorDetailsOutput
exportSourceImages