{-# 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.ImportAssetsFromS3RequestDetails
-- 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.ImportAssetsFromS3RequestDetails 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 of the operation to be performed by the job.
--
-- /See:/ 'newImportAssetsFromS3RequestDetails' smart constructor.
data ImportAssetsFromS3RequestDetails = ImportAssetsFromS3RequestDetails'
  { -- | The unique identifier for the data set associated with this import job.
    ImportAssetsFromS3RequestDetails -> Text
dataSetId :: Prelude.Text,
    -- | Is a list of S3 bucket and object key pairs.
    ImportAssetsFromS3RequestDetails -> [AssetSourceEntry]
assetSources :: [AssetSourceEntry],
    -- | The unique identifier for the revision associated with this import
    -- request.
    ImportAssetsFromS3RequestDetails -> Text
revisionId :: Prelude.Text
  }
  deriving (ImportAssetsFromS3RequestDetails
-> ImportAssetsFromS3RequestDetails -> Bool
(ImportAssetsFromS3RequestDetails
 -> ImportAssetsFromS3RequestDetails -> Bool)
-> (ImportAssetsFromS3RequestDetails
    -> ImportAssetsFromS3RequestDetails -> Bool)
-> Eq ImportAssetsFromS3RequestDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportAssetsFromS3RequestDetails
-> ImportAssetsFromS3RequestDetails -> Bool
$c/= :: ImportAssetsFromS3RequestDetails
-> ImportAssetsFromS3RequestDetails -> Bool
== :: ImportAssetsFromS3RequestDetails
-> ImportAssetsFromS3RequestDetails -> Bool
$c== :: ImportAssetsFromS3RequestDetails
-> ImportAssetsFromS3RequestDetails -> Bool
Prelude.Eq, ReadPrec [ImportAssetsFromS3RequestDetails]
ReadPrec ImportAssetsFromS3RequestDetails
Int -> ReadS ImportAssetsFromS3RequestDetails
ReadS [ImportAssetsFromS3RequestDetails]
(Int -> ReadS ImportAssetsFromS3RequestDetails)
-> ReadS [ImportAssetsFromS3RequestDetails]
-> ReadPrec ImportAssetsFromS3RequestDetails
-> ReadPrec [ImportAssetsFromS3RequestDetails]
-> Read ImportAssetsFromS3RequestDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportAssetsFromS3RequestDetails]
$creadListPrec :: ReadPrec [ImportAssetsFromS3RequestDetails]
readPrec :: ReadPrec ImportAssetsFromS3RequestDetails
$creadPrec :: ReadPrec ImportAssetsFromS3RequestDetails
readList :: ReadS [ImportAssetsFromS3RequestDetails]
$creadList :: ReadS [ImportAssetsFromS3RequestDetails]
readsPrec :: Int -> ReadS ImportAssetsFromS3RequestDetails
$creadsPrec :: Int -> ReadS ImportAssetsFromS3RequestDetails
Prelude.Read, Int -> ImportAssetsFromS3RequestDetails -> ShowS
[ImportAssetsFromS3RequestDetails] -> ShowS
ImportAssetsFromS3RequestDetails -> String
(Int -> ImportAssetsFromS3RequestDetails -> ShowS)
-> (ImportAssetsFromS3RequestDetails -> String)
-> ([ImportAssetsFromS3RequestDetails] -> ShowS)
-> Show ImportAssetsFromS3RequestDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportAssetsFromS3RequestDetails] -> ShowS
$cshowList :: [ImportAssetsFromS3RequestDetails] -> ShowS
show :: ImportAssetsFromS3RequestDetails -> String
$cshow :: ImportAssetsFromS3RequestDetails -> String
showsPrec :: Int -> ImportAssetsFromS3RequestDetails -> ShowS
$cshowsPrec :: Int -> ImportAssetsFromS3RequestDetails -> ShowS
Prelude.Show, (forall x.
 ImportAssetsFromS3RequestDetails
 -> Rep ImportAssetsFromS3RequestDetails x)
-> (forall x.
    Rep ImportAssetsFromS3RequestDetails x
    -> ImportAssetsFromS3RequestDetails)
-> Generic ImportAssetsFromS3RequestDetails
forall x.
Rep ImportAssetsFromS3RequestDetails x
-> ImportAssetsFromS3RequestDetails
forall x.
ImportAssetsFromS3RequestDetails
-> Rep ImportAssetsFromS3RequestDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ImportAssetsFromS3RequestDetails x
-> ImportAssetsFromS3RequestDetails
$cfrom :: forall x.
ImportAssetsFromS3RequestDetails
-> Rep ImportAssetsFromS3RequestDetails x
Prelude.Generic)

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

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

