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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Details of the operation to be performed by the job.
--
-- /See:/ 'newImportAssetFromSignedUrlRequestDetails' smart constructor.
data ImportAssetFromSignedUrlRequestDetails = ImportAssetFromSignedUrlRequestDetails'
  { -- | The unique identifier for the data set associated with this import job.
    ImportAssetFromSignedUrlRequestDetails -> Text
dataSetId :: Prelude.Text,
    -- | The Base64-encoded Md5 hash for the asset, used to ensure the integrity
    -- of the file at that location.
    ImportAssetFromSignedUrlRequestDetails -> Text
md5Hash :: Prelude.Text,
    -- | The name of the asset. When importing from Amazon S3, the S3 object key
    -- is used as the asset name.
    ImportAssetFromSignedUrlRequestDetails -> Text
assetName :: Prelude.Text,
    -- | The unique identifier for the revision associated with this import
    -- request.
    ImportAssetFromSignedUrlRequestDetails -> Text
revisionId :: Prelude.Text
  }
  deriving (ImportAssetFromSignedUrlRequestDetails
-> ImportAssetFromSignedUrlRequestDetails -> Bool
(ImportAssetFromSignedUrlRequestDetails
 -> ImportAssetFromSignedUrlRequestDetails -> Bool)
-> (ImportAssetFromSignedUrlRequestDetails
    -> ImportAssetFromSignedUrlRequestDetails -> Bool)
-> Eq ImportAssetFromSignedUrlRequestDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportAssetFromSignedUrlRequestDetails
-> ImportAssetFromSignedUrlRequestDetails -> Bool
$c/= :: ImportAssetFromSignedUrlRequestDetails
-> ImportAssetFromSignedUrlRequestDetails -> Bool
== :: ImportAssetFromSignedUrlRequestDetails
-> ImportAssetFromSignedUrlRequestDetails -> Bool
$c== :: ImportAssetFromSignedUrlRequestDetails
-> ImportAssetFromSignedUrlRequestDetails -> Bool
Prelude.Eq, ReadPrec [ImportAssetFromSignedUrlRequestDetails]
ReadPrec ImportAssetFromSignedUrlRequestDetails
Int -> ReadS ImportAssetFromSignedUrlRequestDetails
ReadS [ImportAssetFromSignedUrlRequestDetails]
(Int -> ReadS ImportAssetFromSignedUrlRequestDetails)
-> ReadS [ImportAssetFromSignedUrlRequestDetails]
-> ReadPrec ImportAssetFromSignedUrlRequestDetails
-> ReadPrec [ImportAssetFromSignedUrlRequestDetails]
-> Read ImportAssetFromSignedUrlRequestDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportAssetFromSignedUrlRequestDetails]
$creadListPrec :: ReadPrec [ImportAssetFromSignedUrlRequestDetails]
readPrec :: ReadPrec ImportAssetFromSignedUrlRequestDetails
$creadPrec :: ReadPrec ImportAssetFromSignedUrlRequestDetails
readList :: ReadS [ImportAssetFromSignedUrlRequestDetails]
$creadList :: ReadS [ImportAssetFromSignedUrlRequestDetails]
readsPrec :: Int -> ReadS ImportAssetFromSignedUrlRequestDetails
$creadsPrec :: Int -> ReadS ImportAssetFromSignedUrlRequestDetails
Prelude.Read, Int -> ImportAssetFromSignedUrlRequestDetails -> ShowS
[ImportAssetFromSignedUrlRequestDetails] -> ShowS
ImportAssetFromSignedUrlRequestDetails -> String
(Int -> ImportAssetFromSignedUrlRequestDetails -> ShowS)
-> (ImportAssetFromSignedUrlRequestDetails -> String)
-> ([ImportAssetFromSignedUrlRequestDetails] -> ShowS)
-> Show ImportAssetFromSignedUrlRequestDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportAssetFromSignedUrlRequestDetails] -> ShowS
$cshowList :: [ImportAssetFromSignedUrlRequestDetails] -> ShowS
show :: ImportAssetFromSignedUrlRequestDetails -> String
$cshow :: ImportAssetFromSignedUrlRequestDetails -> String
showsPrec :: Int -> ImportAssetFromSignedUrlRequestDetails -> ShowS
$cshowsPrec :: Int -> ImportAssetFromSignedUrlRequestDetails -> ShowS
Prelude.Show, (forall x.
 ImportAssetFromSignedUrlRequestDetails
 -> Rep ImportAssetFromSignedUrlRequestDetails x)
