{-# 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.ImportAssetsFromS3ResponseDetails
-- 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.ImportAssetsFromS3ResponseDetails where

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

-- | Details from an import from Amazon S3 response.
--
-- /See:/ 'newImportAssetsFromS3ResponseDetails' smart constructor.
data ImportAssetsFromS3ResponseDetails = ImportAssetsFromS3ResponseDetails'
  { -- | The unique identifier for the data set associated with this import job.
    ImportAssetsFromS3ResponseDetails -> Text
dataSetId :: Prelude.Text,
    -- | Is a list of Amazon S3 bucket and object key pairs.
    ImportAssetsFromS3ResponseDetails -> [AssetSourceEntry]
assetSources :: [AssetSourceEntry],
    -- | The unique identifier for the revision associated with this import
    -- response.
    ImportAssetsFromS3ResponseDetails -> Text
revisionId :: Prelude.Text
  }
  deriving (ImportAssetsFromS3ResponseDetails
-> ImportAssetsFromS3ResponseDetails -> Bool
(ImportAssetsFromS3ResponseDetails
 -> ImportAssetsFromS3ResponseDetails -> Bool)
-> (ImportAssetsFromS3ResponseDetails
    -> ImportAssetsFromS3ResponseDetails -> Bool)
-> Eq ImportAssetsFromS3ResponseDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportAssetsFromS3ResponseDetails
-> ImportAssetsFromS3ResponseDetails -> Bool
$c/= :: ImportAssetsFromS3ResponseDetails
-> ImportAssetsFromS3ResponseDetails -> Bool
== :: ImportAssetsFromS3ResponseDetails
-> ImportAssetsFromS3ResponseDetails -> Bool
$c== :: ImportAssetsFromS3ResponseDetails
-> ImportAssetsFromS3ResponseDetails -> Bool
Prelude.Eq, ReadPrec [ImportAssetsFromS3ResponseDetails]
ReadPrec ImportAssetsFromS3ResponseDetails
Int -> ReadS ImportAssetsFromS3ResponseDetails
ReadS [ImportAssetsFromS3ResponseDetails]
(Int -> ReadS ImportAssetsFromS3ResponseDetails)
-> ReadS [ImportAssetsFromS3ResponseDetails]
-> ReadPrec ImportAssetsFromS3ResponseDetails
-> ReadPrec [ImportAssetsFromS3ResponseDetails]
-> Read ImportAssetsFromS3ResponseDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportAssetsFromS3ResponseDetails]
$creadListPrec :: ReadPrec [ImportAssetsFromS3ResponseDetails]
readPrec :: ReadPrec ImportAssetsFromS3ResponseDetails
$creadPrec :: ReadPrec ImportAssetsFromS3ResponseDetails
readList :: ReadS [ImportAssetsFromS3ResponseDetails]
$creadList :: ReadS [ImportAssetsFromS3ResponseDetails]
readsPrec :: Int -> ReadS ImportAssetsFromS3ResponseDetails
$creadsPrec :: Int -> ReadS ImportAssetsFromS3ResponseDetails
Prelude.Read, Int -> ImportAssetsFromS3ResponseDetails -> ShowS
[ImportAssetsFromS3ResponseDetails] -> ShowS
ImportAssetsFromS3ResponseDetails -> String
(Int -> ImportAssetsFromS3ResponseDetails -> ShowS)
-> (ImportAssetsFromS3ResponseDetails -> String)
-> ([ImportAssetsFromS3ResponseDetails] -> ShowS)
-> Show ImportAssetsFromS3ResponseDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportAssetsFromS3ResponseDetails] -> ShowS
$cshowList :: [ImportAssetsFromS3ResponseDetails] -> ShowS
show :: ImportAssetsFromS3ResponseDetails -> String
$cshow :: ImportAssetsFromS3ResponseDetails -> String
showsPrec :: Int -> ImportAssetsFromS3ResponseDetails -> ShowS
$cshowsPrec :: Int -> ImportAssetsFromS3ResponseDetails -> ShowS
Prelude.Show, (forall x.
 ImportAssetsFromS3ResponseDetails
 -> Rep ImportAssetsFromS3ResponseDetails x)
