{-# 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.DataExchange.Types.Details
-- 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.DataExchange.Types.Details where

import qualified Amazonka.Core as Core
import Amazonka.DataExchange.Types.AssetSourceEntry
import Amazonka.DataExchange.Types.ImportAssetFromSignedUrlJobErrorDetails
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about the job error.
--
-- /See:/ 'newDetails' smart constructor.
data Details = Details'
  { -- | Information about the job error.
    Details -> Maybe ImportAssetFromSignedUrlJobErrorDetails
importAssetFromSignedUrlJobErrorDetails :: Prelude.Maybe ImportAssetFromSignedUrlJobErrorDetails,
    -- | Information about the job error.
    Details -> Maybe [AssetSourceEntry]
importAssetsFromS3JobErrorDetails :: Prelude.Maybe [AssetSourceEntry]
  }
  deriving (Details -> Details -> Bool
(Details -> Details -> Bool)
-> (Details -> Details -> Bool) -> Eq Details
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Details -> Details -> Bool
$c/= :: Details -> Details -> Bool
== :: Details -> Details -> Bool
$c== :: Details -> Details -> Bool
Prelude.Eq, ReadPrec [Details]
ReadPrec Details
Int -> ReadS Details
ReadS [Details]
(Int -> ReadS Details)
-> ReadS [Details]
-> ReadPrec Details
-> ReadPrec [Details]
-> Read Details
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Details]
$creadListPrec :: ReadPrec [Details]
readPrec :: ReadPrec Details
$creadPrec :: ReadPrec Details
readList :: ReadS [Details]
$creadList :: ReadS [Details]
readsPrec :: Int -> ReadS Details
$creadsPrec :: Int -> ReadS Details
Prelude.Read, Int -> Details -> ShowS
[Details] -> ShowS
Details -> String
(Int -> Details -> ShowS)
-> (Details -> String) -> ([Details] -> ShowS) -> Show Details
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Details] -> ShowS
$cshowList :: [Details] -> ShowS
show :: Details -> String
$cshow :: Details -> String
showsPrec :: Int -> Details -> ShowS
$cshowsPrec :: Int -> Details -> ShowS
Prelude.Show, (forall x. Details -> Rep Details x)
-> (forall x. Rep Details x -> Details) -> Generic Details
forall x. Rep Details x -> Details
forall x. Details -> Rep Details x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Details x -> Details
$cfrom :: forall x. Details -> Rep Details x
Prelude.Generic)

-- |
-- Create a value of 'Details' 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:
--
-- 'importAssetFromSignedUrlJobErrorDetails', 'details_importAssetFromSignedUrlJobErrorDetails' - Information about the job error.
--
-- 'importAssetsFromS3JobErrorDetails', 'details_importAssetsFromS3JobErrorDetails' - Information about the job error.
newDetails ::
  Details
newDetails :: Details
newDetails =
  Details' :: Maybe ImportAssetFromSignedUrlJobErrorDetails
-> Maybe [AssetSourceEntry] -> Details
Details'
    { $sel:importAssetFromSignedUrlJobErrorDetails:Details' :: Maybe ImportAssetFromSignedUrlJobErrorDetails
importAssetFromSignedUrlJobErrorDetails =
        Maybe ImportAssetFromSignedUrlJobErrorDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:importAssetsFromS3JobErrorDetails:Details' :: Maybe [AssetSourceEntry]
importAssetsFromS3JobErrorDetails = Maybe [AssetSourceEntry]
forall a. Maybe a
Prelude.Nothing
    }

-- | Information about the job error.
details_importAssetFromSignedUrlJobErrorDetails :: Lens.Lens' Details (Prelude.Maybe ImportAssetFromSignedUrlJobErrorDetails)
details_importAssetFromSignedUrlJobErrorDetails :: (Maybe ImportAssetFromSignedUrlJobErrorDetails
 -> f (Maybe ImportAssetFromSignedUrlJobErrorDetails))
-> Details -> f Details
details_importAssetFromSignedUrlJobErrorDetails = (Details -> Maybe ImportAssetFromSignedUrlJobErrorDetails)
-> (Details
    -> Maybe ImportAssetFromSignedUrlJobErrorDetails -> Details)