-- | Is a list of S3 bucket and object key pairs.
importAssetsFromS3RequestDetails_assetSources :: Lens.Lens' ImportAssetsFromS3RequestDetails [AssetSourceEntry]
importAssetsFromS3RequestDetails_assetSources :: ([AssetSourceEntry] -> f [AssetSourceEntry])
-> ImportAssetsFromS3RequestDetails
-> f ImportAssetsFromS3RequestDetails
importAssetsFromS3RequestDetails_assetSources = (ImportAssetsFromS3RequestDetails -> [AssetSourceEntry])
-> (ImportAssetsFromS3RequestDetails
    -> [AssetSourceEntry] -> ImportAssetsFromS3RequestDetails)
-> Lens
     ImportAssetsFromS3RequestDetails
     ImportAssetsFromS3RequestDetails
     [AssetSourceEntry]
     [AssetSourceEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAssetsFromS3RequestDetails' {[AssetSourceEntry]
assetSources :: [AssetSourceEntry]
$sel:assetSources:ImportAssetsFromS3RequestDetails' :: ImportAssetsFromS3RequestDetails -> [AssetSourceEntry]
assetSources} -> [AssetSourceEntry]
assetSources) (\s :: ImportAssetsFromS3RequestDetails
s@ImportAssetsFromS3RequestDetails' {} [AssetSourceEntry]
a -> ImportAssetsFromS3RequestDetails
s {$sel:assetSources:ImportAssetsFromS3RequestDetails' :: [AssetSourceEntry]
assetSources = [AssetSourceEntry]
a} :: ImportAssetsFromS3RequestDetails) (([AssetSourceEntry] -> f [AssetSourceEntry])
 -> ImportAssetsFromS3RequestDetails
 -> f ImportAssetsFromS3RequestDetails)
-> (([AssetSourceEntry] -> f [AssetSourceEntry])
    -> [AssetSourceEntry] -> f [AssetSourceEntry])
-> ([AssetSourceEntry] -> f [AssetSourceEntry])
-> ImportAssetsFromS3RequestDetails
-> f ImportAssetsFromS3RequestDetails
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
-- request.
importAssetsFromS3RequestDetails_revisionId :: Lens.Lens' ImportAssetsFromS3RequestDetails Prelude.Text
importAssetsFromS3RequestDetails_revisionId :: (Text -> f Text)
-> ImportAssetsFromS3RequestDetails
-> f ImportAssetsFromS3RequestDetails
importAssetsFromS3RequestDetails_revisionId = (ImportAssetsFromS3RequestDetails -> Text)
-> (ImportAssetsFromS3RequestDetails
    -> Text -> ImportAssetsFromS3RequestDetails)
-> Lens
     ImportAssetsFromS3RequestDetails
     ImportAssetsFromS3RequestDetails
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAssetsFromS3RequestDetails' {Text
revisionId :: Text
$sel:revisionId:ImportAssetsFromS3RequestDetails' :: ImportAssetsFromS3RequestDetails -> Text
revisionId} -> Text
revisionId) (\s :: ImportAssetsFromS3RequestDetails
s@ImportAssetsFromS3RequestDetails' {} Text
a -> ImportAssetsFromS3RequestDetails
s {$sel:revisionId:ImportAssetsFromS3RequestDetails' :: Text
revisionId = Text
a} :: ImportAssetsFromS3RequestDetails)

instance
  Prelude.Hashable
    ImportAssetsFromS3RequestDetails

instance
  Prelude.NFData
    ImportAssetsFromS3RequestDetails

instance Core.ToJSON ImportAssetsFromS3RequestDetails where
  toJSON :: ImportAssetsFromS3RequestDetails -> Value
toJSON ImportAssetsFromS3RequestDetails' {[AssetSourceEntry]
Text
revisionId :: Text
assetSources :: [AssetSourceEntry]
dataSetId :: Text
$sel:revisionId:ImportAssetsFromS3RequestDetails' :: ImportAssetsFromS3RequestDetails -> Text
$sel:assetSources:ImportAssetsFromS3RequestDetails' :: ImportAssetsFromS3RequestDetails -> [AssetSourceEntry]
$sel:dataSetId:ImportAssetsFromS3RequestDetails' :: ImportAssetsFromS3RequestDetails -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DataSetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dataSetId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AssetSources" Text -> [AssetSourceEntry] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [AssetSourceEntry]
assetSources),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RevisionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
revisionId)
          ]
      )