-> (forall x.
    Rep ImportAssetsFromS3ResponseDetails x
    -> ImportAssetsFromS3ResponseDetails)
-> Generic ImportAssetsFromS3ResponseDetails
forall x.
Rep ImportAssetsFromS3ResponseDetails x
-> ImportAssetsFromS3ResponseDetails
forall x.
ImportAssetsFromS3ResponseDetails
-> Rep ImportAssetsFromS3ResponseDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ImportAssetsFromS3ResponseDetails x
-> ImportAssetsFromS3ResponseDetails
$cfrom :: forall x.
ImportAssetsFromS3ResponseDetails
-> Rep ImportAssetsFromS3ResponseDetails x
Prelude.Generic)

-- |
-- Create a value of 'ImportAssetsFromS3ResponseDetails' 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:
--
-- 'dataSetId', 'importAssetsFromS3ResponseDetails_dataSetId' - The unique identifier for the data set associated with this import job.
--
-- 'assetSources', 'importAssetsFromS3ResponseDetails_assetSources' - Is a list of Amazon S3 bucket and object key pairs.
--
-- 'revisionId', 'importAssetsFromS3ResponseDetails_revisionId' - The unique identifier for the revision associated with this import
-- response.
newImportAssetsFromS3ResponseDetails ::
  -- | 'dataSetId'
  Prelude.Text ->
  -- | 'revisionId'
  Prelude.Text ->
  ImportAssetsFromS3ResponseDetails
newImportAssetsFromS3ResponseDetails :: Text -> Text -> ImportAssetsFromS3ResponseDetails
newImportAssetsFromS3ResponseDetails
  Text
pDataSetId_
  Text
pRevisionId_ =
    ImportAssetsFromS3ResponseDetails' :: Text
-> [AssetSourceEntry] -> Text -> ImportAssetsFromS3ResponseDetails
ImportAssetsFromS3ResponseDetails'
      { $sel:dataSetId:ImportAssetsFromS3ResponseDetails' :: Text
dataSetId =
          Text
pDataSetId_,
        $sel:assetSources:ImportAssetsFromS3ResponseDetails' :: [AssetSourceEntry]
assetSources = [AssetSourceEntry]
forall a. Monoid a => a
Prelude.mempty,
        $sel:revisionId:ImportAssetsFromS3ResponseDetails' :: Text
revisionId = Text
pRevisionId_
      }

-- | The unique identifier for the data set associated with this import job.
importAssetsFromS3ResponseDetails_dataSetId :: Lens.Lens' ImportAssetsFromS3ResponseDetails Prelude.Text
importAssetsFromS3ResponseDetails_dataSetId :: (Text -> f Text)
-> ImportAssetsFromS3ResponseDetails
-> f ImportAssetsFromS3ResponseDetails
importAssetsFromS3ResponseDetails_dataSetId = (ImportAssetsFromS3ResponseDetails -> Text)
-> (ImportAssetsFromS3ResponseDetails
    -> Text -> ImportAssetsFromS3ResponseDetails)
-> Lens
     ImportAssetsFromS3ResponseDetails
     ImportAssetsFromS3ResponseDetails
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAssetsFromS3ResponseDetails' {Text
dataSetId :: Text
$sel:dataSetId:ImportAssetsFromS3ResponseDetails' :: ImportAssetsFromS3ResponseDetails -> Text
dataSetId} -> Text
dataSetId) (\s :: ImportAssetsFromS3ResponseDetails
s@ImportAssetsFromS3ResponseDetails' {} Text
a -> ImportAssetsFromS3ResponseDetails
s {$sel:dataSetId:ImportAssetsFromS3ResponseDetails' :: Text
dataSetId = Text
a} :: ImportAssetsFromS3ResponseDetails)