-> (forall x.
    Rep ImportAssetFromSignedUrlRequestDetails x
    -> ImportAssetFromSignedUrlRequestDetails)
-> Generic ImportAssetFromSignedUrlRequestDetails
forall x.
Rep ImportAssetFromSignedUrlRequestDetails x
-> ImportAssetFromSignedUrlRequestDetails
forall x.
ImportAssetFromSignedUrlRequestDetails
-> Rep ImportAssetFromSignedUrlRequestDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ImportAssetFromSignedUrlRequestDetails x
-> ImportAssetFromSignedUrlRequestDetails
$cfrom :: forall x.
ImportAssetFromSignedUrlRequestDetails
-> Rep ImportAssetFromSignedUrlRequestDetails x
Prelude.Generic)

-- |
-- Create a value of 'ImportAssetFromSignedUrlRequestDetails' 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', 'importAssetFromSignedUrlRequestDetails_dataSetId' - The unique identifier for the data set associated with this import job.
--
-- 'md5Hash', 'importAssetFromSignedUrlRequestDetails_md5Hash' - The Base64-encoded Md5 hash for the asset, used to ensure the integrity
-- of the file at that location.
--
-- 'assetName', 'importAssetFromSignedUrlRequestDetails_assetName' - The name of the asset. When importing from Amazon S3, the S3 object key
-- is used as the asset name.
--
-- 'revisionId', 'importAssetFromSignedUrlRequestDetails_revisionId' - The unique identifier for the revision associated with this import
-- request.
newImportAssetFromSignedUrlRequestDetails ::
  -- | 'dataSetId'
  Prelude.Text ->
  -- | 'md5Hash'
  Prelude.Text ->
  -- | 'assetName'
  Prelude.Text ->
  -- | 'revisionId'
  Prelude.Text ->
  ImportAssetFromSignedUrlRequestDetails
newImportAssetFromSignedUrlRequestDetails :: Text
-> Text -> Text -> Text -> ImportAssetFromSignedUrlRequestDetails
newImportAssetFromSignedUrlRequestDetails
  Text
pDataSetId_
  Text
pMd5Hash_
  Text
pAssetName_
  Text
pRevisionId_ =
    ImportAssetFromSignedUrlRequestDetails' :: Text
-> Text -> Text -> Text -> ImportAssetFromSignedUrlRequestDetails
ImportAssetFromSignedUrlRequestDetails'
      { $sel:dataSetId:ImportAssetFromSignedUrlRequestDetails' :: Text
dataSetId =
          Text
pDataSetId_,
        $sel:md5Hash:ImportAssetFromSignedUrlRequestDetails' :: Text
md5Hash = Text
pMd5Hash_,
        $sel:assetName:ImportAssetFromSignedUrlRequestDetails' :: Text
assetName = Text
pAssetName_,
        $sel:revisionId:ImportAssetFromSignedUrlRequestDetails' :: Text
revisionId = Text
pRevisionId_
      }

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