-> Lens
     Details
     Details
     (Maybe ImportAssetFromSignedUrlJobErrorDetails)
     (Maybe ImportAssetFromSignedUrlJobErrorDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Details' {Maybe ImportAssetFromSignedUrlJobErrorDetails
importAssetFromSignedUrlJobErrorDetails :: Maybe ImportAssetFromSignedUrlJobErrorDetails
$sel:importAssetFromSignedUrlJobErrorDetails:Details' :: Details -> Maybe ImportAssetFromSignedUrlJobErrorDetails
importAssetFromSignedUrlJobErrorDetails} -> Maybe ImportAssetFromSignedUrlJobErrorDetails
importAssetFromSignedUrlJobErrorDetails) (\s :: Details
s@Details' {} Maybe ImportAssetFromSignedUrlJobErrorDetails
a -> Details
s {$sel:importAssetFromSignedUrlJobErrorDetails:Details' :: Maybe ImportAssetFromSignedUrlJobErrorDetails
importAssetFromSignedUrlJobErrorDetails = Maybe ImportAssetFromSignedUrlJobErrorDetails
a} :: Details)

-- | Information about the job error.
details_importAssetsFromS3JobErrorDetails :: Lens.Lens' Details (Prelude.Maybe [AssetSourceEntry])
details_importAssetsFromS3JobErrorDetails :: (Maybe [AssetSourceEntry] -> f (Maybe [AssetSourceEntry]))
-> Details -> f Details
details_importAssetsFromS3JobErrorDetails = (Details -> Maybe [AssetSourceEntry])
-> (Details -> Maybe [AssetSourceEntry] -> Details)
-> Lens
     Details
     Details
     (Maybe [AssetSourceEntry])
     (Maybe [AssetSourceEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Details' {Maybe [AssetSourceEntry]
importAssetsFromS3JobErrorDetails :: Maybe [AssetSourceEntry]
$sel:importAssetsFromS3JobErrorDetails:Details' :: Details -> Maybe [AssetSourceEntry]
importAssetsFromS3JobErrorDetails} -> Maybe [AssetSourceEntry]
importAssetsFromS3JobErrorDetails) (\s :: Details
s@Details' {} Maybe [AssetSourceEntry]
a -> Details
s {$sel:importAssetsFromS3JobErrorDetails:Details' :: Maybe [AssetSourceEntry]
importAssetsFromS3JobErrorDetails = Maybe [AssetSourceEntry]
a} :: Details) ((Maybe [AssetSourceEntry] -> f (Maybe [AssetSourceEntry]))
 -> Details -> f Details)
-> ((Maybe [AssetSourceEntry] -> f (Maybe [AssetSourceEntry]))
    -> Maybe [AssetSourceEntry] -> f (Maybe [AssetSourceEntry]))
-> (Maybe [AssetSourceEntry] -> f (Maybe [AssetSourceEntry]))
-> Details
-> f Details
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AssetSourceEntry]
  [AssetSourceEntry]
  [AssetSourceEntry]
  [AssetSourceEntry]
-> Iso
     (Maybe [AssetSourceEntry])
     (Maybe [AssetSourceEntry])
     (Maybe [AssetSourceEntry])
     (Maybe [AssetSourceEntry])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [AssetSourceEntry]
  [AssetSourceEntry]
  [AssetSourceEntry]
  [AssetSourceEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON Details where
  parseJSON :: Value -> Parser Details
parseJSON =
    String -> (Object -> Parser Details) -> Value -> Parser Details
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Details"
      ( \Object
x ->
          Maybe ImportAssetFromSignedUrlJobErrorDetails
-> Maybe [AssetSourceEntry] -> Details
Details'
            (Maybe ImportAssetFromSignedUrlJobErrorDetails
 -> Maybe [AssetSourceEntry] -> Details)
-> Parser (Maybe ImportAssetFromSignedUrlJobErrorDetails)
-> Parser (Maybe [AssetSourceEntry] -> Details)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            Object
-> Text -> Parser (Maybe ImportAssetFromSignedUrlJobErrorDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImportAssetFromSignedUrlJobErrorDetails"
                        )
            Parser (Maybe [AssetSourceEntry] -> Details)
-> Parser (Maybe [AssetSourceEntry]) -> Parser Details
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [AssetSourceEntry]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImportAssetsFromS3JobErrorDetails"
                            Parser (Maybe (Maybe [AssetSourceEntry]))
-> Maybe [AssetSourceEntry] -> Parser (Maybe [AssetSourceEntry])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AssetSourceEntry]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable Details

instance Prelude.NFData Details