-- | Is a list of Amazon S3 bucket and object key pairs.
importAssetsFromS3ResponseDetails_assetSources :: Lens.Lens' ImportAssetsFromS3ResponseDetails [AssetSourceEntry]
importAssetsFromS3ResponseDetails_assetSources :: ([AssetSourceEntry] -> f [AssetSourceEntry])
-> ImportAssetsFromS3ResponseDetails
-> f ImportAssetsFromS3ResponseDetails
importAssetsFromS3ResponseDetails_assetSources = (ImportAssetsFromS3ResponseDetails -> [AssetSourceEntry])
-> (ImportAssetsFromS3ResponseDetails
    -> [AssetSourceEntry] -> ImportAssetsFromS3ResponseDetails)
-> Lens
     ImportAssetsFromS3ResponseDetails
     ImportAssetsFromS3ResponseDetails
     [AssetSourceEntry]
     [AssetSourceEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAssetsFromS3ResponseDetails' {[AssetSourceEntry]
assetSources :: [AssetSourceEntry]
$sel:assetSources:ImportAssetsFromS3ResponseDetails' :: ImportAssetsFromS3ResponseDetails -> [AssetSourceEntry]
assetSources} -> [AssetSourceEntry]
assetSources) (\s :: ImportAssetsFromS3ResponseDetails
s@ImportAssetsFromS3ResponseDetails' {} [AssetSourceEntry]
a -> ImportAssetsFromS3ResponseDetails
s {$sel:assetSources:ImportAssetsFromS3ResponseDetails' :: [AssetSourceEntry]
assetSources = [AssetSourceEntry]
a} :: ImportAssetsFromS3ResponseDetails) (([AssetSourceEntry] -> f [AssetSourceEntry])
 -> ImportAssetsFromS3ResponseDetails
 -> f ImportAssetsFromS3ResponseDetails)
-> (([AssetSourceEntry] -> f [AssetSourceEntry])
    -> [AssetSourceEntry] -> f [AssetSourceEntry])
-> ([AssetSourceEntry] -> f [AssetSourceEntry])
-> ImportAssetsFromS3ResponseDetails
-> f ImportAssetsFromS3ResponseDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AssetSourceEntry] -> f [AssetSourceEntry])
-> [AssetSourceEntry] -> f [AssetSourceEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The unique identifier for the revision associated with this import
-- response.
importAssetsFromS3ResponseDetails_revisionId :: Lens.Lens' ImportAssetsFromS3ResponseDetails Prelude.Text
importAssetsFromS3ResponseDetails_revisionId :: (Text -> f Text)
-> ImportAssetsFromS3ResponseDetails
-> f ImportAssetsFromS3ResponseDetails
importAssetsFromS3ResponseDetails_revisionId = (ImportAssetsFromS3ResponseDetails -> Text)
-> (ImportAssetsFromS3ResponseDetails
    -> Text -> ImportAssetsFromS3ResponseDetails)
-> Lens
     ImportAssetsFromS3ResponseDetails
     ImportAssetsFromS3ResponseDetails
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAssetsFromS3ResponseDetails' {Text
revisionId :: Text
$sel:revisionId:ImportAssetsFromS3ResponseDetails' :: ImportAssetsFromS3ResponseDetails -> Text
revisionId} -> Text
revisionId) (\s :: ImportAssetsFromS3ResponseDetails
s@ImportAssetsFromS3ResponseDetails' {} Text
a -> ImportAssetsFromS3ResponseDetails
s {$sel:revisionId:ImportAssetsFromS3ResponseDetails' :: Text
revisionId = Text
a} :: ImportAssetsFromS3ResponseDetails)

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

instance
  Prelude.Hashable
    ImportAssetsFromS3ResponseDetails

instance
  Prelude.NFData
    ImportAssetsFromS3ResponseDetails