-- | The Base64-encoded Md5 hash for the asset, used to ensure the integrity
-- of the file at that location.
importAssetFromSignedUrlRequestDetails_md5Hash :: Lens.Lens' ImportAssetFromSignedUrlRequestDetails Prelude.Text
importAssetFromSignedUrlRequestDetails_md5Hash :: (Text -> f Text)
-> ImportAssetFromSignedUrlRequestDetails
-> f ImportAssetFromSignedUrlRequestDetails
importAssetFromSignedUrlRequestDetails_md5Hash = (ImportAssetFromSignedUrlRequestDetails -> Text)
-> (ImportAssetFromSignedUrlRequestDetails
    -> Text -> ImportAssetFromSignedUrlRequestDetails)
-> Lens
     ImportAssetFromSignedUrlRequestDetails
     ImportAssetFromSignedUrlRequestDetails
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAssetFromSignedUrlRequestDetails' {Text
md5Hash :: Text
$sel:md5Hash:ImportAssetFromSignedUrlRequestDetails' :: ImportAssetFromSignedUrlRequestDetails -> Text
md5Hash} -> Text
md5Hash) (\s :: ImportAssetFromSignedUrlRequestDetails
s@ImportAssetFromSignedUrlRequestDetails' {} Text
a -> ImportAssetFromSignedUrlRequestDetails
s {$sel:md5Hash:ImportAssetFromSignedUrlRequestDetails' :: Text
md5Hash = Text
a} :: ImportAssetFromSignedUrlRequestDetails)

-- | The name of the asset. When importing from Amazon S3, the S3 object key
-- is used as the asset name.
importAssetFromSignedUrlRequestDetails_assetName :: Lens.Lens' ImportAssetFromSignedUrlRequestDetails Prelude.Text
importAssetFromSignedUrlRequestDetails_assetName :: (Text -> f Text)
-> ImportAssetFromSignedUrlRequestDetails
-> f ImportAssetFromSignedUrlRequestDetails
importAssetFromSignedUrlRequestDetails_assetName = (ImportAssetFromSignedUrlRequestDetails -> Text)
-> (ImportAssetFromSignedUrlRequestDetails
    -> Text -> ImportAssetFromSignedUrlRequestDetails)
-> Lens
     ImportAssetFromSignedUrlRequestDetails
     ImportAssetFromSignedUrlRequestDetails
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAssetFromSignedUrlRequestDetails' {Text
assetName :: Text
$sel:assetName:ImportAssetFromSignedUrlRequestDetails' :: ImportAssetFromSignedUrlRequestDetails -> Text
assetName} -> Text
assetName) (\s :: ImportAssetFromSignedUrlRequestDetails
s@ImportAssetFromSignedUrlRequestDetails' {} Text
a -> ImportAssetFromSignedUrlRequestDetails
s {$sel:assetName:ImportAssetFromSignedUrlRequestDetails' :: Text
assetName = Text
a} :: ImportAssetFromSignedUrlRequestDetails)

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

instance
  Prelude.Hashable
    ImportAssetFromSignedUrlRequestDetails

instance
  Prelude.NFData
    ImportAssetFromSignedUrlRequestDetails

instance
  Core.ToJSON
    ImportAssetFromSignedUrlRequestDetails
  where
  toJSON :: ImportAssetFromSignedUrlRequestDetails -> Value
toJSON ImportAssetFromSignedUrlRequestDetails' {Text
revisionId :: Text
assetName :: Text
md5Hash :: Text
dataSetId :: Text
$sel:revisionId:ImportAssetFromSignedUrlRequestDetails' :: ImportAssetFromSignedUrlRequestDetails -> Text
$sel:assetName:ImportAssetFromSignedUrlRequestDetails' :: ImportAssetFromSignedUrlRequestDetails -> Text
$sel:md5Hash:ImportAssetFromSignedUrlRequestDetails' :: ImportAssetFromSignedUrlRequestDetails -> Text
$sel:dataSetId:ImportAssetFromSignedUrlRequestDetails' :: ImportAssetFromSignedUrlRequestDetails -> 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
"Md5Hash" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
md5Hash),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AssetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
assetName),
            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)
          ]
      )